objc-act.c (objc_check_decl): Don't use xxx_with_decl.
[gcc.git] / gcc / java / ChangeLog
1 2003-07-25 Gabriel Dos Reis <gdr@integrable-solutions.net>
2
3 * expr.c (expand_java_field_op): Don't use xxx_with_decl
4 (expand_java_field_op): Likewise.
5 * class.c (layout_class_method): Likewise
6 (emit_register_classes): Likewise.
7 * decl.c (pushdecl): Likewise.
8 (poplevel): Likewise.
9 (force_poplevels): Likewise.
10 (give_name_to_locals): Likewise.
11 * check-init.c (check_for_initialization): Likewise.
12
13 2003-07-24 Jason Merrill <jason@redhat.com>
14
15 * java-tree.h: Move boolean_type_node et al to the back end.
16
17 2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
18
19 * class.c java-tree.h jcf-write.c jvspec.c: Remove unnecessary
20 casts.
21
22 2003-07-19 Neil Booth <neil@daikokuya.co.uk>
23
24 * lang.opt: Don't show -MD_ and -MDD_.
25
26 2003-07-18 Neil Booth <neil@daikokuya.co.uk>
27
28 * lang-options.h: Remove.
29 * lang.opt: Add help text.
30
31 2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
32
33 * expr.c: Remove the last argument to expand_assignment().
34
35 Wed Jul 9 02:29:15 CEST 2003 Jan Hubicka <jh@suse.cz>
36
37 * java-tree.h (DECL_NUM_STMTS): Rename to...
38 (DECL_ESTIMATED_INSNS): ... this.
39 * lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
40 New static functions.
41 (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
42 * parser.y (add_stmt_to_compound): Do not account statements.
43
44 2003-07-08 Mark Wielaard <mark@klomp.org>
45
46 * gcj.texi: CNI now expands to Compiled Native Interface.
47
48 2003-07-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
49
50 * Make-lang.in (java/gcj.dvi): Use PWD_COMMAND.
51
52 2003-07-07 Nathan Sidwell <nathan@codesourcery.com>
53
54 * expr.c (expand_byte_code): Adjist emit_line_note call.
55
56 2003-07-06 Neil Booth <neil@daikokuya.co.uk>
57
58 * lang.c (java_handle_option): Don't handle filenames.
59
60 2003-07-02 Zack Weinberg <zack@codesourcery.com>
61
62 * jcf-path.c: Don't default-define PATH_SEPARATOR nor
63 DIR_SEPARATOR.
64 Use FILENAME_CMP.
65 * jcf-write.c: Don't default-define DIR_SEPARATOR.
66 * jcf.h: Delete COMPARE_FILENAMES definition.
67
68 2003-07-02 Neil Booth <neil@daikokuya.co.uk>
69
70 * lang.c (java_init_options): Update prototype.
71
72 2003-07-01 Nathan Sidwell <nathan@codesourcery.com>
73
74 * decl.c (poplevel): Adjust define_label call.
75
76 2003-06-27 Zack Weinberg <zack@codesourcery.com>
77
78 * gjavah.c (flag_jni): Make non-static.
79 * parse-scan.y (ctxp): Make non-static.
80
81 * class.c (build_method_symbols_entry)
82 * expr.c (get_offset_table_index)
83 * jcf-parse.c (jcf_parse):
84 Mark the definition static, matching the forward declaration.
85
86 2003-06-26 Neil Booth <neil@daikokuya.co.uk>
87
88 * lang.c (java_handle_option): Don't check for missing arguments.
89
90 2003-06-20 Nathan Sidwell <nathan@codesourcery.com>
91
92 * class.c (push_class): Use a location_t to save place.
93 (emit_register_classes): Set input_location. Adjust
94 expand_function_end call.
95 * resource.c (write_resource_constructor): Likewise.
96 * decl.c (end_java_method): Adjust expand_function_end call.
97 * parse.y (source_end_java_method): Likewise.
98
99 2003-06-17 Robert Abeles <rabeles@archaelogic.com>
100
101 * lang.c (java_handle_option): Likewise.
102
103 2003-06-16 Neil Booth <neil@daikokuya.co.uk>
104
105 * lang.c (java_handle_option): Special-casing of optional
106 joined arguments no longer needed.
107 * lang.opt: Update switches that take optional argument.
108
109 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
110
111 * lang.opt: Declare Java.
112 * lang.c (java_init_options): Update.
113
114 2003-06-15 Neil Booth <neil@daikokuya.co.uk>
115
116 * lang.c (version_flag): Rename to v_flag to avoid clash w/ toplev.h.
117
118 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
119
120 * lang-specs.h: Rewrite -MD and -MMD to append an underscore.
121 * lang.c (java_handle_option): -MD and -MMD have an underscore.
122 * lang.opt: -MD and -MMD have an underscore.
123
124 2003-06-14 Nathan Sidwell <nathan@codesourcery.com>
125
126 * class.c (emit_register_classes): Adjust init_function_start
127 call.
128 * decl.c (complete_start_java_method): Likewise.
129 * resource.c (write_resource_constructor): Likewise.
130
131 2003-06-14 Neil Booth <neil@daikokuya.co.uk>
132
133 * Make-lang.in: Update to use options.c and options.h.
134 * lang.c: Include options.h not j-options.h.
135 (java_handle_option): Abort on unrecognized option.
136 (java_init_options): Request Java switches.
137
138 2003-06-11 Neil Booth <neil@daikokuya.co.uk>
139
140 * Make-lang.in: Handle mostlyclean.
141
142 2003-06-11 Tom Tromey <tromey@redhat.com>
143
144 * lang.c (java_handle_option): Update dependency_tracking for
145 OPT_MF case.
146
147 * lang.c (java_handle_option): OPT_fbootclasspath_ can take an
148 empty argument.
149
150 2003-06-10 Andrew Haley <aph@redhat.com>
151
152 * resource.c (write_resource_constructor): Use expand_expr to
153 generate the address of the label attached to a resource.
154 * Make-lang.in (java/resource.o): Add expr.h
155
156 2003-06-10 Andrew Haley <aph@redhat.com>
157
158 * lang.c (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
159 (java_decl_ok_for_sibcall): New.
160
161 2003-06-09 Neil Booth <neil@daikokuya.co.uk>
162
163 * Make-lang.in (JAVA_OBJS, java/lang.o): Update.
164 (java/j-options.c, java/j-options.h): New.
165 * java-tree.h (resource_name, compile_resource_file,
166 compile_resource_data): Constify.
167 * jcf-write.c (jcf_write_base_directory): Similarly.
168 * jcf.h (jcf_write_base_directory): Similarly.
169 * lang.c: Include j-options.h.
170 (cl_options_count, cl_options, string_option, java_decode_option,
171 lang_f_options, lang_W_options, LANG_HOOKS_DECODE_OPTION,
172 process_option_with_no): Remove.
173 (resource_name): Constify.
174 (LANG_HOOKS_HANDLE_OPTION): Override.
175 (java_handle_option): New.
176 (java_init): Don't call jcf_path_init.
177 (java_init_options): Call jcf_path_init.
178 * lang.opt: New.
179 * resource.c (compile_resource_data, compile_resource_file): Constify.
180
181 2003-06-09 Nathan Sidwell <nathan@codesourcery.com>
182
183 * java-tree.h (DECL_FUNCTION_LAST_LINE): New.
184 (struct lang_decl_func): Add last_line field.
185 * parse.h (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
186 DECL_SOURCE_LINE_LAST): Remove.
187 * parse.y (missing_return_error, finish_method_declaration,
188 lookup_cl, start_artificial_method_body, source_end_java_method,
189 start_complete_expand_method): Adjust.
190
191 2003-06-08 Tom Tromey <tromey@redhat.com>
192
193 * jvspec.c (jvgenmain_spec): Added `*' after fassume-compiled and
194 fno-assume-compiled.
195
196 2003-06-08 Roger Sayle <roger@eyesopen.com>
197
198 * builtins.c (define_builtin_type, builtin_types): Delete.
199 (define_builtin): Rewritten to take just the built-in code,
200 the function's name, type and fallback library function name.
201 All built-ins used by Java are implicit and BUILT_IN_NORMAL.
202 (initialize_builtins): Overhaul to define the GCC builtins
203 used by gcj manually, providing the Java run-time's
204 implementations as the fallback library function.
205
206 2003-06-08 Anthony Green <green@redhat.com>
207
208 * parse.y (patch_cast): Fix conversions from floating-point to
209 integral types.
210
211 2003-06-08 Neil Booth <neil@daikokuya.co.uk>
212
213 * Make-lang.in: Update.
214 * lang.c: Include opts.h. Define cl_options_count and cl_options.
215
216 2003-06-07 Neil Booth <neil@daikokuya.co.uk>
217
218 * lang.c (java_init_options): Update.
219
220 Thu Jun 5 18:33:40 CEST 2003 Jan Hubicka <jh@suse.cz>
221
222 * Make-lang.in: Add support for stageprofile and stagefeedback
223
224 2003-05-31 Roger Sayle <roger@eyesopen.com>
225
226 * lang.c (java_init_options): Prescribe wrap-around two's
227 complement arithmetic overflow by setting flag_wrapv.
228
229 2003-05-29 Roger Sayle <roger@eyesopen.com>
230
231 * builtins.c (cos_builtin, sin_builtin, sqrt_builtin): Delete.
232 (builtin_record): Add an additional builtin_code field to
233 record which GCC built-in corresponds to the Java function.
234 (java_builtins): Add new entries for atan, atan2, exp, log,
235 pow and tan.
236 (max_builtin, min_builtin, abs_builtin): Perform constant
237 folding on the resulting tree.
238 (java_build_function_call_expr): Likewise, perform constant
239 folding on the resulting tree.
240 (initialize_builtins): The NULL creators are now allowed in
241 the java_builtins table, which is now terminated by an entry
242 with builtin_code == END_BUILTINS.
243 (check_for_builtin): Likewise. If the matching creator is
244 NULL, construct the call using java_build_function_call_expr
245 directly with the decl for the corresponding builtin_code.
246
247 2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
248
249 * win32-host.c: Normalize copyright boilerplate.
250
251 2003-05-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
252
253 * parse.y (print_int_node): Use string concatentation on
254 HOST_WIDE_INT_PRINT_* format specifier to collapse multiple
255 function calls into one.
256
257 2003-05-13 Zack Weinberg <zack@codesourcery.com>
258
259 * jcf-parse.c, jcf-write.c, lex.c: Replace all calls to
260 fatal_io_error with calls to fatal_error; add ": %m" to the end of
261 all the affected error messages.
262
263 2003-05-13 Richard Henderson <rth@redhat.com>
264
265 * class.c (layout_class_method): Set DECL_EXTERNAL.
266 * decl.c (java_mark_decl_local, java_mark_class_local): New.
267 * java-tree.h (java_mark_class_local): Declare.
268 * jcf-parse.c (parse_class_file): Use it.
269 * parse.y (java_expand_classes): Likewise.
270
271 2003-05-04 Nathan Sidwell <nathan@codesourcery.com>
272
273 * Make-lang.in (java/parse.o, java/parse-scan.o): Depend on input.h.
274 * lex.h: #include input.h.
275 * jv-scan.c (input_filename): Remove.
276
277 2003-05-02 Tom Tromey <tromey@redhat.com>
278
279 PR java/10491:
280 * gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
281 (handle_inner_classes): New function.
282
283 2003-05-01 Tom Tromey <tromey@redhat.com>
284
285 PR java/10459:
286 * parse.y (finish_for_loop): Do nothing if update expression is a
287 EXPR_WFL_NODE wrapping nothing.
288 (java_complete_lhs) <COMPOUND_EXPR>: Likewise.
289
290 2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
291
292 * lex.h (input_lineno): Remove declaration.
293 * parse-scan.y: #include input.h.
294 (input_filename): Remove declaration.
295 (input_location): Add definition.
296 (input_line): Remove definition.
297
298 2003-05-01 Nathan Sidwell <nathan@codesourcery.com>
299
300 * lex.h (lineno): Rename to ...
301 (input_line): ... here
302 * parse-scan.y (lineno): Rename to ...
303 (input_line): ... here.
304 (reset_report): Rename lineno to input_line.
305 * check-init.c (check_init): Likewise.
306 * class.c (push_class): Likewise.
307 * decl.c (complete_start_java_method, end_java_method): Likewise.
308 * expr.c (expand_byte_code): Likewise.
309 * jcf-parse.c (give_name_to_class, parse_class_file): Likewise.
310 * jcf-write.c (generate_bytecode_insns): Likewise.
311 * lex.c (java_init_lex, java_allocate_new_line,
312 do_java_lex): Likewise.
313 * parse.h (YYNOT_TWICE): Likewise.
314 * parse.y (empty_statement, expression_statement,
315 java_pop_parser_context, java_parser_context_save_global,
316 yyerror, register_fields, method_header, safe_layout_class,
317 find_in_imports_on_demand, create_artificial_method,
318 source_end_java_method, start_complete_expand_method,
319 build_thisn_assign, java_complete_lhs,
320 maybe_absorb_scoping_block): Likewise.
321
322 2003-04-20 Mohan Embar <gnustuff@thisiscool.com>
323
324 * jcf-io.c (find_class): use DIR_SEPARATOR instead of
325 '/' when computing java source filename
326
327 2003-04-13 Tom Tromey <tromey@redhat.com>
328
329 * gjavah.c (print_c_decl): Indentation fix.
330
331 2003-04-12 Zack Weinberg <zack@codesourcery.com>
332
333 * class.c (make_field_value, make_method_value, get_dispatch_table)
334 (make_class_data, emit_offset_symbol_table)
335 * constants.c (build_constants_constructor)
336 * java-tree.h (START_RECORD_CONSTRUCTOR)
337 * parse.y (maybe_build_array_element_wfl):
338 Use build_constructor.
339
340 2003-04-10 Eric Blake <ebb9@email.byu.edu>
341
342 PR java/10253:
343 * parse.y (string_convert_int_cst): Always use at least one digit
344 in string conversion. Remove ASCII dependence.
345 (merge_string_cste): Fix merging of 3-byte UTF-8 characters.
346
347 2003-03-16 Mohan Embar <gnustuff@thisiscool.com>
348
349 * Make-lang.in: added win32-host.c
350 * jcf.h: defined macro JCF_OPEN_EXACT_CASE which
351 resolves to open() on non-Win32 platforms and
352 Win32-specific jcf_open_exact_case() on Win32
353 * jcf-io.c (find_class): use JCF_OPEN_EXACT_CASE
354 when trying .java and .class files
355 * win32-host.c: added to repository. Defines
356 Win32-specific jcf_open_exact_case()
357
358 2003-04-10 Andrew Haley <aph@redhat.com>
359
360 * jcf-write.c (struct jcf_partial): num_jsrs: new field.
361 (maybe_free_localvar): Renamed from localvar_free.
362 Add new arg, really.
363 (generate_bytecode_insns): Set new variable, jsrs.
364 Only free local vars if no jsr insns have been emittted.
365 Call maybe_free_localvar, not localvar_free.
366
367 2003-03-30 Joseph S. Myers <jsm@polyomino.org.uk>
368
369 * gcj.texi: Remove @ at start of file.
370
371 2003-03-25 Tom Tromey <tromey@redhat.com>
372
373 * parse.y (create_interface): Call CHECK_DEPRECATED.
374
375 2003-03-23 Zack Weinberg <zack@codesourcery.com>
376
377 * Make-lang.in: Link jcf-dump against $(LDEXP_LIB).
378
379 2003-03-21 Zack Weinberg <zack@codesourcery.com>
380
381 * javaop.h (jfloat, jdouble): Make them structures mirroring
382 the bit fields of IEEE float and double respectively.
383 (JFLOAT_FINITE, JFLOAT_QNAN_MASK, JFLOAT_EXP_BIAS,
384 JDOUBLE_FINITE, JDOUBLE_QNAN_MASK, JDOUBLE_EXP_BIAS): New.
385 (union Word, union DWord): Delete.
386 (WORD_TO_FLOAT, WORDS_TO_DOUBLE): Update to match.
387
388 * gjavah.c (java_float_finite, java_double_finite, F_NAN_MASK,
389 D_NAN_MASK): Delete.
390 (jni_print_float, jni_print_double): New. Generate
391 hexadecimal floating constants.
392 (print_field_info): Use jni_print_float/double.
393
394 * jcf-dump.c: Include math.h. Use ldexp/frexp to assemble
395 finite floating point numbers for output; special case
396 non-finite floats.
397
398 2003-03-19 Nathanael Nerode <neroden@gcc.gnu.org>
399
400 * lang.c (java_dump_tree): Change return type from 'int' to 'bool'.
401 Replace 0 and 1 with true and false in return statements.
402
403 2003-03-19 Tom Tromey <tromey@redhat.com>
404
405 * lex.c (do_java_lex): Renamed from java_lex.
406 (java_lex): New function.
407 Include timevar.h.
408
409 2003-03-13 Tom Tromey <tromey@redhat.com>
410
411 * parse.y (resolve_inner_class): Error if qualifier is a primitive
412 type.
413
414 2003-03-04 Andrew Haley <aph@redhat.com>
415
416 * gjavah.c (is_first_data_member): New global variable.
417 (print_c_decl): If it's the first data member, align it as the
418 superclass.
419 (process_file): Set is_first_data_member.
420
421 2003-03-11 Tom Tromey <tromey@redhat.com>
422
423 * parse.y (resolve_field_access): Initialize class if field is
424 found in another static field.
425 * expr.c (build_class_init): Don't optimize out initialization of
426 implemented interface.
427
428 2003-03-11 Andrew Haley <aph@redhat.com>
429
430 * jcf-io.c (caching_stat): Initialize origsep to remove compiler
431 warning.
432
433 2003-03-10 Ranjit Mathew <rmathew@hotmail.com>
434
435 * jcf-io.c (caching_stat): Account for both DIR_SEPARATOR
436 and DIR_SEPARATOR_2 for a target.
437 Correct minor typos.
438
439 * jcf-write.c (make_class_file_name): Take both DIR_SEPARATOR
440 and DIR_SEPARATOR_2 for a target into account.
441
442 2003-03-08 Neil Booth <neil@daikokuya.co.uk>
443
444 * lang.c (java_init): Update prototype, move code to java_post_options.
445 (java_post_options): Similarly.
446
447 2003-03-05 Ranjit Mathew <rmathew@hotmail.com>
448
449 * jcf.h (COMPARE_FILENAMES): New macro similar to "strcmp" to
450 compare file name components depending on the case-sensitivity
451 or otherwise of the host file system.
452
453 * jcf-path.c (add_entry): Use COMPARE_FILENAMES instead of
454 "strcmp" to compare file name components.
455 Use IS_DIR_SEPARATOR instead of comparing directly against
456 DIR_SEPARATOR.
457 (jcf_path_extdirs_arg): Use IS_DIR_SEPARATOR instead of
458 comparing directly against DIR_SEPARATOR.
459
460 2003-03-04 Tom Tromey <tromey@redhat.com>
461
462 * Make-lang.in (java.tags): New target.
463
464 2003-03-01 Roger Sayle <roger@eyesopen.com>
465
466 * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3.
467 (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3.
468
469 2003-03-01 Tom Tromey <tromey@redhat.com>
470
471 * parse.y (jdep_resolve_class): Only check deprecation if we found
472 a decl.
473
474 2003-02-28 Tom Tromey <tromey@redhat.com>
475
476 PR java/9695:
477 * class.c (maybe_layout_super_class): Always pass a WFL to
478 do_resolve_class.
479 * parse.y (do_resolve_class): Updated comment to explain
480 parameters.
481
482 2003-02-26 Tom Tromey <tromey@redhat.com>
483
484 * jcf-write.c (generate_classfile): Check whether class is
485 deprecated before writing attribute count.
486
487 2003-02-25 Roger Sayle <roger@eyesopen.com>
488
489 * java/decl.c (java_init_decl_processing): Get soft_fmod_node from
490 built_in_decls[BUILT_IN_FMOD] rather than define it ourselves.
491
492 2003-02-23 Tom Tromey <tromey@redhat.com>
493
494 * lang-options.h: Added -Wdeprecated.
495 * gcj.texi (Warnings): Document -Wdeprecated.
496 * java-tree.h (flag_deprecated): Declare.
497 * lang.c (lang_W_options): Added deprecated.
498 (flag_deprecated): New global.
499 * chartables.h: Rebuilt.
500 * gen-table.pl (process_one): Look at whitespace.
501 (print_tables): Define LETTER_SPACE, LETTER_MASK.
502 * parse.h (CLEAR_DEPRECATED): New macro.
503 (CHECK_DEPRECATED_NO_RESET): New macro.
504 * jcf-parse.c (handle_deprecated): New function.
505 (HANDLE_DEPRECATED_ATTRIBUTE): New define.
506 * jcf-reader.c (get_attribute): Handle Deprecated attribute.
507 * parse.y (resolve_type_during_patch): Check deprecation.
508 (jdep_resolve_class): Likewise.
509 (process_imports): Likewise.
510 (resolve_expression_name): Likewise.
511 (check_deprecation): Strip arrays from decl. Check
512 flag_deprecated.
513 (patch_method_invocation): Also check the particular constructor
514 for deprecation.
515 (register_fields): Use CHECK_DEPRECATED_NO_RESET in loop.
516 * jcf-write.c (append_deprecated_attribute): New function.
517 (generate_classfile): Generate deprecated attribute when
518 appropriate.
519 * lex.c (java_parse_doc_section): Return type now void. Rewrote.
520 (java_lex) [case '*']: Simplify logic.
521 (java_start_char_p): Use LETTER_MASK.
522 (java_part_char_p): Likewise.
523 (java_space_char_p): New function.
524
525 2003-02-20 Nathan Sidwell <nathan@codesourcery.com>
526
527 Change base class access representation.
528 * java/class.c (set_super_info): Don't set TREE_VIA_PUBLIC.
529 (add_interface_do): Likewise.
530
531 2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
532
533 * decl.c (java_init_decl_processing): Change
534 soft_lookupjnimethod_node to reflect the change in
535 signature of _Jv_LookupJNIMethod in libjava/jni.cc
536 * expr.c (build_jni_stub): Calculate and pass the size
537 on the stack of the arguments to a JNI function. Use
538 new target macro MODIFY_JNI_METHOD_CALL to allow a
539 target to modify the call to a JNI method.
540
541 2003-02-08 Roger Sayle <roger@eyesopen.com>
542
543 * jcf-io.c (java_or_class_file): Use libiberty's lbasename
544 instead of basename to avoid compiler warnings on Tru64.
545
546 2003-02-04 Joseph S. Myers <jsm@polyomino.org.uk>
547
548 * gcj.texi: Update to GFDL 1.2.
549
550 2003-01-31 Andrew Haley <aph@redhat.com>
551
552 * parse.y (java_expand_classes): Scan the whole class list looking
553 for access methods that haven't yet been expanded.
554
555 2003-01-31 Adrian Bunk <bunk@fs.tum.de>
556
557 Fix for java/4269:
558
559 * jv-scan.c: Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
560 to fix bootstrap on sparc-unknown-netbsdelf1.5.
561 * jcf-parse.c: Likewise.
562
563 2003-01-31 Mark Wielaard <mark@klomp.org>
564
565 * gjavah.c (throwable_p): Allocate 1 more byte for string.
566
567 2003-01-31 Nathan Sidwell <nathan@codesourcery.com>
568
569 * class.c (make_class): Use BINFO_ELTS.
570 (set_super_info): Likewse.
571 (add_interface_do): Likewise.
572
573 2003-01-30 Tom Tromey <tromey@redhat.com>
574
575 * jcf-parse.c (read_class): Update identifier's class value if it
576 changed during parsing.
577
578 2003-01-30 Loren James Rittle <ljrittle@acm.org>
579
580 * Make-lang.in (po-generated): Find the targets in $(parsedir).
581 Propagate change to all other rules as required.
582 (java/parse-scan.o): Add explicit dependency on
583 $(parsedir)/java/parse-scan.c .
584
585 2003-01-29 Tom Tromey <tromey@redhat.com>
586
587 * parse.y (patch_assignment): Only transform the rhs of an
588 assignment when compiling to native.
589
590 2003-01-28 Tom Tromey <tromey@redhat.com>
591
592 * jcf-write.c (generate_bytecode_conditional): Typo fixes.
593
594 2003-01-28 Tom Tromey <tromey@redhat.com>
595
596 * lex.c (java_lex): Don't include UEOF as part of token.
597 (java_read_unicode): Error if \u sequence prematurely terminated.
598
599 2003-01-27 Tom Tromey <tromey@redhat.com>
600
601 * parse.y (java_check_regular_methods): Check for construct after
602 checking types in throws clause.
603
604 2003-01-24 Tom Tromey <tromey@redhat.com>
605
606 * class.c (build_static_field_ref): Only a String or numeric field
607 can fold to a constant.
608
609 2003-01-23 Tom Tromey <tromey@redhat.com>
610
611 * jcf-parse.c (parse_zip_file_entries): Overwrite trailing \0 of
612 file name in resource buffer.
613
614 2003-01-23 Tom Tromey <tromey@redhat.com>
615
616 * expr.c (build_known_method_ref): Use method's context to find
617 method table index.
618
619 2003-01-23 Tom Tromey <tromey@redhat.com>
620
621 * constants.c (set_constant_entry): Allocated cleared memory.
622
623 2003-01-22 Tom Tromey <tromey@redhat.com>
624
625 * java-tree.h: Don't use PARAMS.
626 * resource.c: Add prototypes for all functions.
627 (write_resource_constructor): Use `const char *' to avoid
628 warning.
629
630 2003-01-22 Nathanael Nerode <neroden@gcc.gnu.org>
631
632 * jcf-parse.c (process_zip_dir): Remove unused variable.
633
634 2003-01-22 Tom Tromey <tromey@redhat.com>
635
636 * expr.c (build_invokeinterface): Abort if method's context is not
637 an interface.
638
639 2003-01-22 Tom Tromey <tromey@redhat.com>
640
641 * gcj.texi (Input and output files): Mention non-class entries.
642 * decl.c (java_init_decl_processing): Call
643 init_resource_processing.
644 * java-tree.h (compile_resource_data, write_resource_constructor,
645 compile_resource_file, init_resource_processing): Declare.
646 * config-lang.in (gtfiles): Added resource.c.
647 * Make-lang.in (gt-java-resource.h): New target.
648 (JAVA_OBJS): Added resource.o.
649 (java/resource.o): New target.
650 * resource.c: New file.
651 * class.c (compile_resource_file): Moved to resource.c.
652 (registerResource_libfunc): Likewise.
653 (utf8_decl_list): Mark with GTY; now static.
654 * jcf-parse.c (classify_zip_file): New function.
655 (parse_zip_file_entries): Use it; compile .properties files.
656 (process_zip_dir): Use classify_zip_file and compute_class_name.
657 Don't write class name into zip directory.
658 (java_parse_file): Call write_resource_constructor.
659 (compute_class_name): New function.
660 * jcf-io.c (read_zip_member): Reindented.
661
662 2003-01-21 Tom Tromey <tromey@redhat.com>
663
664 * class.c (supers_all_compiled): New function.
665 (make_class_data): Use it.
666
667 2003-01-21 Tom Tromey <tromey@redhat.com>
668
669 * parse.y (method_header): Native method can't be strictfp.
670 No method can be transient or volatile.
671
672 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
673
674 Make-lang.in (jvspec.o-warn): Add -Wno-error.
675
676 2003-01-18 Kazu Hirata <kazu@cs.umass.edu>
677
678 * check-init.c: Fix comment typos.
679 * class.c: Likewise.
680 * constants.c: Likewise.
681 * decl.c: Likewise.
682 * except.c: Likewise.
683 * expr.c: Likewise.
684 * java-except.h: Likewise.
685 * java-tree.h: Likewise.
686 * javaop.h: Likewise.
687 * jcf-dump.c: Likewise.
688 * jcf-io.c: Likewise.
689 * jcf-parse.c: Likewise.
690 * jcf-write.c: Likewise.
691 * lang.c: Likewise.
692 * mangle.c: Likewise.
693 * typeck.c: Likewise.
694 * verify.c: Likewise.
695
696 2003-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
697
698 * Make-lang.in (java/jcf-write.o): Depend on $(TM_P_H).
699 * jcf-write.c: Include "tm_p.h".
700
701 2003-01-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
702
703 * jcf-io.c (caching_stat): Cast the 3rd arg of scandir to void*.
704
705 2003-01-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
706
707 * builtins.c (java_build_function_call_expr): Renamed from
708 build_function_call_expr. All callers changed.
709
710 * Make-lang.in (java/jcf-parse.o): Depend on $(TM_P_H).
711 * jcf-parse.c: Include tm_p.h.
712
713 * jcf-write.c (generate_bytecode_insns): Avoid signed/unsigned
714 warning.
715
716 2003-01-14 Tom Tromey <tromey@redhat.com>
717
718 * class.c (make_class_data): Check that super is compiled before
719 building class reference to it.
720
721 2003-01-14 Andrew Haley <aph@redhat.com>
722
723 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
724 varargs function -- correct.
725
726 2003-01-14 Andrew Haley <aph@redhat.com>
727
728 * decl.c (java_init_decl_processing): Temporarily back out previous patch.
729
730 2003-01-14 Andrew Haley <aph@redhat.com>
731
732 * decl.c (java_init_decl_processing): _Jv_NewMultiArray is a
733 varargs function -- correct.
734
735 * parse.y (patch_assignment): Copy the rhs of an assignment into a
736 temporary if the RHS is a reference.
737
738 2003-01-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
739
740 * Make-lang.in (keyword.h): Pass "-L ANSI-C" to gperf.
741 * keyword.h: Regenerated.
742
743 * All Files: Convert to ISO C style function definitions.
744
745 2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
746
747 * parse.y (check_pkg_class_access): ANSIfy definition.
748
749 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
750
751 * decl.c, parse-scan.y, parse.y: Don't cast return value of
752 xmalloc et al.
753
754 * class.c, gjavah.c, parse.y, verify.c: Don't use PTR.
755
756 2003-01-09 Geoffrey Keating <geoffk@apple.com>
757
758 Merge from pch-branch:
759
760 2002-12-02 Geoffrey Keating <geoffk@apple.com>
761
762 * Make-lang.in (java/gjavah.o): Update dependencies.
763 * gjavah.c: Include ggc.h.
764
765 2002-08-16 Geoffrey Keating <geoffk@redhat.com>
766
767 * Make-lang.in (GCJH_OBJS): Add ggc-none.o.
768 (JCFDUMP_OBJS): Add ggc-none.o.
769 (java/jcf-dump.o): Depend on GGC_H.
770 * jcf-reader.c (jcf_parse_constant_pool): Use ggc_alloc to allocate
771 CPool substructures.
772 * jcf-parse.c (process_zip_dir): Use ggc_alloc to allocate JCFs.
773 * jcf-dump.c: Include ggc.h.
774
775 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
776
777 * jcf.h (union cpool_entry): New.
778 (struct CPool): Use gengtype to mark. Change field 'data' to be
779 an array of unions.
780 (struct JCF): Use gengtype to mark.
781 (CPOOL_UINT): Update for new cpool_entry type.
782 (CPOOL_USHORT1): Likewise.
783 (CPOOL_USHORT2): Likewise.
784 (CPOOL_FINISH): Use GC to free cpool subfields.
785 * parse.h (struct parser_ctxt): Mark field current_jcf.
786 * lex.c (java_init_lex): Use GC to allocate struct JCF.
787 * jcf-parse.c (HANDLE_CONSTANT_Utf8): Update for new cpool_entry type.
788 (main_jcf): Use gengtype to mark.
789 (ggc_mark_jcf): Delete.
790 (get_constant): Update for new cpool_entry type.
791 (give_name_to_class): Likewise.
792 (get_class_constant): Likewise.
793 (init_outgoing_cpool): Use GGC to allocate struct CPool.
794 (java_parse_file): Use GGC to allocate struct JCF.
795 (init_jcf_parse): Don't call ggc_add_root.
796 * jcf-reader.c (jcf_parse_constant_pool): Update for new
797 cpool_entry type.
798 * java-tree.h (current_jcf): Use gengtype to mark.
799 (CPOOL_UTF): Update for new cpool_entry type.
800 (outgoing_cpool): Use gengtype to mark.
801 (struct lang_type): GC struct JCF and struct CPool.
802 * config-lang.in (gtfiles): Add jcf.h.
803 * constants.c (find_tree_constant): New.
804 (set_constant_entry): Allocate cpool subfields using GGC. Update
805 for new cpool_entry type.
806 (find_constant1): Update for new cpool_entry type.
807 (find_constant2): Likewise.
808 (find_utf8_constant): Use find_tree_constant.
809 (find_class_or_string_constant): Remove unnecessary cast to jword.
810 Update for new cpool_entry type.
811 (count_constant_pool_bytes): Update for new cpool_entry type.
812 (write_constant_pool): Likewise.
813 (alloc_name_constant): Use find_tree_constant.
814 (build_constants_constructor): Update for new cpool_entry type.
815
816 2002-08-08 Geoffrey Keating <geoffk@redhat.com>
817
818 * parse.y (mark_parser_ctxt): Delete.
819 (goal): Don't use ggc_add_root.
820 (create_new_parser_context): Use GC to allocate struct parser_ctxt.
821 (java_pop_parser_context): Let GC free parser_ctxt.
822 (java_parser_context_resume): Likewise.
823 * parse.h (struct parser_ctxt): Use gengtype to mark.
824 (ctxp): Likewise.
825 (ctxp_for_generation): Likewise.
826 * lex.h (struct java_lc_s): Mark for gengtype.
827 (java_lexer): Rearrange for gengtype.
828 * config-lang.in (gtfiles): Add lex.h, parse.h.
829
830 2003-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
831
832 * All Files: Remove PARAMS macro.
833
834 * expr.c, gjavah.c, javaop.h, jcf-dump.c, jcf-io.c, jcf-reader.c,
835 jcf-write.c, jcf.h, jv-scan.c: Don't rely on the `DEFUN', `AND' or
836 `__STDC__' macros.
837
838 * jv-scan.c, parse.y: Remove VPARAMS, VA_OPEN, VA_FIXEDARG and
839 VA_CLOSE.
840
841 2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
842
843 * Make-lang.in (java.install-common, java.uninstall,
844 java.install-info, java.install-man): Prepend $(DESTDIR)
845 to destination paths in all (un)installation commands.
846 (java.install-common): Rewrite $(LN) command to support
847 DESTDIR with "ln" as well as with "ln -s".
848
849 2003-01-08 Nathanael Nerode <neroden@gcc.gnu.org>
850
851 * java-tree.h: Protect against multiple inclusion.
852
853 2003-01-07 Tom Tromey <tromey@redhat.com>
854
855 * class.c (add_assume_compiled): Don't adjust parent if we're
856 already at the root of tree.
857
858 2003-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
859
860 * lang.c (dump_compound_expr): Prototype.
861
862 2003-01-03 Tom Tromey <tromey@redhat.com>
863
864 Fix for PR java/8712:
865 * expr.c (build_instanceof): Build an NE_EXPR, not a COND_EXPR,
866 when simply checking against `null'.
867
868 2003-01-03 Tom Tromey <tromey@redhat.com>
869
870 * gcj.texi (Standard Properties): Document http.proxyHost and
871 http.proxyPort.
872
873 * gcj.texi (GNU Classpath Properties): Document new properties.
874
875 2003-01-02 Steven Bosscher <s.bosscher@student.tudelft.nl>
876
877 * java/jcf-reader.c, java/jvgenmain.c, java/keyword.gperf,
878 java/lang-options.h, java/mangle.c, java/mangle_name.c,
879 java/xref.c, java/zextract.c,java/zipfile.h: Fix copyright years.
880
881 2003-01-01 Steven Bosscher <s.bosscher@student.tudelft.nl>
882
883 * Make-lang.in, boehm.c, buffer.c,
884 buffer.h, builtins.c, class.c,
885 config-lang.in, constants.c,
886 convert.h, decl.c, except.c,
887 expr.c, java-except.h,
888 java-tree.h, javaop.def,
889 jcf-parse.c, jcf-write.c,
890 jv-scan.c, jvgenmain.c,
891 jvspec.c, keyword.gperf,
892 keyword.h, lang-options.h,
893 lang-specs.h, lang.c, lex.c,
894 lex.h, mangle.c, mangle_name.c,
895 parse-scan.y, parse.h, parse.y,
896 typeck.c, verify.c, xref.c,
897 xref.h: Replace "GNU CC" with
898 "GCC" in the copyright header.
899
900 * check-init.c, gjavah.c, javaop.h,
901 jcf-depend.c, jcf-dump.c, jcf-io.c,
902 jcf-path.c, jcf-reader.c, jcf.h,
903 zextract.c, zipfile.h: These files are
904 "part of GCC". Also say "GCC" not "GNU CC".
905
906 2002-12-30 DJ Delorie <dj@redhat.com>
907
908 * Make-lang.in: Protect against texi2pod/pod2man failing.
909
910 2002-12-28 Joseph S. Myers <jsm@polyomino.org.uk>
911
912 * gcj.texi: Use @copying.
913
914 2002-12-27 Mark Mitchell <mark@codesourcery.com>
915
916 * gjavah.c (print_name_for_stub_or_jni): Adjust call to
917 print_cxx_classname.
918 (print_cxx_classname): Add add_scope parameter.
919 (print_class_decls): Do not emit a semicolon after the extern
920 "Java" block.
921 (process_file): Adjust calls to print_cxx_classname.
922
923 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
924
925 * gcj.texi: Include Cover Texts in man page.
926
927 2002-12-23 Jeff Sturm <jsturm@one-point.com>
928
929 * class.c (build_static_field_ref): Check FIELD_FINAL.
930
931 * constants.c (alloc_class_constant): Use TYPE_CPOOL_DATA_REF
932 instead of current_constant_pool_data_ref.
933 * java-tree.h (current_constant_pool_data_ref): Undefine.
934 (JTI_CURRENT_CONSTANT_POOL_DATA_REF): Remove.
935 * jcf-parse.c (init_outgoing_cpool): Don't initialize
936 current_constant_pool_data_ref.
937
938 * except.c (prepare_eh_table_type ): Use DECL_NAME of class type,
939 not build_internal_class_name.
940
941 * parse.y (patch_incomplete_class_ref): Always emit `class$' method.
942 Use it when class ref isn't certain to be compiled.
943
944 2002-12-23 Joseph S. Myers <jsm@polyomino.org.uk>
945
946 * gcj.texi: Include gcc-common.texi.
947 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Depend on
948 $(srcdir)/doc/include/gcc-common.texi.
949
950 2002-12-22 Anthony Green <green@redhat.com>
951
952 * gcj.texi (Limitations): Add note about org.xml.sax and
953 org.w3c.dom.
954
955 2002-12-20 Tom Tromey <tromey@redhat.com>
956
957 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Handle case
958 where minimum case value is Integer.MIN_VALUE.
959 Fixes PR java/8955.
960
961 2002-12-18 Andrew Haley <aph@redhat.com>
962
963 * parse.y (patch_invoke): Force evaluation order when `check' is
964 set. For PR libgcj/8945.
965
966 2002-12-16 Mark Mitchell <mark@codesourcery.com>
967
968 * gcj.texi: Change version number to 3.4.
969
970 2002-12-05 Ranjit Mathew <rmathew@hotmail.com>
971 Andrew Haley <aph@redhat.com>
972
973 * parse.y (source_end_java_method): Remove custom encoding of line
974 numbers for a function decl before passing it to the back end.
975
976 2002-12-03 Andrew Haley <aph@redhat.com>
977
978 * class.c (make_class_data): New field, "chain".
979 * decl.c (java_init_decl_processing): Likewise.
980
981 2002-12-02 Tom Tromey <tromey@redhat.com>
982
983 For PR java/8740:
984 * parse.y (do_resolve_class): Handle qualified name via
985 recursion.
986
987 2002-11-30 Zack Weinberg <zack@codesourcery.com>
988
989 * boehm.c, buffer.c, builtins.c, check-init.c, class.c,
990 constants.c, decl.c, except.c, expr.c, gjavah.c, jcf-depend.c,
991 jcf-dump.c, jcf-io.c, jcf-parse.c, jcf-path.c, jcf-write.c,
992 jv-scan.c, jvgenmain.c, jvspec.c, lang.c, mangle.c, mangle_name.c,
993 parse-scan.y, parse.y, typeck.c, verify.c, xref.c, zextract.c:
994 Include coretypes.h and tm.h.
995 * Make-lang.in: Update dependencies.
996
997 2002-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
998
999 * decl.c (java_init_decl_processing): Use `LL' on 64-bit constant.
1000
1001 2002-11-25 Diego Novillo <dnovillo@redhat.com>
1002
1003 * jcf-reader.c: Don't expand JCF_readu4 inside the
1004 expansion of JCF_SKIP.
1005
1006 2002-11-25 Diego Novillo <dnovillo@redhat.com>
1007
1008 * jcf-reader.c: Don't expand JCF_readu4 inside the
1009 expansion of JCF_SKIP.
1010
1011 2002-11-22 Tom Tromey <tromey@redhat.com>
1012
1013 * parse.y (patch_binop): Cast right hand side of shift expression
1014 to `int'. Fixes PR java/8676.
1015
1016 2002-11-22 Ranjit Mathew <rmathew@hotmail.com>
1017 Andrew Haley <aph@redhat.com>
1018
1019 * gcc/java/jcf-write.c (write_classfile): Remove target
1020 class file, if it exists, before renaming the temporary
1021 class file to it.
1022
1023 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
1024
1025 * jvspec.c (lang_specific_spec_functions): New.
1026
1027 2002-11-18 Tom Tromey <tromey@redhat.com>
1028
1029 Fix for PR java/7912:
1030 * expr.c (can_widen_reference_to): Allow cast of array to
1031 Cloneable or Serializable.
1032 * java-tree.h (java_lang_cloneable_identifier_node): Declare.
1033 (java_io_serializable_identifier_node): Likewise.
1034 * parse.y (java_lang_cloneable, java_io_serializable): Removed.
1035 (valid_ref_assignconv_cast_p): Use new identifier nodes.
1036 * lex.c (java_init_lex): Don't initialize java_lang_cloneable and
1037 java_io_serializable.
1038 * decl.c (java_init_decl_processing): Initialize
1039 java_lang_cloneable_identifier_node and
1040 java_io_serializable_identifier_node.
1041 (java_lang_cloneable_identifier_node): New global.
1042 (java_io_serializable_identifier_node): Likewise.
1043
1044 2002-11-14 Jens-Michael Hoffmann <jensmh@gmx.de>
1045
1046 * buffer.c: Remove unnecessary casts.
1047 * check-init.c: Likewise.
1048 * class.c: Likewise.
1049 * constants.c: Likewise.
1050 * decl.c: Likewise.
1051 * except.c: Likewise.
1052 * gjavah.c: Likewise.
1053 * jcf-io.c: Likewise.
1054 * jcf-parse.c: Likewise.
1055 * jcf-path.c: Likewise.
1056 * jvspec.c: Likewise.
1057 * lang.c: Likewise.
1058 * lex.c: Likewise.
1059 * verify.c: Likewise.
1060
1061 2002-11-06 Tom Tromey <tromey@redhat.com>
1062
1063 * gjavah.c (print_stub_or_jni): Include JNIEXPORT and JNICALL in
1064 a JNI header.
1065
1066 2002-11-05 Tom Tromey <tromey@redhat.com>
1067
1068 Fix for PR java/6388.
1069 * lex.h (JAVA_INTEGRAL_RANGE_ERROR): Wrap in do...while.
1070 * java-tree.h (enum java_tree_index): New values
1071 JTI_DECIMAL_INT_MAX_NODE, JTI_DECIMAL_LONG_MAX_NODE.
1072 (decimal_int_max, decimal_long_max): New defines.
1073 * lex.c (yylex): Rewrote range checking. Sign extend literals.
1074 (error_if_numeric_overflow): Rewrote range checking.
1075 * decl.c (java_init_decl_processing): Initialize decimal_int_max,
1076 decimal_long_max.
1077
1078 2002-11-02 Tom Tromey <tromey@redhat.com>
1079
1080 * java-tree.h: Move JV_STATE_ERROR before JV_STATE_DONE.
1081
1082 * class.c (make_method_value): Put class name, not signature, into
1083 `throws' field. For PR java/8415.
1084
1085 2002-10-24 Tom Tromey <tromey@redhat.com>
1086
1087 * gcj.texi (Invoking gij): Document --showversion.
1088 (Standard Properties): java.library.path now set.
1089
1090 2002-10-23 Tom Tromey <tromey@redhat.com>
1091
1092 * gjavah.c (decode_signature_piece): In JNI mode, print
1093 `jobjectArray' when array depth is nonzero.
1094 Fixes PR java/8296.
1095
1096 2002-10-15 Andrew Haley <aph@redhat.com>
1097
1098 * parse.y (patch_invoke): Call force_evaluation_order on a static
1099 arg list.
1100 (resolve_qualified_expression_name): Call force_evaluation_order
1101 on a arg list that is part of a Qualified Expression Name.
1102
1103 * lang.c (dump_compound_expr): New.
1104 (java_dump_tree): New.
1105
1106 2002-10-20 Ranjit Mathew <rmathew@hotmail.com>
1107
1108 * gcj.texi: Added item describing the GCJ runtime property
1109 "gnu.gcj.progname".
1110
1111 2002-10-15 Richard Henderson <rth@redhat.com>
1112
1113 * jcf-parse.c (get_constant): Fix type warning.
1114
1115 2002-10-15 Andrew Haley <aph@redhat.com>
1116
1117 * java-tree.h (java_inlining_merge_static_initializers): Declare.
1118 (java_inlining_map_static_initializers): Declare.
1119
1120 2002-10-14 Andrew Haley <aph@redhat.com>
1121
1122 * tree-inline.c (remap_block): All local class initialization
1123 flags go in the outermost scope.
1124 (expand_call_inline): Call java_inlining_map_static_initializers.
1125 (expand_call_inline): Call java_inlining_merge_static_initializers.
1126 * java/lang.c (merge_init_test_initialization): New.
1127 (java_inlining_merge_static_initializers): New.
1128 (inline_init_test_initialization): New.
1129 (java_inlining_map_static_initializers): New.
1130
1131 2002-10-11 Mark Wielaard <mark@klomp.org>
1132
1133 * gcj.texi (Compatibility): Add Limitations and Extensions section.
1134
1135 2002-10-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1136
1137 * class.c (JAVA_TREEHASHHASH_H): Use htab_hash_pointer.
1138
1139 2002-10-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1140
1141 * parse.y (merge_string_cste): Add parentheses around & within |.
1142
1143 2002-10-08 Tom Tromey <tromey@redhat.com>
1144
1145 * parse.y (variable_declarator_id): Simplify error path for
1146 array declarator error. For PR java/8003.
1147
1148 2002-10-08 Zack Weinberg <zack@codesourcery.com>
1149
1150 * gjavah.c, jcf-dump.c, jv-scan.c: Globally replace GCCBUGURL with
1151 bug_report_url.
1152
1153 2002-10-08 Andrew Haley <aph@redhat.com>
1154
1155 * parse.y (attach_init_test_initialization_flags): Check for
1156 error_mark_node.
1157
1158 2002-10-07 Anthony Green <green@redhat.com>
1159
1160 * parse.y (merge_string_cste): Fix bug in string concatenation.
1161
1162 2002-10-03 Michael Koch <konqueror@gmx.de>
1163
1164 * gcj.texi (Standard properties):
1165 Change default of java.awt.toolkit to gnu.awt.gtk.GtkToolkit.
1166
1167 2002-10-02 Roger Sayle <roger@eyesopen.com>
1168
1169 PR optimization/6627
1170 * lang.c (java_init): If storing the vbit in function
1171 pointers, ensure that force_align_functions_log is atleast
1172 one to aid compatability with g++ vtables.
1173
1174 2002-10-01 Nathan Sidwell <nathan@codesourcery.com>
1175
1176 * jcf-dump.c (print_constant, case CONSTANT_float): Don't fall
1177 foul of type-based aliasing.
1178
1179 2002-09-30 Anthony Green <green@redhat.com>
1180
1181 * gcj.texi (Invoking jv-scan): Fix texinfo.
1182
1183 2002-09-28 Anthony Green <green@redhat.com>
1184
1185 * gcj.texi (Invoking jv-scan): Add --no-assert documentation.
1186 (Code Generation): Add -fno-assert documentation.
1187 * jv-scan.c (flag_assert): New global.
1188 (options): Add assert option.
1189 (help): Add --no-assert documentation.
1190 * parse-scan.y (flag_assert): New global.
1191 * lang.c (lang_f_options): Add -fassert/-fno-assert support.
1192 (flag_assert): New global.
1193 * java-tree.h (flag_assert): New global.
1194 * lex.c (java_lex): Obey flag_assert.
1195 * jvspec.c (jvgenmain_spec): Strip -fassert/-fno-assert when
1196 calling cc1.
1197
1198 2002-09-26 Andrew Haley <aph@redhat.com>
1199
1200 * expr.c (build_java_array_length_access): Check for null pointer.
1201 * expr.c (expand_java_arrayload): Likewise.
1202
1203 2002-09-21 Richard Henderson <rth@redhat.com>
1204
1205 * jcf-parse.c (get_constant): Decode from IEEE no matter
1206 what the target format.
1207
1208 2002-09-20 Kazu Hirata <kazu@cs.umass.edu>
1209
1210 * ChangeLog: Follow spelling conventions.
1211 * class.c: Likewise.
1212 * decl.c: Likewise.
1213 * expr.c: Likewise.
1214 * gjavah.c: Likewise.
1215 * java-tree.h: Likewise.
1216 * jcf-dump.c: Likewise.
1217 * jcf-parse.c: Likewise.
1218 * jvspec.c: Likewise.
1219 * lang.c: Likewise.
1220 * mangle.c: Likewise.
1221 * parse.y: Likewise.
1222
1223 2002-09-17 Tom Tromey <tromey@redhat.com>
1224
1225 * lex.c (java_read_unicode_collapsing_terminators): Handle case
1226 where \r appears at EOF. Fixes PR java/7950.
1227
1228 2002-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
1229
1230 * jvspec.c (lang_specific_driver): Remove unused variable.
1231
1232 2002-09-16 Geoffrey Keating <geoffk@apple.com>
1233
1234 * java-tree.h (union lang_tree_node): Add chain_next option.
1235
1236 2002-09-16 Richard Henderson <rth@redhat.com>
1237
1238 * jcf-parse.c (get_constant): Runtime check for IEEE format;
1239 use new real.h interface.
1240 * jcf-write.c (find_constant_index): Use new real.h interface.
1241 * lex.c (IS_ZERO): Use REAL_VALUES_EQUAL.
1242
1243 2002-09-15 Kazu Hirata <kazu@cs.umass.edu>
1244
1245 * lang.c: Follow spelling conventions.
1246
1247 2002-09-11 Per Bothner <per@bothner.com>
1248
1249 * parse.y (fold_constant_for_init): If a VAR_DECL, convert numerical
1250 constant to the type of the field.
1251 (java_complete_tree): Remove now-redundant code.
1252
1253 * parse.y (fold_constant_for_init): 'null' is not a constant expr.
1254
1255 2002-09-03 Jesse Rosenstock <jmr@ugcs.caltech.edu>
1256
1257 For PR java/5794:
1258 * verify.c (verify_jvm_instructions) [OPCODE_jsr]: Only push the
1259 return label if a ret instruction for the jsr has been reached.
1260
1261 2002-09-09 Ranjit Mathew <rmathew@hotmail.com>
1262
1263 * parse.y (DIR_SEPARATOR): Don't define.
1264 (check_class_interface_creation): Use IS_DIR_SEPARATOR.
1265
1266 2002-08-28 Andrew Haley <aph@redhat.com>
1267
1268 * verify.c (verify_jvm_instructions): Allow exception handler
1269 inside code that is being protected, but generate a warning.
1270 * except.c (link_handler): Initialize `expanded' in new eh_range.
1271 (binding_depth, is_class_level, current_pc): Declare extern.
1272
1273 2002-09-01 Mark Wielaard <mark@klomp.org>
1274
1275 * gcj.texi: Add chapter about system properties.
1276 Fixed some typos.
1277
1278 2002-08-26 Tom Tromey <tromey@redhat.com>
1279
1280 * parse.y (try_builtin_assignconv): Allow narrowing primitive
1281 conversion if RHS_TYPE is byte, short, or char.
1282
1283 2002-08-22 Tom Tromey <tromey@redhat.com>
1284
1285 * gcj.texi (Invoking gij): Document -cp and -classpath.
1286
1287 2002-08-21 Tom Tromey <tromey@redhat.com>
1288
1289 * Make-lang.in (java/jcf-path.o): Use $(datadir), not
1290 $(prefix)/share. For PR libgcj/7633.
1291
1292 For PR java/6005 and PR java/7611:
1293 * lang.c (LANG_HOOKS_CAN_USE_BITFIELDS_P): New define.
1294 (java_can_use_bit_fields_p): New function.
1295
1296 2002-08-16 Tom Tromey <tromey@redhat.com>
1297
1298 * gcj.texi (Class Initialization): Mention class initialization of
1299 arrays.
1300
1301 2002-07-30 Andrew Haley <aph@cambridge.redhat.com>
1302
1303 * Make-lang.in (java-tree-inline.o): New.
1304 (JAVA_OBJS): Add java-tree-inline.o.
1305 * parse.y (source_end_java_method): Call java_optimize_inline.
1306 (java_expand_method_bodies): Save method's tree in
1307 DECL_SAVED_TREE.
1308 (add_stmt_to_compound): Keep track of the number of statments.
1309 * lang.c (java_init): Enable flag_inline_trees.
1310 (java_post_options): If flag_inline_functions is on, enable
1311 flag_inline_trees instread.
1312 (decl_constant_value): New.
1313 (java_tree_inlining_walk_subtrees): New.
1314 * java-tree.h (DECL_NUM_STMTS): New macro.
1315 (java_optimize_inline): Declare.
1316 * expr.c (java_expand_expr): Allow a BLOCK to return a value.
1317 Handle a LABEL_EXPR.
1318 * decl.c (build_result_decl): If we already have a DECL_RESULT
1319 don't make another.
1320 (dump_function): New.
1321 (java_optimize_inline): New.
1322 (dump_function): New.
1323
1324 2002-08-13 Jesse Rosenstock <jmr@fulcrummicro.com>
1325
1326 For PR java/7483:
1327 * parse.y (build_assertion): Invert return from
1328 desiredAssertionStatus.
1329
1330 2002-08-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1331
1332 * jcf-write.c (get_access_flags): Return correct access flags for
1333 private and protected inner classes.
1334
1335 2002-08-08 Nathan Sidwell <nathan@codesourcery.com>
1336
1337 * java/Make-lang.in (java.mostlyclean): Remove coverage files.
1338
1339 2002-08-05 Geoffrey Keating <geoffk@redhat.com>
1340
1341 * mangle_name.c: Don't include obstack.h twice.
1342 * xref.c: Don't include obstack.h.
1343
1344 2002-08-04 Geoffrey Keating <geoffk@redhat.com>
1345
1346 * class.c: (permanent_obstack): Delete declaration.
1347 * constants.c: (permanent_obstack): Delete declaration.
1348 * except.c: (permanent_obstack): Delete declaration.
1349 * expr.c: (permanent_obstack): Delete declaration.
1350 * jcf-parse.c: (permanent_obstack): Delete declaration.
1351 (saveable_obstack): Delete declaration.
1352 * parse.h: (permanent_obstack): Delete declaration.
1353 * typeck.c: (permanent_obstack): Delete declaration.
1354
1355 2002-08-04 Joseph S. Myers <jsm@polyomino.org.uk>
1356
1357 * gcj.texi (version-gcc): Increase to 3.3.
1358
1359 2002-07-22 Tom Tromey <tromey@redhat.com>
1360
1361 * lex.c (java_lex): Check for `e' or `E' after 0.
1362
1363 2002-07-21 Richard Henderson <rth@redhat.com>
1364
1365 * lang.c (java_unsafe_for_reeval): New.
1366 (LANG_HOOKS_UNSAFE_FOR_REEVAL): New.
1367
1368 2002-07-21 Neil Booth <neil@daikokuya.co.uk>
1369
1370 * jcf-path.c (GET_ENV_PATH_LIST): Remove.
1371 (jcf_path_init): Use GET_ENVIRONMENT.
1372
1373 2002-07-10 Roger Sayle <roger@eyesopen.com>
1374 Zack Weinberg <zack@codesourcery.com>
1375
1376 * builtins.c (initialize_builtins): Remove defines that
1377 handled C/C++ specific junk hereby removed from builtins.def.
1378
1379 2002-07-07 Neil Booth <neil@daikokuya.co.uk>
1380
1381 * lang.c (java_post_options): Update prototype.
1382
1383 2002-07-05 Roger Sayle <roger@eyesopen.com>
1384
1385 * builtins.c (initialize_builtins): Ignore the additional
1386 parameter to DEF_BUILTIN. Handle more C/C++ specific junk in
1387 the builtins.def file.
1388
1389 2002-07-01 Tom Tromey <tromey@redhat.com>
1390
1391 For PR libgcj/7073:
1392 * parse.y (patch_incomplete_class_ref): Handle VOID_TYPE
1393 specially.
1394
1395 2002-07-01 Roger Sayle <roger@eyesopen.com>
1396
1397 * java/decl.c (builtin_function): Accept additional parameter.
1398 (java_init_decl_processing): Pass an additional NULL_TREE
1399 argument to builtin_function.
1400
1401 2002-06-29 T.J. Mather <tjmather@maxmind.com>
1402
1403 * gcj.texi: Fixed gcj invocation example so that it compiles.
1404
1405 2002-06-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1406
1407 * lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
1408 * parse.y (mark_parser_ctxt): Likewise.
1409 (check_modifiers, declare_local_variables): Avoid incorrect
1410 hardcoded constant 10.
1411
1412 * lex.c (java_read_char): Avoid "comparison is always true"
1413 warning.
1414
1415 2002-06-25 Andreas Schwab <schwab@suse.de>
1416
1417 * expr.c (JSR): Avoid undefined operation on PC.
1418
1419 2002-06-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1420
1421 * decl.c (clear_binding_level): Const-ify.
1422
1423 2002-06-13 Akim Demaille <akim@epita.fr>
1424
1425 * parse.y (class_declaration, interface_declaration): Make sure
1426 all their rules have an action, in order to avoid meaningless `$$
1427 = $1' and their type clashes.
1428
1429 2002-06-11 Tom Tromey <tromey@redhat.com>
1430
1431 * jcf-write.c (generate_classfile): Use FIELD_SYNTHETIC.
1432 * parse-scan.y (statement_without_trailing_substatement): Added
1433 assert_statement.
1434 (assert_statement): New rule.
1435 * java-tree.h (struct lang_type) [assertions]: New field.
1436 (TYPE_USES_ASSERTIONS): New macro.
1437 (CLASS_USES_ASSERTIONS): Likewise.
1438 (FIELD_SYNTHETIC): New define.
1439 * lex.c (java_lval;): Added ASSERT_TK.
1440 * parse.y (ASSERT_TK): Added.
1441 (statement_without_trailing_substatement): Added assert_statement.
1442 (assert_statement): New rule.
1443 (build_assertion): New function.
1444 (maybe_generate_pre_expand_clinit): Create and initialize
1445 $assertionsDisabled.
1446 (lookup_package_type): Removed decl.
1447 * keyword.h: Rebuilt.
1448 * keyword.gperf (assert): New token.
1449
1450 2002-06-10 Akim Demaille <akim@epita.fr>
1451
1452 * parse.y (interface_type_list, class_member_declaration)
1453 (unary_expression_not_plus_minus): Remove duplicate %type.
1454 Whitespace changes.
1455
1456 2002-06-09 Tom Tromey <tromey@redhat.com>
1457
1458 * Make-lang.in (java/lang.o): Use LANGHOOKS_DEF_H.
1459
1460 * parse.y (method_header): Give error message in all cases.
1461 Fixes PR java/6865.
1462
1463 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1464
1465 Don't use RTL inlining. Fix for PR java/6820.
1466 * lang.c (LANG_HOOKS_POST_OPTIONS): Define.
1467 (flag_really_inline): New.
1468 (java_decode_option): Set flag_really_inline if -finline-functions
1469 is seen.
1470 (java_post_options): New function. Turn off inlining unless
1471 flag_really_inline is set.
1472
1473 2002-06-10 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1474
1475 * gjavah.c (throwable_p): Accept argument as either a classname or
1476 signature fragment. Create null-terminated classname string for super
1477 when calling itself recursively.
1478 (decode_signature_piece): Skip first character from class name
1479 signature when calling throwable_p.
1480
1481 2002-06-08 H.J. Lu (hjl@gnu.org)
1482
1483 * jcf-path.c (jcf_path_init): Allocate 1 more byte for string.
1484
1485 2002-06-04 Tom Tromey <tromey@redhat.com>
1486
1487 * jcf-write.c (perform_relocations): Optmize a goto to a goto.
1488
1489 2002-06-04 Michael Koch <konqueror@gmx.de>
1490
1491 * gcj.texi (Input Options): Fixed typo.
1492
1493 2002-06-04 Zack Weinberg <zack@codesourcery.com>
1494
1495 * java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
1496 typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
1497 all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
1498 and all now-pointless local variables. Rename other local
1499 variables to reflect their not being handles.
1500
1501 * java-tree.h, jcf-dump.c, jcf-io.c: Remove all
1502 #if JCF_USE_STDIO blocks.
1503
1504 * parse.y: Add missing semicolon at end of rule.
1505
1506 2002-06-03 Geoffrey Keating <geoffk@redhat.com>
1507
1508 * check-init.c (attach_initialized_static_class): Delete, unused.
1509 * parse.y: Use htab_t instead of struct hashtable, update
1510 all uses.
1511 * java-tree.h: Include hashtab.h instead of hash.h.
1512 (struct lang_decl_func): Use htab_t, set up for gengtype.
1513 (struct init_test_hash_entry): Delete.
1514 (struct treetreehash_entry): New.
1515 (java_treetreehash_find): New
1516 (java_treetreehash_new): New prototype.
1517 (java_treetreehash_create): New prototype.
1518 (java_mark_tree): Delete prototype.
1519 (java_hash_hash_tree_node): Delete prototype.
1520 (java_hash_compare_tree_node): Delete prototype.
1521 (attach_initialized_static_class): Delete prototype.
1522 * expr.c (build_class_init): Update to use java_treetreehash
1523 functions.
1524 (java_expand_expr): Update to use htab_t.
1525 (emit_init_test_initialization): Likewise.
1526 * decl.c (java_mark_tree): Delete.
1527 * class.c (init_test_hash_newfunc): Delete.
1528 (java_hash_hash_tree_node): Delete.
1529 (java_hash_compare_tree_node): Delete.
1530 (add_method_1): Update to use java_treetreehash functions.
1531 (JAVA_TREEHASHHASH_H): New macro.
1532 (java_treetreehash_hash): New function.
1533 (java_treetreehash_compare): New function.
1534 (java_treetreehash_find): New function.
1535 (java_treetreehash_new): New function.
1536 (java_treetreehash_create): New function.
1537 * Make-lang.in (JAVA_TREE_H): Replace hash.h by HASHTAB_H.
1538
1539 * Make-lang.in (java/parse.o): Depend on debug.h.
1540 * java-tree.h (struct lang_identifier): Use gengtype.
1541 (union lang_tree_node): New.
1542 (struct lang_decl_func): Use gengtype.
1543 (struct lang_decl_var): Likewise.
1544 (struct lang_decl): Likewise.
1545 * parse.y: Include debug.h.
1546 * lang.c (LANG_HOOKS_MARK_TREE): Delete.
1547
1548 * lang.c (struct language_function): New dummy structure.
1549
1550 * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Set
1551 descriminator for DECL_LANG_SPECIFIC.
1552 (struct lang_decl_func): Rename from struct lang_decl.
1553 (enum lang_decl_desc): New.
1554 (struct lang_decl): Make it a union. Update all the accessor macros.
1555 (struct lang_type): Use gengtype.
1556 * class.c (add_method_1): Set descriminator for DECL_LANG_SPECIFIC.
1557 * decl.c (java_dup_lang_specific_decl): All lang_decl structures
1558 are now the same size.
1559 (lang_mark_tree): Use gengtype to mark TYPE_LANG_SPECIFIC;
1560 use discriminator to mark DECL_LANG_SPECIFIC.
1561
1562 * Make-lang.in (gt-java-builtins.h): New rule.
1563 (java/builtins.o): Add dependency on gt-<filename>.h.
1564 * builtins.c: Use gengtype for roots.
1565 (union string_or_tree): Use gengtype.
1566 (struct builtin_record): Use gengtype.
1567 * config-lang.in (gtfiles): Add builtins.c.
1568
1569 * Make-lang.in (gt-java-class.h, gt-java-constants.h,
1570 gt-java-decl.h, gt-java-expr.h, gt-java-jcf-parse.h,
1571 gt-java-jcf-write.h, gt-java-lang.h, gt-java-mangle.h,
1572 gt-java-parse.h, gtype-java.h): Add rules to generate.
1573 (parse.o): Add dependency on gt-java-parse.h, gt-java.h.
1574 (class.o): Add dependency on gt-*.h.
1575 (constants.o): Likewise.
1576 (decl.o): Likewise.
1577 (expr.o): Likewise.
1578 (jcf-parse.o): Likewise.
1579 (jcf-write.o): Likewise.
1580 (lang.o): Likewise.
1581 * config-lang.in (gtfiles): New.
1582 * class.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
1583 * constants.c: Replace uses of ggc_add_* with GTY markers.
1584 Include gt-*.h.
1585 * decl.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
1586 * expr.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
1587 * java-tree.h: Replace uses of ggc_add_* with GTY markers.
1588 * jcf-parse.c: Replace uses of ggc_add_* with GTY markers.
1589 Include gt-*.h.
1590 * jcf-write.c: Replace uses of ggc_add_* with GTY markers.
1591 Include gt-*.h.
1592 * lang.c: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
1593 * mangle.c: Replace uses of ggc_add_* with GTY markers. Include
1594 gt-*.h.
1595 * parse.y: Replace uses of ggc_add_* with GTY markers. Include gt-*.h.
1596 Include gtype-java.h.
1597
1598 2002-06-02 Tom Tromey <tromey@redhat.com>
1599
1600 Fix for PR java/5913:
1601 * parse.y (patch_binop): Call patch_string on op1.
1602
1603 2002-06-02 Tom Tromey <tromey@redhat.com>
1604
1605 Fix for PR java/1343, PR java/6336:
1606 * parse.y (make_nested_class_name): Remove extraneous `else'; fix
1607 formatting. Changed return type.
1608 (anonymous_class_counter): Moved to top of file.
1609 (maybe_make_nested_class_name): Append number to class name for
1610 function-local classes.
1611
1612 2002-05-28 Zack Weinberg <zack@codesourcery.com>
1613
1614 * decl.c, jcf-parse.c, parse.y, typeck.c: Include real.h.
1615 * Make-lang.in: Update dependency lists.
1616
1617 2002-05-18 Mark Mitchell <mark@codesourcery.com>
1618
1619 * gjavah.c (throwable_p): Do not free the name of the class after
1620 passing it to find_class.
1621 * java-tree.h (CLASS_BEING_LAIDOUT): Remove duplicate definition.
1622 * jcf-io.c (dirent.h): Include it.
1623 (fnmatch.h): Likewise.
1624 (compare_path): New function.
1625 (java_or_class_file): Likewise.
1626 (memoized_dirlist_entry): New type.
1627 (memoized_dirlist_lookup_eq): New function.
1628 (memoized_dirlists): New variable.
1629 (caching_stat): New function.
1630 (memoized_class_lookup_eq): New function.
1631 (memoized_class_lookups): Likewise.
1632 (find_class): Use memoized_class_lookups and caching_stat.
1633 * jcf.h (JCF_USE_SCANDIR): Define.
1634 * parse.y (java_expand_classes): Write the class files in reverse
1635 order.
1636
1637 2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1638
1639 * Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
1640
1641 2002-05-13 Mark Mitchell <mark@codesourcery.com>
1642
1643 * jcf-write.c (write_classfile): Unlink the temporary file if it
1644 cannot be renamed. Use concat to build up the name of the
1645 temporary file.
1646
1647 2002-05-08 Mark Mitchell <mark@codesourcery.com>
1648
1649 * jcf-write.c (write_classfile): Write the file to a
1650 temporary file and then rename it.
1651
1652 2002-05-07 Tom Tromey <tromey@redhat.com>
1653
1654 * gjavah.c (throwable_p): Use xstrdup, not strdup.
1655
1656 Fix for PR java/1200:
1657 * gjavah.c (throwable_p): New function.
1658 (decode_signature_piece): Use it. A `WeakReference' isn't the
1659 same as a `jweak'.
1660 Include hashtab.h.
1661 (gcjh_streq): New function.
1662
1663 2002-05-07 Andreas Jaeger <aj@suse.de>
1664
1665 * parse.y (finish_for_loop): Fix if statement.
1666
1667 2002-05-06 Tom Tromey <tromey@redhat.com>
1668
1669 Fix for PR java/5941:
1670 * parse.y (finish_for_loop): Set SUPPRESS_UNREACHABLE_ERROR for
1671 loop update expression.
1672 (java_complete_lhs): Use SUPPRESS_UNREACHABLE_ERROR.
1673 * java-tree.h (SUPPRESS_UNREACHABLE_ERROR): New macro.
1674
1675 2002-05-04 Mark Wielaard <mark@klomp.org>
1676
1677 For PR java/6519:
1678 * parse.y (build_string_concatenation): Return just op1 only when op2
1679 is null and op1 is a STRING_CST, otherwise always construct a
1680 StringBuffer.
1681
1682 2002-04-27 Tom Tromey <tromey@redhat.com>
1683
1684 For PR java/6382:
1685 * parse.y (string_convert_int_cst): New function.
1686 (merge_string_cste): Use it.
1687
1688 2002-04-25 Neil Booth <neil@daikokuya.demon.co.uk>
1689
1690 * java-tree.h (java_parse_file): Update.
1691 (java_set_yydebug): Remove.
1692 * jcf-parse.c (yydebug): Remove.
1693 (java_set_yydebug): Die.
1694 (java_parse_file): Update.
1695 * lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
1696
1697 2002-04-24 Tom Tromey <tromey@redhat.com>
1698
1699 For PR java/6425:
1700 * parse.y (qualify_ambiguous_name) [case CALL_EXPR]: Always choose
1701 EXPR_WFL_QUALIFICATION of qual_wfl.
1702
1703 2002-04-23 Per Bothner <per@bothner.com>
1704
1705 * expr.c (PRE_JSR): Call NOTE_LABEL for return address.
1706 * java-tree.h (BCODE_RETURN_TARGET): Removed - never set.
1707 (BCODE_TARGET): Remove BCODE_RETURN_TARGET.
1708
1709 2002-04-23 Tom Tromey <tromey@redhat.com>
1710
1711 For PR java/6314:
1712 * jvspec.c (lang_specific_driver): Use --resource, not -R. Also
1713 recognize `-fcompile-resource='.
1714 * gcj.texi (Invoking gcj): Use --resource, not -R. Expanded text
1715 a bit.
1716
1717 2002-04-22 Alexandre Petit-Bianco <apbianco@redhat.com>
1718
1719 * jcf-parse.c: (yyparse): Don't prepend "./" to relative
1720 paths. Fixes PR java/2791.
1721
1722 2002-04-19 Andrew Haley <aph@redhat.com>
1723
1724 * jcf-write.c (push_long_const): lo, hi: New variables.
1725 Use rshift_double to extract the high part of a 64-bit long.
1726 Use WORD_TO_INT to extract the low part.
1727
1728 * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
1729 HOST_WIDE_INT for num. Use JPOOL_UINT to get it.
1730 CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
1731
1732 2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
1733
1734 * typeck.c (incomplete_type_error): Remove.
1735
1736 2002-04-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1737
1738 * class.c (make_class_data): Set DECL_ALIGN on static class data,
1739 for hash synchronization.
1740 * expr.c (java_expand_expr): Set DECL_ALIGN on static array objects.
1741 * decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for
1742 class_type_node.
1743
1744 2002-04-16 Mark Wielaard <mark@klomp.org>
1745
1746 * jcf-write.c (generate_bytecode_insns): Only write const_0 if not
1747 negative zero.
1748
1749 2002-04-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1750
1751 Fix for PR java/6294:
1752 * parse.h (INNER_INTERFACE_MODIFIERS): Allow ACC_PRIVATE for inner
1753 interfaces.
1754
1755 2002-04-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1756
1757 Fix for PR java/6085:
1758 * parse.y (patch_method_invocation): Always use build_access_to_thisn
1759 to get enclosing "this" argument for inner-class constructor
1760 invocation. Pass correct arguments to build_access_to_thisn.
1761
1762 2002-04-10 Andreas Jaeger <aj@suse.de>
1763
1764 * gcj.texi (Input Options): Fix extdirs patch.
1765
1766 2002-04-10 Anthony Green <green@redhat.com>
1767
1768 * jcf-path.c (jcf_path_init) : Clean up local extdirs declaration.
1769
1770 2002-04-09 Anthony Green <green@redhat.com>
1771
1772 * gcj.texi (Input Options): Add --extdirs documentation.
1773 * jcf-dump.c (OPT_extdirs): New macro.
1774 (options): Add extdirs option.
1775 (help): Describe --extdirs.
1776 (main): Handle OPT_extdirs.
1777 * gjavah.c (OPT_extdirs): New macro.
1778 (options): Add extdirs option.
1779 (help): Describe --extdirs.
1780 (main): Handle OPT_extdirs.
1781 * jcf-path.c (jcf_path_init): Add extdirs support.
1782 (jcf_path_extdirs_arg): New function.
1783 (extensions): New variable to hold extensions path entries.
1784 * jvspec.c: Remove -fextdirs= when compiling main().
1785 * lang.c (java_decode_option): Handle -fextdirs=.
1786 * jcf.h (jcf_path_extdirs_arg): Declare new function.
1787 * Make-lang.in: Compile jcf-path with version info for use in
1788 identifying the appropriate libgcj.jar.
1789
1790 2002-04-08 Tom Tromey <tromey@redhat.com>
1791
1792 For PR libgcj/5303:
1793 * .cvsignore: Added rmic.1 and rmiregistry.1.
1794 * gcj.texi (Top): Link to new nodes.
1795 (Invoking rmic): New node.
1796 (Invoking rmiregistry): Likewise.
1797 * Make-lang.in (java.generated-manpages): Added rmic.1 and
1798 rmiregistry.1.
1799 (java.maintainer-clean): Likewise.
1800 ($(srcdir)/java/rmic.1): New target.
1801 ($(srcdir)/java/rmiregistry.1): Likewise.
1802 (java.install-man): Handle rmic.1 and rmiregistry.1.
1803
1804 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1805
1806 * gcj.texi (Invocation): Update JvAttachCurrentThread documentation.
1807 Add note about handling uncaught exceptions. Add an exception handler
1808 to example.
1809
1810 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1811
1812 * parse.y (resolve_qualified_expression_name): Clear "from_super" flag
1813 after using it to patch CALL_EXPR.
1814
1815 2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1816
1817 * gcj.texi (Invocation): Document CNI invocation API.
1818
1819 2002-04-04 Neil Booth <neil@daikokuya.demon.co.uk>
1820
1821 * expr.c (truthvalue_conversion): Rename. Update.
1822 (expand_compare): Update.
1823 * java-tree.h (java_truthvalue_conversion): New.
1824 * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine.
1825
1826 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
1827
1828 * java-tree.h (java_mark_addressable): New.
1829 * lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine.
1830 * typeck.c (mark_addressable): Rename, update.
1831
1832 2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
1833
1834 * expr.c (build_java_binop): Update.
1835 * java-tree.h (java_signed_type, java_unsigned_type,
1836 java_signed_or_unsigned_type): Update.
1837 * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
1838 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
1839 * parse.y (patch_binop): Update.
1840 * typeck.c (signed_or_unsigned_type, unsigned_type,
1841 signed_type): Update.
1842
1843 2002-03-31 Neil Booth <neil@daikokuya.demon.co.uk>
1844
1845 * lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
1846 (java_dummy_print): Remove.
1847 (lang_print_error): Rename. Exit early if inhibiting output.
1848 (inhibit_error_printing_function): New.
1849 (java_init): Don't set hook.
1850 (lang_init_source): Use new boolean.
1851
1852 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
1853
1854 * parse.y (do_resolve_class): Fix infinite recursion.
1855
1856 2002-03-29 Tom Tromey <tromey@redhat.com>
1857
1858 * parse.y (check_inner_circular_reference): Ignore incomplete
1859 types.
1860
1861 2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
1862
1863 * Make-lang.in (builtins.o): Update.
1864 * boehm.c (get_boehm_type_descriptor): Update.
1865 * builtins.c: Include langhooks.h.
1866 * decl.c (java_init_decl_processing): Update.
1867 * java-tree.h (java_type_for_mode, java_type_for_size): New.
1868 * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
1869 Redefine.
1870 * typeck.c (type_for_mode, type_for_size): Update.
1871
1872 2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
1873
1874 * lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
1875
1876 2002-03-28 Tom Tromey <tromey@redhat.com>
1877
1878 * except.c (expand_end_java_handler): If the handler type is NULL,
1879 use java.lang.Throwable. Fixes PR java/5986.
1880
1881 2002-03-28 Alexandre Petit-Bianco <apbianco@redhat.com>
1882
1883 Fix for PR java/4715:
1884 * jcf-parse.c (parse_source_file_3): New function.
1885 (read_class): Call it.
1886 (java_parse_file): Likewise.
1887
1888 2002-03-28 Jan Hubicka <jh@suse.cz>
1889
1890 * java/lang.c (java_init_options): Set flag_trapping_math to 0.
1891
1892 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1893
1894 * parse.y (resolve_package): Initialize "decl".
1895 (lookup_package_type): Remove unused function.
1896
1897 2002-03-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1898
1899 Fix for PR java/5993:
1900 * parse.y (resolve_package): Return the decl if resolution was
1901 successful. Don't special case "java.lang" and "java.lang.reflect"
1902 packages. Set type_name to the merged identifier.
1903 (resolved_qualified_expression_name): Print error using "name" if
1904 resolve_package returns NULL_TREE.
1905
1906 2002-03-27 Tom Tromey <tromey@redhat.com>
1907
1908 * expr.c (expand_invoke): Don't generate null pointer check if
1909 we're calling <init>.
1910
1911 2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
1912
1913 * expr.c (java_lang_expand_expr): Rename java_expand_expr,
1914 fix prototype.
1915 * java-tree.h (java_lang_expand_expr): Similarly.
1916 * lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
1917 (java_init): Don't set hook.
1918
1919 2002-03-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1920
1921 Fix for PR java/5850:
1922 * parse.y (lookup_field_wrapper): Call itself recursively for enclosing
1923 context if field was not found in the current scope.
1924 * expr.c (lookup_field): Don't look in enclosing contexts.
1925
1926 2002-03-26 Tom Tromey <tromey@redhat.com>
1927
1928 Fix for PR java/5942:
1929 * parse.y (init_src_parse): Added sanity check.
1930 * parse.h (struct parser_ctxt) [modifier_ctx]: Array has 12
1931 elements, not 11.
1932
1933 2002-03-26 Neil Booth <neil@daikokuya.demon.co.uk>
1934
1935 * decl.c (lang_mark_tree): Rename java_mark_tree.
1936 * java-tree.h (java_mark_tree): New.
1937 * java-lang.c (LANG_HOOKS_MARK_TREE): Redefine.
1938
1939 2002-03-25 Zack Weinberg <zack@codesourcery.com>
1940
1941 * lex.c: Change java_perform_atof to take normal parameters
1942 instead of a pointer to a parameter block. Call it directly
1943 from java_lex.
1944
1945 2002-03-22 Mark Wielaard <mark@klomp.org>
1946
1947 Fix for PR java/5368:
1948 * parse.y (resolve_qualified_expression_name): Use decl not field_decl
1949 when printing error message.
1950
1951 2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
1952
1953 * decl.c (maybe_build_cleanup): Remove.
1954
1955 2002-03-22 Tom Tromey <tromey@redhat.com>
1956
1957 Andrew Haley <aph@cambridge.redhat.com>
1958
1959 * expr.c (build_field_ref): Don't build a check if the field is a
1960 member of `this'.
1961
1962 2002-03-21 Eric Blake <ebb9@email.byu.edu>
1963
1964 Fix for PR java/6026:
1965 * lex.c (java_lex): Fix parsing of consecutive floats.
1966
1967 2002-03-21 Tom Tromey <tromey@redhat.com>
1968
1969 * parse.y (build_access_to_thisn): Stop when FROM is not an inner
1970 class.
1971
1972 2002-03-21 Neil Booth <neil@daikokuya.demon.co.uk>
1973
1974 * cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
1975 insert_block, getdecls, kept_level_p, global_bindings_p): New.
1976
1977 2002-03-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
1978
1979 * gcj.texi: @code{gcj} becomes @command{gcj}.
1980 @code{gcc} becomes @command{gcc}.
1981 GcjRaw changed to gnu.gcc.RawData.
1982
1983 2002-03-20 Neil Booth <neil@daikokuya.demon.co.uk>
1984
1985 * decl.c (start_java_method): Use new hook.
1986 * lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
1987 (java_init): Remove old hook.
1988
1989 2002-03-18 Alexandre Petit-Bianco <apbianco@redhat.com>
1990
1991 * builtins.c (define_builtin): Do nothing if `type' is null.
1992 Fixes PR java/5876.
1993
1994 2002-03-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
1995
1996 * parse.y (parser_check_super_interface): Fix error message
1997 grammar/order.
1998
1999 2002-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2000
2001 * jcf-parse.c (get_constant): Delete unused variables.
2002
2003 2002-03-17 Neil Booth <neil@daikokuya.demon.co.uk>
2004
2005 * java-tree.h (java_parse_file): New.
2006 * jcf-parse.c (yyparse): Rename java_parse_file.
2007 * lang.c (LANG_HOOKS_PARSE_FILE): Redefine.
2008
2009 2002-03-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2010
2011 * parse.y (craft_constructor): Return the constructor decl.
2012 (java_expand_classes): Update comments.
2013 (lookup_method_invoke): Call fix_constructors immediately for
2014 anonymous class. Fixes PR java/5935.
2015
2016 2002-03-15 Anthony Green <green@redhat.com>
2017
2018 * jcf-parse.c (yyparse): Don't emit class registration
2019 constructor when compiling resource files.
2020
2021 2002-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2022
2023 * lang.c (java_tree_code_type, java_tree_code_length,
2024 tree_code_name): Delete.
2025 (tree_code_type, tree_code_length, tree_code_name): Define.
2026 (java_init): Don't try to copy into the various tree_code
2027 arrays.
2028
2029 2002-03-12 Tom Tromey <tromey@redhat.com>
2030
2031 * jcf-parse.c (get_constant) [CONSTANT_String]: String values are
2032 UTF-8, not UCS-2. Fixes PR java/5923.
2033
2034 * parse.y (qualify_ambiguous_name): Handle case where QUAL_WFL is
2035 a call_expr wrapped in a convert. Fixes PR java/5848.
2036
2037 2002-03-12 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2038
2039 * jcf-write.c (write_classfile): Improve error strings.
2040
2041 2002-03-11 Eric Blake <ebb9@email.byu.edu>
2042
2043 * lex.c: Adjust comments to GNU standards.
2044
2045 2002-03-11 Eric Blake <ebb9@email.byu.edu>
2046
2047 Fix for PR java/5902:
2048 * lex.c (java_lex): Fix parsing of literals.
2049
2050 2002-03-11 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2051
2052 * parse.y (patch_assignment): Wrap the right-hand-side with a save_expr
2053 to prevent it getting evaluated twice in the store checking case.
2054 * expr.c (build_java_arraystore_check): Unwrap SAVE_EXPR's when
2055 examining OBJECT.
2056
2057 2002-03-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2058
2059 * decl.c (java_init_decl_processing): Make sure class_type_node
2060 alignment is not less than 64 bits if hash synchronization is enabled.
2061
2062 2002-03-08 Per Bothner <per@bothner.com>
2063
2064 * parse.y (java_complete_lhs): Check if patch_assignment
2065 returned an error-mark.
2066
2067 * parse.y (try_builtin_assignconv): Don't special-case zero.
2068
2069 2002-03-08 Per Bothner <per@bothner.com>
2070
2071 Fix for PR java/5812.
2072 * expr.c (build_java_jsr): Take pc arguments, and do lookup_label
2073 here instead of in JSR macro. Likewise with load_type_state call.
2074 Do the latter on if the return_pc has been verified (the jsr returns).
2075 (JSR): Now just call build_java_jsr.
2076
2077 2002-03-07 Jeff Sturm <jsturm@one-point.com>
2078
2079 * java/Make-lang.in (JAVA_TARGET_INSTALL_NAME): Define.
2080 (java.install-common): Link native driver to
2081 JAVA_TARGET_INSTALL_NAME.
2082
2083 2002-03-05 David Billinghurst <David.Billinghurst@riotinto.com>
2084
2085 * builtins.c(cos_builtin): method_return_type ATTRIBUTE_UNUSED
2086 * builtins.c(sin_builtin): Likewise
2087 * builtins.c(sqrt_builtin): Likewise
2088
2089 2002-03-03 Zack Weinberg <zack@codesourcery.com>
2090
2091 * java/expr.c, java/jcf-parse.c, java/lex.c:
2092 Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
2093 REAL_ARITHMETIC blocks unconditional. Delete some further
2094 #ifdef blocks predicated on REAL_ARITHMETIC.
2095
2096 2002-03-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2097
2098 * class.c (init_class_processing): Use ARRAY_SIZE in lieu of
2099 explicit sizeof/sizeof.
2100 * decl.c (java_init_decl_processing): Likewise.
2101 * jcf-parse.c (init_jcf_parse): Likewise.
2102 * parse.y (init_src_parse): Likewise.
2103
2104 2002-03-02 Per Bothner <per@bothner.com>
2105
2106 Make --CLASSPATH by a synonym for --classpath and -classpath.
2107 Implement --bootclasspath.
2108 * jcf-path.c (classpath_u): Rename static variable to classpath_user.
2109 (classpath_l): Remove.
2110 (jcf_path_CLASSPATH_arg): Remove.
2111 (jcf_path_bootclasspath_arg): New function.
2112 (jcf_path_seal): Simplify accordingly.
2113
2114 * jcf.h (jcf_path_bootclasspath_arg): New declarations.
2115 (jcf_path_CLASSPATH): Remove declaration.
2116 * jvspec.c (jvgenmain_spec): Also accept -fbootclasspath*.
2117 (lang_specific_driver): Translate -bootclasspath.
2118 * lang-options.h: Add --bootclasspath. Update --CLASSPATH.
2119 * lang.c (decode_lang_options): Do jcf_path_init first.
2120 Handle -fCLASSPATH same as -fclasspath. Also process -fbootclasspath.
2121 * gjavah.c: Also handle --bootclasspath.
2122 Handle --CLASSPATH as a synonum for --classpath.
2123 * jcf-dump.c: Likewise.
2124
2125 "." is not part of system path, but is the default for --classpath.
2126 * jcf-path.c (jcf_path_init): Don't add "." to sys_dirs.
2127 (jcf_path_seal): Add "." if no CLASSPATH specified.
2128
2129 * gcj.texi: Document changes.
2130
2131 2002-03-01 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2132
2133 * expr.c (build_java_arraystore_check): Fix formatting.
2134
2135 2002-02-28 Alexandre Petit-Bianco <apbianco@redhat.com>
2136
2137 Fix for PR java/5758, java/5632:
2138 * jcf-parse.c (load_class): Renamed local variable, consider `.' an
2139 inner-class separator too.
2140 * parse.y (do_resolve_class): New local `decl_result.'
2141 Progressively build a name for what can have been loaded.
2142
2143 2002-02-28 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2144
2145 * expr.c (java_array_data_offset): Removed function.
2146 (JAVA_ARRAY_LENGTH_OFFSET): Removed macro.
2147 (build_java_array_length_access): Obtain "length" value using a
2148 COMPONENT_REF, instead of INDIRECT_REF and arithmetic.
2149 (build_java_arrayaccess): Correct comment. Access "data" using a
2150 COMPONENT_REF, and return an ARRAY_REF instead of an INDIRECT_REF.
2151 (build_java_arraystore_check): New function.
2152 (expand_java_arraystore): Use build_java_arraystore_check.
2153 * parse.y (patch_assignment): Simplify code to insert a store check
2154 when lvalue is an ARRAY_REF. Use build_java_arraystore_check.
2155 * check-init.c (check_init): Update to reflect that an array length
2156 access is now a COMPONENT_REF.
2157 * gcj.texi (Code Generation): Improve documentation of
2158 -fno-bounds-check. Add documentation for -fno-store-check.
2159 * java-tree.h (flag_store_check): Declare.
2160 (build_java_arraystore_check): Declare.
2161 * lang.c (flag_store_check): Initialize to 1.
2162 (lang_f_options): Add store-check option.
2163 * jvspec.c: Don't pass store-check option to jvgenmain.
2164 * lang-options.h: Add help string for -fno-store-check.
2165
2166 2002-02-28 Neil Booth <neil@daikokuya.demon.co.uk>
2167
2168 * decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
2169 * java-tree.h (java_dup_lang_specific_decl): New.
2170 * lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
2171
2172 2002-02-27 Zack Weinberg <zack@codesourcery.com>
2173
2174 * builtins.c, decl.c: Delete traditional-mode-related code
2175 copied from the C front end but not used, or used only to
2176 permit the compiler to link.
2177
2178 2002-02-22 Tom Tromey <tromey@redhat.com>
2179
2180 Fix for PR java/2369:
2181 * jvspec.c (verify_class_name): New function.
2182 (lang_specific_driver): Call it.
2183 (JAVA_START_CHAR_P): New macro.
2184 (JAVA_PART_CHAR_P): Likewise.
2185
2186 2002-02-22 Per Bothner <per@bothner.com>
2187
2188 * class.c: Change vtable to be more compatible with g++ v3 abi.
2189 (get_dispatch_table): Prepend offset-to-top (always 0) and
2190 type_info pointer (currently unimplemented hence NULL) to vtable.
2191 Specifically, prepend offset-to-top and typeinfo ptr (currently null).
2192 (make_class_data): Variable dtable_start_offset is sizeof 2 pointers.
2193 Adjust vtable pointers by dtable_start_offse - i.e. skip new words.
2194 (build_dtable_decl): Add declarations for new fields.
2195
2196 2002-02-20 Per Bothner <per@bothner.com>
2197
2198 * parse.y (patch_method_invocation): Set CAN_COMPLETE_NORMALLY on call
2199 to finit$ (otherwise generate_bytecode_insns drops it). However, we
2200 don't need to set it on the COMPOUND_EXPR - the caller does that.
2201
2202 2002-02-20 Nic Ferrier <nferrier@tapsellferrier.co.uk>
2203
2204 * gcj.texi: Option `--classpath' becomes `--CLASSPATH.'Option
2205 `--CLASSPATH' becomes `--classpath.'
2206 * gjavah.c: Likewise.
2207 * jcf-dump.c: Likewise.
2208 * lang-options.h: Likewise.
2209 * lang.c: Likewise.
2210 * jcf-path.c: Updated comment.
2211 (jcf_path_classpath_arg): Renamed `jcf_path_CLASSPATH_arg.'
2212 (jcf_path_CLASSPATH_arg): Renamed `jcf_path_classpath_arg.'
2213 * jcf.h (jcf_path_CLASSPATH_arg): Ditto.
2214 (jcf_path_CLASSPATH_arg): Ditto.
2215 (classpath_u): Updated leading comment.
2216
2217 2002-02-20 Per Bothner <per@bothner.com>
2218
2219 * builtins.c (check_for_builtin): New function.
2220 (build_call_or_builtin): Remove.
2221 * java-tree.h: Update accordingly.
2222 * expr.c (expand_invoke): Use build + check_for_builtin instead
2223 of build_call_or_builtin.
2224 * parse.y (patch_invoke): Likewise. This avoids needlessly creating
2225 a new CALL_EXPR node, which means we don't lose the CALL_USING_SUPER
2226 flag (which had caused jcf-write to incorrectly emit invokevirtual).
2227
2228 2002-02-17 Tom Tromey <tromey@redhat.com>
2229
2230 * java-tree.h (TYPE_STRICTFP): New macro.
2231 (struct lang_type) [strictfp]: New field.
2232 (CLASS_STRICTFP): New macro.
2233 (METHOD_STRICTFP): New macro.
2234 (struct lang_decl) [strictfp]: New field.
2235 * parse.y (method_header): Disallow strictfp constructor or
2236 abstract method.
2237 (STRICT_TK): Move before MODIFIER_TK.
2238 * parse.h (CLASS_MODIFIERS): Added ACC_STRICT.
2239 (METHOD_MODIFIERS): Likewise.
2240 (INTERFACE_MODIFIERS): Likewise.
2241 * jcf-write.c (get_access_flags): Likewise.
2242 * class.c (set_class_decl_access_flags): Recognize ACC_STRICT.
2243 (add_method_1): Likewise.
2244 (get_access_flags_from_decl): Likewise.
2245 * jcf-dump.c (print_access_flags): Print in standard order. Also,
2246 recognize strictfp flag.
2247 * jcf.h (ACC_STRICT): New define.
2248
2249 2002-02-12 David Billinghurst <Davod.Billinghurst@riotinto.com>
2250
2251 * class.c(build_utf8_ref): Move declaration of decl_size
2252
2253 2002-02-07 Tom Tromey <tromey@redhat.com>
2254
2255 * gcj.texi (Input Options): --CLASSPATH does not suppress system
2256 path.
2257
2258 2002-02-04 Anthony Green <green@redhat.com>
2259
2260 * class.c (build_utf8_ref): Put UTF-8 constants into merged
2261 sections if available.
2262
2263 2002-02-04 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2264
2265 * parse.y (java_expand_classes): Fix typo in static field loop.
2266
2267 2002-02-02 Richard Henderson <rth@redhat.com>
2268
2269 * class.c (add_field): Mark static fields external.
2270 (build_class_ref): Remove redundant set.
2271 * parse.y (java_expand_classes): Mark static fields of classes
2272 to be compiled as local.
2273 * jcf-parse.c (parse_class_file): Likewise.
2274
2275 2002-02-02 Nic Ferrier <nferrier@tapsellferrier.co.uk>
2276
2277 * gcj.texi (About CNI): New node.
2278
2279 2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org>
2280
2281 PR java/5080
2282 * jcf-parse.c : Check for HAVE_LOCALE_H before using
2283 setlocale() with LC_CTYPE as a parameter.
2284 * jv-scan.c: Same.
2285
2286 2002-01-31 Joseph S. Myers <jsm28@cam.ac.uk>
2287
2288 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
2289 Follow GNU Coding Standards for --version.
2290
2291 2002-01-28 Tom Tromey <tromey@redhat.com>
2292
2293 * expr.c (build_jni_stub): Ensure storage for `meth' is
2294 generated.
2295 * parse.y (java_complete_expand_methods): Set
2296 current_function_decl before building JNI stub.
2297
2298 2002-01-26 Andreas Tobler <a.tobler@schweiz.ch>
2299
2300 * gcc/java/builtins.c (sqrt_builtin): Use BUILT_IN_SQRT, not
2301 BUILT_IN_SQRTF.
2302
2303 2002-01-22 Tom Tromey <tromey@redhat.com>
2304
2305 * decl.c (java_init_decl_processing): Use add_predefined_file.
2306 Predefine RawData.java.
2307 (predef_filenames): Removed.
2308 (java_init_decl_processing): Don't register predef_filenames.
2309 * jcf-parse.c (add_predefined_file): New function.
2310 (predefined_filename_p): Rewrote.
2311 (predefined_filename_p): No longer static.
2312 * decl.c (java_init_decl_processing): Call initialize_builtins.
2313 * Make-lang.in (JAVA_OBJS): Added builtins.o.
2314 (java/builtins.o): New target.
2315 * builtins.c: New file.
2316 * parse.y (patch_invoke): Use build_call_or_builtin.
2317 * java-tree.h (build_call_or_builtin): Declare.
2318 (initialize_builtins): Declare.
2319 (java_set_exception_lang_code): Removed unused declaration.
2320 (PREDEF_FILENAMES_SIZE): Removed.
2321 (java_tree_index): Added JTI_PREDEF_FILENAMES.
2322 (predef_filenames): New define.
2323 (add_predefined_file): Declare.
2324 (predefined_filename_p): Declare.
2325 * expr.c (expand_invoke): Use build_call_or_builtin.
2326
2327 2002-01-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2328
2329 * parse.y (patch_switch_statement): Fix format specifier.
2330
2331 2002-01-16 Tom Tromey <tromey@redhat.com>
2332
2333 More for PR java/5365:
2334 * gjavah.c (print_stub_or_jni): Cause exception to be thrown by
2335 default.
2336 (process_file): Generate include for
2337 java.lang.UnsupportedOperationExceptions.
2338
2339 2002-01-15 Andreas Jaeger <aj@suse.de>
2340
2341 * .cvsignore: Add man pages.
2342
2343 2002-01-15 Tom Tromey <tromey@redhat.com>
2344
2345 Fix for PR java/5365:
2346 * gjavah.c (process_file): Turn class name into a file name.
2347
2348 2002-01-14 Matthias Klose <doko@debian.org>
2349
2350 * gcj.texi: Fix whitespace and formatting errors in the
2351 synopsis of the man pages. Update copyright.
2352
2353 2002-01-14 Tom Tromey <tromey@redhat.com>
2354
2355 For PR libgcj/5303:
2356 * Make-lang.in (java.install-man): Handle jv-convert man page.
2357 (java.generated-manpages): Added jv-convert.1.
2358 (java.uninstall): Remove jv-convert.1.
2359 (java.maintainer-clean): Likewise.
2360 ($(srcdir)/java/jv-convert.1): New target.
2361 * gcj.texi (Top): Link to jv-convert node.
2362 (Individual utilities): Likewise.
2363 (Invoking jv-convert): New node.
2364
2365 2001-01-10 Jeff Sturm <jsturm@one-point.com>
2366 Martin Kahlert <martin.kahlert@infineon.com>
2367
2368 * jcf-parse.c (get_constant): Don't swap lo/hi for big
2369 endian targets when HOST_BITS_PER_WIDE_INT >= 64.
2370
2371 2002-01-03 Graham Stott <grahams@redhat.com>
2372
2373 * class.c (compile_resource_file): Update copyright date.
2374 Constify filename parameter.
2375 (java-tree.h): Update copyright date.
2376 (compile_resource_file): Constify filename parameter.
2377
2378 2002-01-03 Graham Stott <grahams@redhat.com>
2379
2380 * gcc/jcf-parse.c: Update copyright date.
2381 (yyparse): Constify resource_filename.
2382
2383 2002-01-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2384
2385 * parse.y (src_parse_roots): Don't needlessly zero init.
2386
2387 2001-12-31 Tom Tromey <tromey@redhat.com>
2388
2389 * parse.y (dump_java_tree): New function.
2390 (source_end_java_method): Call it.
2391 (end_class_declaration): Likewise.
2392 * lang.c (java_decode_option): Call dump_switch_p.
2393
2394 2001-12-28 Tom Tromey <tromey@redhat.com>
2395
2396 * gen-table.pl: Don't process characters after \uffff. Added
2397 comment pointing to input file.
2398
2399 2001-12-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2400
2401 * gen-table.pl: Const-ify output. Document the location of a
2402 suitable unicode input file.
2403
2404 * chartables.h: Regenerate.
2405
2406 2001-12-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2407
2408 * chartables.h: Const-ify.
2409 * gjavah.c (options): Likewise.
2410 * jcf-dump.c (options): Likewise.
2411 * jv-scan.c (options): Likewise.
2412 * lex.c (java_start_char_p, java_part_char_p): Likewise.
2413 * parse.y (binop_lookup): Likewise.
2414
2415 2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2416
2417 * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
2418 the static arrays that are output.
2419 * jvspec.c (jvgenmain_spec): Make static.
2420 * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
2421 * keyword.h: Regenerate.
2422 * lang.c (string_option, process_option_with_no, lang_f_options,
2423 lang_W_options): Const-ify.
2424 * lex.c (java_lex): Likewise.
2425
2426 2001-12-21 Richard Henderson <rth@redhat.com>
2427
2428 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
2429 (get_boehm_type_descriptor): ... here. Arrange for the
2430 TREE_TYPE to get set properly.
2431
2432 2001-12-21 Richard Henderson <rth@redhat.com>
2433
2434 * class.c (compile_resource_file): Set TREE_PUBLIC on the constructor
2435 only if the target requires collect2.
2436
2437 * class.c (build_class_ref): Mark _Jv_fooClass DECL_EXTERNAL.
2438
2439 2001-12-20 Tom Tromey <tromey@redhat.com>
2440
2441 For PR java/4509:
2442 * parse.y (java_complete_lhs) [COMPOUND_EXPR]: Correctly compute
2443 CAN_COMPLETE_NORMALLY for the node.
2444 * jcf-write.c (generate_bytecode_insns) [COMPOUND_EXPR]: Don't
2445 generate code for second branch if first branch can't complete
2446 normally.
2447 (generate_bytecode_insns) [LOOP_EXPR]: Don't generate `goto' to
2448 the loop head if the loop body can't complete normally.
2449
2450 2001-12-20 Tom Tromey <tromey@redhat.com>
2451
2452 For PR java/4766:
2453 * jcf-write.c (generate_bytecode_insns) [TRY_FINALLY_EXPR]: Handle
2454 case where `finally' clause can't complete normally.
2455
2456 2001-12-20 Tom Tromey <tromey@redhat.com>
2457
2458 Fixes PR java/5057:
2459 * parse.y (analyze_clinit_body): Added this_class parameter.
2460 Check for more cases where we must keep <clinit>.
2461 (maybe_yank_clinit): Cleaned up flow control.
2462
2463 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2464
2465 * decl.c (java_init_decl_processing): Don't initialize
2466 finit_leg_identifier_node.
2467 * java-tree.h (java_tree_index): Remove JTI_FINIT_LEG_IDENTIFIER_NODE.
2468 (finit_leg_identifier_node): Remove.
2469 (ID_FINIT_P): Don't check for JTI_FINIT_LEG_IDENTIFIER_NODE.
2470
2471 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2472
2473 * mangle.c (mangle_member_name): Don't special-case for
2474 NO_DOLLAR_IN_LABEL.
2475 * mangle_name.c (unicode_mangling_length): Likewise.
2476 (append_unicode_mangled_name): Likewise.
2477 * parse.y (make_nested_class_name): Remove dead NO_DOLLAR_IN_LABEL
2478 code.
2479
2480 2001-12-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2481
2482 * expr.c (build_java_array_length_access): Don't force null pointer
2483 check unless flag_check_references is set.
2484
2485 2001-12-20 Tom Tromey <tromey@redhat.com>
2486
2487 Fix for PR java/3417:
2488 * parse.y (patch_assignment): Added special processing for
2489 `return'.
2490 (patch_return): Don't convert booleans to integers, and don't
2491 special-case `null'.
2492
2493 2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
2494
2495 * config-lang.in (diff_excludes): Remove.
2496
2497 2001-12-17 Joseph S. Myers <jsm28@cam.ac.uk>
2498
2499 * gcj.texi: Update link to GCC manual.
2500
2501 2001-12-17 Tom Tromey <tromey@redhat.com>
2502
2503 * parse.y (link_nested_class_to_enclosing): Removed useless
2504 statement.
2505
2506 2001-12-16 Tom Tromey <tromey@redhat.com>
2507
2508 * mangle.c (mangle_method_decl): Never emit `C2' constructor.
2509 Fixes PR java/5088.
2510
2511 2001-12-16 Joseph S. Myers <jsm28@cam.ac.uk>
2512
2513 * ChangeLog, Make-lang.in, class.c, expr.c, gcj.texi, java-tree.h,
2514 jcf-parse.c, jcf-write.c, lex.c, parse.h, parse.y, verify.c: Fix
2515 spelling errors.
2516
2517 2001-12-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2518
2519 * lex.c (java_read_unicode, java_lex): Use hex_p/hex_value.
2520
2521 2001-12-16 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2522
2523 * decl.c (java_init_decl_processing): Build otable_type correctly.
2524 otable_decl is an otable_type.
2525
2526 2001-12-15 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2527
2528 * java-tree.h (otable_methods, otable_decl, otable_syms_decl,
2529 otable_type, otable_ptr_type, method_symbol_type,
2530 method_symbols_array_type, method_symbols_array_ptr_type): New
2531 field/global tree definitions.
2532 (flag_indirect_dispatch): New flag.
2533 * decl.c (java_init_decl_processing): Initialize new otable and
2534 otable_syms type nodes and decls. Add new field "index" to
2535 method_type_node.
2536 * class.c (build_method_symbols_entry): New function.
2537 (make_method_value): Set "index" to to method's vtable index for
2538 virtual methods when indirect-dispatch is not used.
2539 (make_class_data): For indirect-dispatch, don't emit the dtable_decl,
2540 and set vtable_method_count to -1. Set otable and otable_syms field
2541 if indirect-dispatch is used and there was something to put in them.
2542 (build_method_symbols_entry): New function.
2543 (emit_offset_symbol_table): New function.
2544 * expr.c (get_offset_table_index): New function.
2545 (build_invokevirtual): Build array reference to otable at the index
2546 returned by get_offset_table_index, and use the result as the vtable
2547 offset.
2548 (build_invokeinterface): Similar.
2549 * jcf-parse.c (yyparse): If indirect-dispatch, call
2550 emit_offset_symbol_table at the end of compilation, after all classes
2551 have been generated.
2552 * jvspec.c: Don't pass findirect-dispatch to jvgenmain.
2553 * lang.c (flag_indirect_dispatch): Define.
2554 (lang_f_options): Add indirect-dispatch flag.
2555
2556 2001-12-14 Matthias Klose <doko@debian.org>
2557
2558 * gcj.texi: Markup for man page generation. Document missing
2559 options printed by <tool> --help.
2560 Terminate description of gij's -ms option with a dot.
2561 * Make-lang.in ($(srcdir)/java/*.1): New targets.
2562 (java.generated-manpages java.install-man, java.uninstall,
2563 java-maintainer-clean) Updated.
2564
2565 2001-12-14 Hans Boehm <Hans_Boehm@hp.com>
2566
2567 * class.c (get_dispatch_table): Fix java vtable layout
2568 for TARGET_VTABLE_USES_DESCRIPTORS.
2569 * decl.c (java_init_decl_processing): Initialize
2570 alloc_no_finalizer_node, finalize_identifier_node.
2571 * expr.c (class_has_finalize_method): New function.
2572 (expand_java_NEW): Generate calls for finalizer-free allocation.
2573 (build_invokevirtual): Fix java vtable layout for
2574 TARGET_VTABLE_USES_DESCRIPTORS.
2575 * java-tree.h (enum java_tree_index): New entries:
2576 JTI_ALLOC_NO_FINALIZER_NODE, JTI_FINALIZE_IDENTIFIER_NODE.
2577 (alloc_no_finalizer_node, finalize_deintifier_node): New macros.
2578 (class_has_finalize_method): declare.
2579 (HAS_FINALIZER_P): New macro.
2580 * parse.y (patch_invoke): Generate calls for finalizer-free
2581 allocation.
2582
2583 2001-12-12 Matthias Klose <doko@debian.org>
2584
2585 * Make-lang.in: JAVA_INSTALL_NAME, JAVA_CROSS_NAME: Remove
2586 whitespace at end of line.
2587
2588 2001-12-11 Tom Tromey <tromey@redhat.com>
2589
2590 * lex.c (java_init_lex): Define wfl_to_string as
2591 gnu.gcj.runtime.StringBuffer unless generating bytecode.
2592
2593 2001-12-11 Jeff Sturm <jsturm@one-point.com>
2594
2595 * class.c (make_method_value): Use null_pointer_node to
2596 represent empty exception table.
2597
2598 2001-12-10 Tom Tromey <tromey@redhat.com>
2599
2600 * check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
2601
2602 2001-12-10 Douglas B. Rupp <rupp@gnat.com>
2603
2604 * Make-lang.in (jvspec.o): Add $(OUTPUT_OPTION).
2605
2606 2001-12-09 Per Bothner <per@bothner.com>
2607
2608 * check-init.c (current_switch_has_default): New static field.
2609 (check_init): Case DEFAULT_EXPR: Set current_switch_has_default.
2610 Case SWITCH_EXPR: Save/restore current_switch_has_default. If no
2611 DEFAULT_EXPR seen, simulate a default alternative that copies state.
2612
2613 2001-12-09 Tom Tromey <tromey@redhat.com>
2614
2615 * check-init.c (check_init): Don't allow pre- or post- increment
2616 or decrement of final variable.
2617 (final_assign_error): Minor error message rewording.
2618
2619 2001-12-08 Tom Tromey <tromey@redhat.com>
2620
2621 * java-tree.h: Fixed typo.
2622
2623 * gjavah.c (decompile_method): Don't decompile to `return this'
2624 for static methods.
2625
2626 * gjavah.c (cxx_keywords): Re-sorted.
2627 * lex.c (cxx_keywords): Re-sorted.
2628
2629 * gjavah.c (HANDLE_METHOD): Set `decompiled' before doing anything
2630 else.
2631
2632 * gjavah.c (print_namelet): Clear subnamelets.
2633 (HANDLE_METHOD): Set `method_printed' earlier.
2634
2635 2001-12-07 Tom Tromey <tromey@redhat.com>
2636
2637 * lang.c (lang_f_options): Added
2638 optimize-static-class-initialization.
2639 (java_decode_option): Removed special case.
2640
2641 2001-12-07 Per Bothner <per@bothner.com>
2642
2643 * check-init.c (check_init): Fix typo freeing memory twice.
2644
2645 2001-12-05 Per Bothner <per@bothner.com>
2646
2647 Restore support for static class initialization optimization.
2648 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Re-enable.
2649 * check-init.c (check_int): At end of BLOCK handle initialization
2650 blocks, which used to be done in java_complete_expand_method but did
2651 not handle the case where check_for_initialization might allocate
2652 more than a word of bits.
2653 * decl.c (lang_make_tree): The smic field is now a tree.
2654 * expr.c (build_class_init): Set DECL_FUNCTION_INIT_TEST_CLASS field.
2655 * java-tree.h (DECL_FUNCTION_INIT_TEST_TABLE): New macro.
2656
2657 * parse.y (emit_test_initialization): Combine hash_lookup calls.
2658
2659 * java-tree.h (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND):
2660 Change from a hash table to a list.
2661 (struct_lang_decl): Change field 'smic' to match.
2662 * class.c (add_method_1): Initialize
2663 DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND to null list.
2664 * parse.y (adjust_init_test_initialization): Removed - inlined into -
2665 (java_expand_method_bodies): -here, since 'smic' is now a list.
2666 (patch_invoke): Add to 'smic' list, instead of hash_lookup.
2667
2668 * check-init.c (WORD_SIZE): Use BITS_PER_UNIT.
2669
2670 * class.c (java_hash_compare_tree_node): Fix casts.
2671
2672 2001-12-04 Per Bothner <per@bothner.com>
2673
2674 * check-init.c: Handle definite unassignment to finals in addition
2675 to definite assignment.
2676 (loop_current_locals): New field.
2677 (num_current_locals, int start_current_locals, num_current_words):
2678 Make static.
2679 (SET_P, CLEAR_P, SET_BIT): Add needed but missing parentheses.
2680 (ASSIGNED_P, UNASSIGNED_P, SET_ASSIGNED, SET_UNASSIGNED,
2681 CLEAR_ASSIGNED, CLEAR_UNASSIGNED): New macros.
2682 (get_variable_decl, check_final_reassigned): New functions.
2683 (check_init, check_bool_init): Modify as needed for checking finals.
2684 (check_for_initialization): Take extra parameter and return void.
2685 Do extra start-up logic to check final fields for assignment.
2686 * parse.y (check_static_final_variable_assignment_flag,
2687 reset_static_final_variable_assignment_flag, check_final_assignment,
2688 check_final_variable_local_assignment_flag,
2689 reset_final_variable_indirect_assignment_flag,
2690 reset_final_variable_global_assignment_flag): Remove functions.
2691 (java_complete_expand_methods, outer_field_access_fix,
2692 patch_assignment): Remove no-longer used logic.
2693 * java-tree.h (DECL_FIELD_FINAL_IUD): Change usage and comments.
2694 * parse.y (register_fields, java_complete_tree): Update accordingly.
2695
2696 * check-init.c (ALLOC_WORDS/FREE_WORDS): Use xmalloc/free, not alloca.
2697 (DECLARE_BUFFERS, RELEASE_BUFFERS, ALLOC_BUFFER, FREE_BUFFER): New.
2698 (check_cond_init, check_bool2_init): Use DECLARE_BUFFERS.
2699
2700 * java-tree.h (STATIC_CLASS_INIT_OPT_P): Temporarily turn off.
2701
2702 * java-tree.h (DECL FINAL): New bit-field.
2703 (METHOD_FINAL, FIELD_FINAL, CLASS_FINAL): Define as DECL_FINAL.
2704 (LOCAL_FINAL_P): Use DECL_FINAL rather than old LOCAL_FINAL.
2705 (DECL_INIT_CALLS_THIS): New macro.
2706 (struct lang_decl): New bit-field init_calls_this.
2707 (DECL_FUNCTION_ALL_FINAL_INITIALIZED, DECL_FIELD_FINAL_LIIC,
2708 DECL_FIELD_FINAL_IERR, LOCAL_FINAL, TYPE_HAS_FINAL_VARIABLE
2709 (DECL_BIT_INDEX): Change to use pointer_alias_set since we now
2710 use it for both local variables and final fields.
2711 (struct lang_decl_var): Remove bit-fields final_liic, final_ierr,
2712 and local_final.
2713 (struct lang_type): Remove hfv bit-field.
2714 (check_for_initialization): Change to return void.
2715
2716 * java-tree.h (IS_ARRAY_LENGTH_ACCESS): New macros.
2717 * expr.c (build_java_array_length_access): Set IS_ARRAY_LENGTH_ACCESS.
2718 * check-init.c (final_assign_error): New helper function.
2719 (check_final_reassigned, check_init): Use it.
2720 (check_init): Also check IS_ARRAY_LENGTH_ACCESS for ARRAY.length.
2721
2722 * java-tree.h (struct lang_decl, struct lang_decl_var): Change all
2723 bit-fields to unsigned.
2724
2725 2001-12-03 Per Bothner <per@bothner.com>
2726
2727 * parse.y (patch_binop): Minor constant folding.
2728
2729 * parse.y (build_current_thisn): Shorter 'buffer'.
2730
2731 2001-12-03 Per Bothner <per@bothner.com>
2732
2733 * decl.c (complete_start_java_method): Now generate TRY_FINALLY_EXPR
2734 instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
2735 * jcf-write.c (generate_bytecode_insns): Remove support for
2736 CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR as they are no longer used.
2737 * check-init.c (check_init): Likewise.
2738
2739 2001-12-03 Per Bothner <per@bothner.com>
2740
2741 * verify.c (subroutine_nesting): New function.
2742 (verify_jvm_instructions): Use it to fix logic for checking that
2743 we're done with the current subroutine.
2744
2745 * verify.c (verify_jvm_instruction): For OPCODE_checkcast and
2746 OPCODE_instanceof use POP_TYPE macro for better diagnostics.
2747
2748 2001-12-03 Per Bothner <per@bothner.com>
2749
2750 * jcf.h: Fix obvious typo in comment.
2751 * typeck.c (build_null_signature): Add comment.
2752
2753 2001-12-03 Neil Booth <neil@daikokuya.demon.co.uk>
2754
2755 * expr.c: Remove leading capital from diagnostic messages, as
2756 per GNU coding standards.
2757 * jcf-io.c: Similarly.
2758 * jcf-parse.c: Similarly.
2759 * jv-scan.c: Similarly.
2760 * jvspec.c: Similarly.
2761 * mangle.c: Similarly.
2762
2763 2001-12-02 Tang Ching-Hui <nicholas@cs.nthu.edu.tw>
2764 Alexandre Petit-Bianco <apbianco@redhat.com>
2765
2766 * expr.c (build_java_arrayaccess): Call save_expr on array for
2767 correct evaluation order, modified comment, fixed indentation.
2768 * parse.y: (patch_assignment): Correctly extract the array base
2769 from the tree generate by build_java_arrayaccess, added comments.
2770 (patch_array_ref): Remove SAVE_EXPR on ARRAY_REF.
2771 Fixes PR java/3096, PR java/3803, PR java/3965.
2772
2773 2001-12-01 Neil Booth <neil@daikokuya.demon.co.uk>
2774
2775 * expr.c (expand_byte_code): Remove trailing periods from messages.
2776 * jcf-parse.c (load_class, jcf_parse): Similarly.
2777 * jcf-write.c (generate_classfile): Similarly.
2778 * lex.c (java_lex): Similarly.
2779
2780 2001-11-30 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2781
2782 * class.c (add_interface_do): Set BINFO_VPTR_FIELD.
2783
2784 2001-11-29 Joseph S. Myers <jsm28@cam.ac.uk>
2785
2786 * Make-lang.in (java.generated-manpages): New dummy target.
2787
2788 2001-11-27 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
2789
2790 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
2791 ASM_FINAL_SPEC.
2792 (lang_specific_pre_link): Use set_input to set input_filename.
2793 Append `main' here.
2794 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
2795 (main): Fix definition.
2796 Strip `main' from classname.
2797 Fixes PR java/227.
2798
2799 2001-11-18 Roger Sayle <roger@eyesopen.com>
2800
2801 * parse.h (java_expand_switch): Remove old prototype.
2802
2803 2001-11-18 Tom Tromey <tromey@redhat.com>
2804
2805 Fix for PR java/1401:
2806 * jcf-write.c (generate_bytecode_insns) [binop]: Handle case where
2807 arg0 is null.
2808 (generate_bytecode_insns) [MODIFY_EXPR]: Handle `OP=' case
2809 correctly.
2810
2811 2001-11-18 Neil Booth <neil@daikokuya.demon.co.uk>
2812
2813 * lang.c (finish_parse): Rename to java_finish.
2814 (LANG_HOOKS_FINISH, java_finish): New.
2815
2816 2001-11-15 Neil Booth <neil@daikokuya.demon.co.uk>
2817
2818 * decl.c (init_decl_processing): Rename java_init_decl_processing.
2819 * java-tree.h: New prototype.
2820 * lang.c (java_init): Update prototype. Combine with old init_parse.
2821
2822 2001-11-13 Tom Tromey <tromey@redhat.com>
2823
2824 * gjavah.c (method_signature): New global.
2825 (HANDLE_METHOD): Set it.
2826 (decompile_return_statement): New function.
2827 (decompile_method): Use it.
2828 (print_method_info): Removed `synth' argument.
2829
2830 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
2831
2832 * java-tree.h (java_set_yydebug): New.
2833 * jcf-parse.c (set_yydebug): Rename java_set_yydebug.
2834 * lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
2835 (print_lang_decl, print_lang_type, print_lang_identifier,
2836 print_lang_statistics, lang_print_xnode): Remove.
2837
2838 2001-11-09 Neil Booth <neil@daikokuya.demon.co.uk>
2839
2840 * jcf-parse.c (init_lex): Remove.
2841 * lang.c (language_string, lang_identify): Remove.
2842 (struct lang_hooks): Constify.
2843 (LANG_HOOKS_NAME): Override.
2844 (init_parse): Update.
2845
2846 2001-11-08 Andreas Franck <afranck@gmx.de>
2847
2848 * Make-lang.in (JAVA_INSTALL_NAME, JAVA_CROSS_NAME): Handle
2849 program_transform_name the way suggested by autoconf.
2850 (java.install-common): Also transform auxiliary program names with
2851 program_transform_name.
2852
2853 2001-11-08 Tom Tromey <tromey@cygnus.com>
2854
2855 * parse.y (trap_overflow_corner_case): New rule.
2856 (unary_expression): Use it.
2857 * lex.c (java_init_lex): Don't set minus_seen.
2858 (yylex): Don't use minus_seen. Communicate overflow to parser for
2859 it to handle.
2860 (error_if_numeric_overflow): New function.
2861 * parse.h (minus_seen): Removed field.
2862 (JAVA_RADIX10_FLAG): New define.
2863
2864 2001-11-07 Tom Tromey <tromey@redhat.com>
2865
2866 Patch for PR java/1414:
2867 * parse.y (case_label_list): New global.
2868 (goal): Register case_label_list with GC.
2869 (java_complete_lhs): Save new case on case_label_list.
2870 (patch_switch_statement): Check for duplicate case labels.
2871
2872 2001-11-07 Alexandre Petit-Bianco <apbianco@redhat.com>
2873
2874 * parse.y (patch_assignment): Removed unused third argument.
2875 (java_complete_lhs): Removed unused third argument to patch_assignment.
2876
2877 2001-11-06 Neil Booth <neil@cat.daikokuya.demon.co.uk>
2878
2879 * lang.c: Include langhooks-def.h.
2880 * Make-lang.in: Update.
2881
2882 2001-10-31 Zack Weinberg <zack@codesourcery.com>
2883
2884 * Make-lang.in: Replace $(INTL_TARGETS) with po-generated.
2885
2886 2001-10-29 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2887
2888 * mangle.c (find_compression_record_match): Don't match compression
2889 records for package name elements unless they occur at the start of
2890 the name. Fix for PR java/4717.
2891
2892 2001-10-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2893
2894 * expr.c (expand_java_field_op): Don't special-case references to
2895 java.lang.PRIMTYPE.TYPE.
2896 (build_primtype_type_ref): Removed.
2897 * java-tree.h (build_primtype_type_ref): Remove prototype.
2898 * parse.y (maybe_build_primttype_type_ref): Removed.
2899 (complete_function_arguments): Don't special-case references to
2900 java.lang.PRIMTYPE.TYPE.
2901 (patch_assignment): Likewise.
2902 (array_constructor_check_entry): Likewise.
2903
2904 2001-10-24 Alexandre Petit-Bianco <apbianco@redhat.com>
2905
2906 * mangle.c (static tree compression_table): Fixed leading comment.
2907 * parse.h (struct parser_ctxt): Fixed field comment.
2908 * parse.y (check_pkg_class_access): New prototype, fixed leading
2909 comment, new parameter used to emit error only if passed as true.
2910 (parse_check_super): Pass extra argument to check_pkg_class_access.
2911 (do_resolve_class): Likewise.
2912 (process_imports): Likewise.
2913 (read_import_dir): Fixed indentation.
2914 (find_in_imports_on_demand): New local class_type_name. Local
2915 node_to_use deleted. while loop changed into for loop. Report
2916 multiple definition only for accessible classes. Improved error
2917 message.
2918 (start_complete_expand_method): Local `ptr' removed. DECL_ARGUMENTS
2919 assigned to parameter list, fixed indentation. while loop changed
2920 into for loop, restore TREE_CHAIN on local `tem' before the next
2921 iteration.
2922
2923 2001-10-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
2924
2925 * lang.c (lang_get_alias_set): Deleted.
2926
2927 2001-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2928
2929 * gjavah.c (jni_print_char): Fix thinko in last change.
2930
2931 * gjavah.c (jni_print_char, decode_signature_piece): Use
2932 safe-ctype macros and/or fold extra calls into fewer ones.
2933 * lex.c (java_read_unicode, java_lex): Likewise.
2934 * lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
2935 JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
2936 * mangle_name.c (append_unicode_mangled_name,
2937 unicode_mangling_length): Likewise.
2938
2939 2001-10-17 Richard Henderson <rth@redhat.com>
2940
2941 * Make-lang.in (java/lang.o): Depend on langhooks.h.
2942
2943 2001-10-15 Alexandre Petit-Bianco <apbianco@redhat.com>
2944
2945 * lang.c (langhooks.h): Included.
2946 (LANG_HOOKS_INIT): Redefined.
2947 (LANG_HOOKS_INIT_OPTIONS): Likewise.
2948 (LANG_HOOKS_DECODE_OPTION): Likewise.
2949 (struct lang_hooks lang_hooks): New initialization.
2950
2951 2001-10-11 Per Bothner <per@bothner.com>
2952
2953 * parse.y (patch_synchronized_statement): Use a TRY_FINALLY_EXPR
2954 rather than a CLEANUP_POINT_EXPR/WITH_CLEANUP_EXPR pair.
2955 The former is simpler, and jcf-write.c handles it better.
2956 (java_complete_lhs): No longer need to handle CLEANUP_POINT_EXPR
2957 or WITH_CLEANUP_EXPR.
2958 * jcf-write.c: Revert Alex's change from 2000-10-18. It is no
2959 longer needed, as we already handle empty TRY_FINALLY_EXPR bodies fine.
2960
2961 * parse.y (patch_if_else_statement): If the condition is constant,
2962 optimize away the test.
2963
2964 2001-10-09 Alexandre Petit-Bianco <apbianco@redhat.com>
2965
2966 * parse.y (patch_cast): Call patch_string on the first operand of
2967 the incoming node, update it if necessary. Fixes PR java/4510.
2968
2969 2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
2970
2971 * parse.y (find_as_inner_class): Don't disregard the enclosing scope
2972 when name qualifier matches a package name.
2973
2974 2001-10-08 Tom Tromey <tromey@redhat.com>
2975
2976 Fix for PR java/4489:
2977 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Always
2978 force a new label when computing `body_block'.
2979
2980 2001-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2981
2982 * jcf-io.c (format_uint): Const-ify.
2983 * lang.c (java_tree_code_type, java_tree_code_length): Likewise.
2984 * lex.c (java_get_line_col): Likewise.
2985 * parse.y (build_incdec): Likewise.
2986
2987 2001-10-05 Alexandre Petit-Bianco <apbianco@redhat.com>
2988
2989 * parse.y (register_incomplete_type): Set JDEP_SUPER to be given
2990 a NULL enclosing context if appropriate. Fixes PR java/4466.
2991
2992 2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
2993
2994 * parse.y (patch_assignment): Use lvalue's original TYPE when
2995 building the final COMPOUND_EXPR.
2996 (try_reference_assignconv): Fixed leading comment.
2997
2998 2001-09-26 Alexandre Petit-Bianco <apbianco@redhat.com>
2999
3000 * parse.y (check_final_variable_indirect_assignment): For
3001 COMPOUND_EXPR, return only if finals were found initialized
3002 properly, if not, keep on checking.
3003 (check_final_variable_global_assignment_flag): New local
3004 error_found, set when appropriate and used to decide whether to
3005 report uninitialized finals. Fixed typo in comment.
3006
3007 2001-09-22 Alexandre Petit-Bianco <apbianco@redhat.com>
3008
3009 * decl.c (init_decl_processing): Fixed typo in predef_filenames
3010 last three initializations. Fixes PR java/4360.
3011
3012 2001-09-21 Richard Henderson <rth@redhat.com>
3013
3014 * class.c (get_dispatch_table): Handle function descriptors.
3015 (build_dtable_decl): Likewise.
3016 * expr.c (build_invokevirtual): Likewise.
3017
3018 2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
3019
3020 * parse.y (patch_method_invocation): Build class initialization
3021 when static finals are used to qualify method invocation.
3022 Fixes PR java/4366.
3023
3024 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com>
3025
3026 * parse.h: (WFL_STRIP_BRACKET): Re-written using
3027 build_type_name_from_array_name.
3028 (STRING_STRIP_BRACKETS): New macro.
3029 * parse.y (build_type_name_from_array_name): New function.
3030 (array_creation_expression:): Accumulate []s instead of [s.
3031 (cast_expression:): Accumulate []s instead of [s after cast type
3032 name.
3033 (build_array_from_name): Local string deleted, use
3034 build_type_name_from_array_name.
3035 (build_unresolved_array_type): Accumulate []s instead of [s after
3036 type name.
3037 (register_fields): Fixed comment.
3038 (resolve_class): Local name, base deleted, new locals tname and
3039 array_dims. Use build_type_name_from_array_name. Use array_dims to
3040 build array type.
3041 (purify_type_name): Use STRING_STRIP_BRACKETS.
3042
3043 2001-09-18 Andreas Jaeger <aj@suse.de>
3044
3045 * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
3046 * jv-scan.c: Likewise.
3047
3048 2001-09-17 Alexandre Petit-Bianco <apbianco@redhat.com>
3049
3050 * parse.y (patch_method_invocation): Inner class creation context
3051 check not enforced within constructors. Fixes PR java/1873.
3052
3053 2001-09-16 Tom Tromey <tromey@redhat.com>
3054
3055 * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
3056 NOTE_PUSH for single-case push. Fixes PR java/4189.
3057
3058 2001-09-13 Alexandre Petit-Bianco <apbianco@redhat.com>
3059
3060 * java-tree.h (TYPE_IMPORT_LIST): New macro.
3061 (TYPE_IMPORT_DEMAND_LIST): Likewise.
3062 (struct lang_type): New fields import_list and import_demand_list.
3063 * parse.y (java_complete_class): Initialize TYPE_IMPORT_LIST and
3064 TYPE_IMPORT_DEMAND_LIST with ctxp counterparts.
3065 (do_resolve_class): New local saved_enclosing_type, initialized,
3066 passed as parameter to find_in_imports and find_in_imports_on_demand.
3067 (find_in_imports): Added paramater enclosing_type, use its
3068 TYPE_IMPORT_LIST when applicable.
3069 (find_in_imports_on_demand): Added parameter enclosing_type, use
3070 its TYPE_IMPORT_DEMAND_LIST when applicable. Reorganized locals
3071 declaration and initialization.
3072 (fold_constant_for_init): Switch/restore current_class to the
3073 appropriate context.
3074
3075 2001-09-13 Mark Mitchell <mark@codesourcery.com>
3076
3077 * verify.c (verify_jvm_instructions): Fix typo.
3078
3079 2001-09-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3080
3081 * expr.c (expand_invoke): Const-ification.
3082 * parse.y (patch_method_invocation): Likewise.
3083
3084 2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3085
3086 * gjavah.c (cxx_keywords): Const-ification.
3087 * keyword.gperf (java_keyword): Likewise.
3088 * lang.c (java_tree_code_name): Likewise.
3089 * lex.c (cxx_keywords): Likewise.
3090 * parse.y (java_parser_context_suspend, merge_string_cste): Likewise.
3091
3092 2001-09-11 Richard Henderson <rth@redhat.com>
3093
3094 * parse.h (ctxp_for_generation): Mark extern.
3095
3096 2001-09-10 Richard Henderson <rth@redhat.com>
3097
3098 * class.c (build_class_ref): Set DECL_EXTERNAL before make_decl_rtl.
3099
3100 2001-09-07 Matt Kraai <kraai@alumni.carnegiemellon.edu>
3101
3102 * typeck.c (java_array_type_length, build_prim_array_type):
3103 Represent empty arrays by NULL index.
3104
3105 2001-09-06 Alexandre Petit-Bianco <apbianco@redhat.com>
3106
3107 * java-tree.h (compile_resource_file): Grouped with other prototypes.
3108 * jvspec.c (lang_specific_driver): Removed unused local `ptr.'
3109
3110 2001-09-06 Anthony Green <green@redhat.com>
3111
3112 * class.c (O_BINARY): Define if necessary.
3113 (registerResource_libfunc): Declare.
3114 (init_class_processing): Initilize registerResource_libfunc.
3115 (compile_resource_file): New function.
3116 * java-tree.h (resource_name): Declare.
3117 (compile_resource_file): Declare.
3118 * jcf-parse.c (yyparse): Handle compiling java resource files.
3119 * lang.c (java_decode_option): Handle -fcompile-resource option.
3120 * jvspec.c (lang_specific_driver): Handle -R flag for compiling
3121 resource files.
3122 * gcj.texi (Code Generation): Add documentation for -R flag.
3123
3124 2001-09-05 Alexandre Petit-Bianco <apbianco@redhat.com>
3125
3126 * jcf-write.c (generate_classfile): Issue an error in case of
3127 field/initial value mismatch.
3128 * parse.y (analyze_clinit_body): Keep <clinit> if an array is
3129 being initialized and we're generating bytecode.
3130 (java_complete_lhs): In MODIFY_EXPR section: added comments,
3131 set DECL_INITIAL properly when appropriate.
3132 Fixes PR java/4230
3133 Fixes PR java/4204
3134
3135 2001-09-01 Per Bothner <per@bothner.com>
3136
3137 * parse.y (maybe_yank_clinit): A field without an initializer is not
3138 relevant. All initializers except static final and constant require
3139 <clinit>, regardless of flag_emit_class_files.
3140
3141 2001-08-31 Per Bothner <per@bothner.com>
3142
3143 * class.c (set_constant_value): When not emiting class files, then a
3144 String ConstantValue is a utf8const_ptr_type.
3145
3146 2001-08-30 Per Bothner <per@bothner.com>
3147
3148 * jcf-write.c (generate_classfile): Check that field is primitive
3149 or string before emitting ConstantValue attribute.
3150
3151 2001-08-30 Per Bothner <per@bothner.com>
3152
3153 * parse.y (resolve_qualified_expression_name): If creating a
3154 COMPOUND_EXPR, set it's type correctly.
3155
3156 2001-08-30 Per Bothner <per@bothner.com>
3157
3158 * jcf-io.c (open_class): Set filename field.
3159
3160 * jcf-parse,c (parse_class_file): Set current_function_decl
3161 for better error message when Code attribute is missing.
3162
3163 * lang.c (put_decl_node, lang_print_error): Re-arrange for
3164 better diagnostics, especially for constructors.
3165
3166 2001-08-30 Per Bothner <per@bothner.com>
3167
3168 * jcf-write.c (generate_classfile): Don't write ConstantValue
3169 attribute if field is not final, for compatibility with jdk.
3170
3171 * jcf-write.c (generate_classfile): Convert ConstantValue values
3172 to correct type. Work-around for front-end bug.
3173 * class.c (set_constant_value): Error if constant has wrong type.
3174
3175 2001-08-30 Per Bothner <per@bothner.com>
3176
3177 * jcf-dump.c (print_constant): Fix fencepost error so "Float" and
3178 "Double" are printed at verbosity 1.
3179
3180 * jcf-dump.c (main): Disable flag_print_attributes if --javap.
3181
3182 * jcf-dump.c (SPECIAL_IINC): Remove unneeded casts to long.
3183
3184 2001-08-30 Alexandre Petit-Bianco <apbianco@redhat.com>
3185
3186 * parse.y (patch_assignment): Don't verify final re-assignment here.
3187 (java_complete_lhs): Verify assignments to finals calling
3188 patch_assignment. Verify re-assignments to finals before calling
3189 patch_assignment.
3190
3191 2001-08-29 Alexandre Petit-Bianco <apbianco@redhat.com>
3192
3193 * parse.y (java_complete_lhs): Allow final locals in CASE_EXPRs.
3194 Fixes PR java/1413
3195
3196 2001-08-28 Alexandre Petit-Bianco <apbianco@redhat.com>
3197
3198 * lex.c (java_lex): new local found_hex_digits. Set and then used
3199 in test to reject invalid hexadecimal numbers.
3200 * parse.y (java_complete_tree): Prevent unwanted cast with
3201 initialized floating point finals.
3202 (patch_binop): Emit a warning when detecting a division by zero,
3203 mark result not constant, don't simplify non integer division.
3204
3205 2001-08-28 Per Bothner <per@bothner.com>
3206
3207 * jcf-write.c (generate_bytecode_insns): For increments and
3208 decrements just recurse to push constant. Improvement on Mark's patch.
3209
3210 2001-08-28 Mark Mitchell <mark@codesourcery.com>
3211
3212 * jcf-write.c (generate_bytecode_insns): Generate an integer to
3213 real conversion for increments and decrements of reals.
3214
3215 2001-08-27 Alexandre Petit-Bianco <apbianco@redhat.com>
3216
3217 * parse.y (resolve_qualified_expression_name): Handle unresolved
3218 qualified expressions, prevent numerical qualifiers, fixed typo.
3219 Fixes PR java/4141
3220
3221 2001-08-24 Alexandre Petit-Bianco <apbianco@redhat.com>
3222
3223 * parse.y (check_deprecation): Handle TYPE_DECL in a special case,
3224 don't report anything but deprecated class when marked so. Handle
3225 VAR_DECL.
3226 (patch_method_invocation): Check deprecation on methods and types.
3227 (patch_binop): code becomes an enum tree_code, added default: to
3228 switch to handle that. Detect division by zero, try to fold and
3229 return before using a subroutine.
3230
3231 2001-08-23 Alexandre Petit-Bianco <apbianco@redhat.com>
3232
3233 * jcf-parse.c (yyparse): Set magic to 0, don't issue error for a
3234 file smaller than 4 bytes.
3235 * parse.y (check_inner_circular_reference): New function.
3236 (check_circular_reference): Likewise.
3237 (array_initializer:): Accept {,}.
3238 (java_check_circular_reference): Rewritten using
3239 check_circular_reference and check_inner_circular_reference.
3240 (java_complete_expand_method): Unconditionally save and restore
3241 the unpurged exception list.
3242 (build_dot_class_method_invocation): Unmangle signature parameter.
3243
3244 2001-08-21 Tom Tromey <tromey@redhat.com>
3245
3246 * decl.c (init_decl_processing): Add `throws' field to method
3247 descriptor.
3248 * class.c (make_method_value): Compute `throws' field for method.
3249
3250 2001-08-22 Alexandre Petit-Bianco <apbianco@redhat.com>
3251
3252 * parse.y (resolve_inner_class): Keep local_enclosing to NULL if
3253 circularity is detected.
3254 (ctors_unchecked_throws_clause_p): Fixed leading comment.
3255
3256 2001-08-17 Richard Henderson <rth@redhat.com>
3257
3258 * class.c (emit_register_classes): Add align parameter to
3259 call to assemble_integer.
3260
3261 2001-08-16 Alexandre Petit-Bianco <apbianco@redhat.com>
3262
3263 * jcf-parse.c (load_class): New locals saved and class_loaded. If
3264 loading a class_or_name fails, try considering an innerclass name
3265 and load the enclosing context.
3266 * parse.y (resolve_inner_class): New function.
3267 (find_as_inner_class): Added leading comment.
3268 (register_incomplete_type): Keep the current context as enclosing
3269 context for JDEP_FIELD dependencies.
3270 (do_resolve_class): Locals new_class_decl and super initialized to
3271 NULL. Call resolve_inner_class, explore the enclosing context
3272 superclass if necessary.
3273 Fixes PR java/4007
3274
3275 2001-08-16 Tom Tromey <tromey@redhat.com>
3276
3277 * jcf-dump.c (main): Updated for change to jcf_path_seal.
3278 * gjavah.c (main): Updated for change to jcf_path_seal.
3279 * lang.c (version_flag): New global.
3280 (java_decode_option): Recognize `-version'.
3281 (java_init): Update for change to jcf_path_seal.
3282 * jcf.h (jcf_path_seal): Added `print' argument.
3283 * jcf-path.c (jcf_path_seal): Added `print' argument.
3284
3285 2001-08-13 Zack Weinberg <zackw@panix.com>
3286
3287 * Make-lang.in (java/decl.o): Update dependencies.
3288 * decl.c: Include libfuncs.h, don't include toplev.h.
3289
3290 2001-08-12 Alexandre Petit-Bianco <apbianco@redhat.com>
3291
3292 * decl.c (init_decl_processing): exception_type_node,
3293 class_not_found_type_node, and no_class_def_found_type_node
3294 initialized. predef_filenames augmented accordingly.
3295 instinit_identifier_node initialized.
3296 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): Entry removed.
3297 * java-tree.h (enum java_tree_index): New entries
3298 JTI_EXCEPTION_TYPE_NODE, JTI_CLASS_NOT_FOUND_TYPE_NODE,
3299 JTI_NO_CLASS_DEF_FOUND_TYPE_NODE, JTI_INSTINIT_IDENTIFIER_NODE.
3300 (exception_type_node): New macro.
3301 (class_not_found_type_node): Likewise.
3302 (no_class_def_found_type_node): Likewise.
3303 (instinit_identifier_node): Likewise.
3304 (PREDEF_FILENAMES_SIZE): Adjusted.
3305 (TYPE_HAS_FINAL_VARIABLE): Fixed typo.
3306 (struct lang_type): Fixed typo in bitfield name.
3307 (DECL_INSTINIT_P): New macro.
3308 (ID_INSTINIT_P): Likewise.
3309 * jcf-write.c (generate_classfile): instinit$ bears the Synthetic
3310 attribute.
3311 * parse.y (encapsulate_with_try_catch): New function.
3312 (generate_instinit): Likewise.
3313 (build_instinit_invocation): Likewise.
3314 (ctors_unchecked_throws_clause_p): Likewise.
3315 (add_instance_initializer): Deleted.
3316 (build_instance_initializer): Likewise.
3317 (in_instance_initializer): Likewise.
3318 (check_method_redefinition): instinit$ not to be verified.
3319 (java_complete_expand_methods): Generate instinit$, simplified code.
3320 (build_dot_class_method): Eliminated unnecessary locals. Use
3321 encapsulate_with_try_catch, removed unnecessary code.
3322 (fix_constructors): New local iii. Use build_instinit_invocation.
3323 (patch_method_invocation): Added comment.
3324 (maybe_use_access_method): Don't consider instinit$.
3325 (find_applicable_accessible_methods_list): Shorten the search for
3326 instinit$ too.
3327 (java_complete_lhs): case INSTANCE_INITIALIZERS_EXPR removed.
3328 (patch_return): Use DECL_INSTINIT_P instead of in_instance_initializer.
3329 (patch_throw_statement): Likewise. Fixed typo.
3330
3331 2001-08-12 David Edelsohn <edelsohn@gnu.org>
3332
3333 Revert:
3334 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3335 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
3336 ASM_FINAL_SPEC.
3337 (lang_specific_pre_link): Use set_input to set input_filename.
3338 Append `main' here.
3339 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
3340 (main): Fix definition.
3341 Strip `main' from classname.
3342 Fixes PR java/227.
3343
3344 2001-08-11 Zack Weinberg <zackw@panix.com>
3345
3346 * lex.h: Don't include setjmp.h. Don't define
3347 SET_FLOAT_HANDLER or prototype set_float_handler.
3348
3349 2001-08-09 Alexandre Petit-Bianco <apbianco@redhat.com>
3350
3351 * expr.c (java_lang_expand_expr): Call `expand_end_bindings' and
3352 `poplevel' in the right order.
3353
3354 2001-08-09 Richard Henderson <rth@redhat.com>
3355
3356 * Make-lang.in (class.o): Depend on TARGET_H.
3357 * class.c (emit_register_classes): Use target hooks instead of
3358 assemble_constructor and assemble_destructor.
3359
3360 2001-08-08 Alexandre Petit-Bianco <apbianco@redhat.com>
3361
3362 * check-init.c (flags.h): Include
3363 (check_init): Don't report uninitialized static class
3364 initialization flags, don't free bit index when doing static class
3365 initialization optimization.
3366 (check_for_initialization): Return type changed to `unsigned int.'
3367 (attach_initialized_static_class): New function.
3368 * class.c (add_method_1): Create the initialized static class
3369 table if necessary.
3370 (finish_class): Always emit deferred inline methods.
3371 * decl.c (emit_init_test_initialization): Moved to expr.c
3372 (complete_start_java_method): Don't traverse
3373 DECL_FUNCTION_INIT_TEST_TABLE.
3374 (lang_mark_tree): Mark hash tables in function decls.
3375 * expr.c (emit_init_test_initialization): Moved from decl.c.
3376 (build_class_init): Create LAG_DECL_SPECIFIC for the static class
3377 initialization flag, set DECL_CONTEXT and
3378 LOCAL_CLASS_INITIALIZATION_FLAG.
3379 (java_lang_expand_expr): Emit initialization code for static class
3380 initialized flags when entering block, if necessary.
3381 * gcj.texi (-fno-optimize-static-class-initialization): Documented.
3382 * java-tree.h (flag_optimize_sci): New global variable declaration.
3383 (DECL_FUNCTION_INITIALIZED_CLASS_TABLE): New macro.
3384 (DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND): Likewise.
3385 (LOCAL_FINAL_P): Fixed typo in comment.
3386 (FINAL_VARIABLE_P): Likewise.
3387 (LOCAL_CLASS_INITIALIZATIO_FLAG): New macro.
3388 (LOCAL_CLASS_INITIALIZATIO_FLAG_P): Likewise.
3389 (struct lang_decl): New fields `ict', `smic' and `cif.'
3390 (check_for_initialization): New returned value for global.
3391 (attach_initialized_static_class): New global function.
3392 (STATIC_CLASS_INIT_OPT_P): New macro.
3393 * lang-options.h (-fno-optimize-static-class-initialization): New flag.
3394 * lang.c (java_decode_option): Handle
3395 `-fno-optimize-static-class-initialization'
3396 * parse.y (start_complete_expand_method): New function.
3397 (java_expand_method_bodies): Likewise.
3398 (attach_init_test_initialization_flags): Likewise.
3399 (adjust_init_test_initialization): Likewise.
3400 (emit_test_initialization): Likewise.
3401 (java_complete_expand_methods): Nullify abstract and native method
3402 bodies.
3403 (java_complete_expand_method): New locals `fbody', `block_body'
3404 and `exception_copy.' Reorganized: directly return on empty method
3405 bodies, call `start_complete_expand_method', remember definitely
3406 initialized static class in function, don't expand method bodies.
3407 (java_expand_classes): Call `java_expand_method_bodies' before
3408 `finish_class' when compiling to native.
3409 (resolve_expression_name): Use `orig' after building outer class
3410 field access.
3411 (patch_invoke): Remember static method invokations.
3412
3413 2001-08-06 Richard Henderson <rth@redhat.com>
3414
3415 * class.c (emit_register_classes): Pass a symbol_ref and priority
3416 to assemble_constructor.
3417
3418 2001-08-02 Alexandre Petit-Bianco <apbianco@redhat.com>
3419
3420 * java-tree.h (all_class_filename): New macro.
3421 (enum java_tree_index): New enum `JTI_ALL_CLASS_FILENAME.'
3422 (BUILD_FILENAME_IDENTIFIER_NODE): Fixed leading comment. Link
3423 newly created IDENTIFIER_NODE to `all_class_filename.'
3424
3425 2001-08-01 Jeff Sturm <jsturm@one-point.com>
3426
3427 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE):
3428 Use ggc_add_tree_root to register roots.
3429
3430 2001-07-31 Alexandre Petit-Bianco <apbianco@redhat.com>
3431
3432 * check-init.c (check_init): WITH_CLEANUP_EXPR node to use its
3433 second operand calling check_init.
3434 * decl.c (complete_start_java_method): Swaped second and third
3435 arguments while creating WITH_CLEANUP_EXPR node.
3436 * jcf-write.c (generate_bytecode_insns): Use second operand
3437 instead of third when handling WITH_CLEANUP_EXPR.
3438 * parse.y (java_complete_lhs): Expand second operand of
3439 WITH_CLEANUP_EXPR nodes.
3440 (patch_synchronized_statement): Swaped second and third arguments
3441 while creating WITH_CLEANUP_EXPR node.
3442
3443 2001-07-18 Alexandre Petit-Bianco <apbianco@redhat.com>
3444
3445 * parse.y (create_interface): Avoid cyclic inheritance report when
3446 syntax error encountered during class definition.
3447 Fixes PR java/2956
3448
3449 2001-08-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
3450
3451 * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks
3452 ASM_FINAL_SPEC.
3453 (lang_specific_pre_link): Use set_input to set input_filename.
3454 Append `main' here.
3455 * jvgenmain.c (usage): Append literal `main' to CLASSNAME.
3456 (main): Fix definition.
3457 Strip `main' from classname.
3458 Fixes PR java/227.
3459
3460 2001-07-18 Tom Tromey <tromey@redhat.com>
3461
3462 For PR java/2812:
3463 * lex.h: Use HAVE_ICONV, not HAVE_ICONV_H.
3464 * lex.c (java_new_lexer): Use ICONV_CONST.
3465 (java_read_char): Likewise.
3466 * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
3467 (jv-scan$(exeext)): Likewise.
3468
3469 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
3470
3471 * parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
3472 * parse.y (check_class_interface_creation): Allow `private' if the
3473 enclosing is not an interface.
3474 (create_interface): Interface tagged public if the enclosing
3475 context is an interface.
3476 (create_class): Class tagged public if the enclosing context
3477 is an interface.
3478 Fixes PR java/2959
3479
3480 2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
3481
3482 * class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
3483 Fixes PR java/2665
3484
3485 2001-07-14 Tim Josling <tej@melbpc.org.au>
3486
3487 * check-init.c (check_init): Remove references to EXPON_EXPR.
3488
3489 2001-07-13 Alexandre Petit-Bianco <apbianco@redhat.com>
3490
3491 * parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
3492 TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
3493 Fixes PR java/3602
3494
3495 2001-07-13 Tom Tromey <tromey@redhat.com>
3496
3497 * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
3498 invocation.
3499
3500 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
3501
3502 * parse.y (patch_method_invocation): Don't override primary if one
3503 is already provided, but let this$<n> be built. Fixed comment.
3504
3505 2001-07-12 Alexandre Petit-Bianco <apbianco@redhat.com>
3506
3507 * parse.y (empty_statement:): Report empty statement error only
3508 when found at class declaration level.
3509 Fixes PR java/3635
3510
3511 2001-07-12 Tom Tromey <tromey@redhat.com>
3512
3513 * expr.c (expand_load_internal): New function.
3514 (LOAD_INTERNAL): Use it.
3515
3516 2001-07-11 Alexandre Petit-Bianco <apbianco@redhat.com>
3517
3518 * parse.y (verify_constructor_super): Compare anonymous class ctor
3519 args with `valid_method_invocation_conversion_p.'
3520 Fixes PR java/3285
3521
3522 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
3523
3524 * lang-specs.h: Forbit the use if `-femit-class-file{s}' without
3525 `-fsyntax-only.' Fixes PR java/3248
3526
3527 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
3528
3529 * jcf-io.c (find_class): Clarified error message. Fixes PR java/2603
3530
3531 2001-07-10 Alexandre Petit-Bianco <apbianco@redhat.com>
3532
3533 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): No `this' is fine if the
3534 current function is static. Fixes PR java/1970
3535
3536 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
3537
3538 * parse.y (patch_method_invocation): Add enclosing context to ctor
3539 calls if necessary. Fixes PR java/2953
3540
3541 2001-07-09 Alexandre Petit-Bianco <apbianco@redhat.com>
3542
3543 * parse.y (resolve_package): Abort if qualified expression member
3544 isn't right.
3545 (qualify_ambiguous_name): Don't qualify as type if `this' in use.
3546 Fixes PR java/1391
3547
3548 2001-07-07 Zack Weinberg <zackw@stanford.edu>
3549
3550 * verify.c: Don't use // comments.
3551
3552 2001-07-05 Tom Tromey <tromey@redhat.com>
3553
3554 * lang.c (flag_assume_compiled): Removed.
3555 * java-tree.h (flag_assume_compiled): Removed.
3556 * lang-options.h: Removed -ffile-list-file, -fuse-boehm-gc,
3557 -fhash-synchronization, -fuse-divide-subroutine,
3558 -fcheck-references, -femit-class-file, -femit-class-files,
3559 -fassume-compiled. Updated --encoding information. Changed
3560 -foutput-class-dir to `-d'.
3561
3562 2001-07-04 Daniel Berlin <dan@cgsoftware.com>
3563
3564 * jcf-parse.c (parse_class_file): Add lineno parameter to
3565 debug_start_source_file call.
3566
3567 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
3568
3569 * gcj.texi: Use gpl.texi.
3570 * Make-lang.in ($(srcdir)/java/gcj.info, java/gcj.dvi): Update
3571 dependencies and use doc/include in search path.
3572
3573 2001-07-03 Jeff Sturm <jsturm@one-point.com>
3574
3575 * parse.y (fix_constructors): Test if a CALL_EXPR invokes
3576 `this'. If so, don't build instance initializers.
3577
3578 2001-07-03 Alexandre Petit-Bianco <apbianco@redhat.com>
3579
3580 * parse.y (resolve_expression_name): Improved error message for
3581 inner class cases. Fixes PR java/1958
3582
3583 2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
3584
3585 * lang.c: #include diagnostic.h
3586 (lang_print_error): Add a `diagnostic_context *' parameter.
3587 (java_dummy_print): Likewise.
3588 * Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
3589
3590 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
3591
3592 * jcf-parse.c (gcc_mark_jcf): Test for a finished JCF.
3593 * jcf.h (typedef struct JCF): New bitfield `finished.'
3594 (JCF_FINISH): Set `finished.'
3595 (JCF_ZERO): Reset `finished.'
3596 Fixes PR java/2633
3597
3598 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
3599
3600 * parse.y (class_body_declaration:): Don't install empty instance
3601 initializers.
3602 Fixes PR java/1314
3603
3604 2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
3605
3606 * class.c (set_super_info): Call `set_class_decl_access_flags.'
3607 (set_class_decl_access_flags): New function.
3608 * java-tree.h (set_class_decl_access_flags): New prototype.
3609 * jcf-parse.c (handle_innerclass_attribute): Read and set access flags.
3610 (parse_class_file): New local `decl_max_locals.' Take wide types
3611 into account to compute DECL_MAX_LOCALS.
3612 * parse.y (type_import_on_demand_declaration:): Ignore duplicate
3613 imports on demand.
3614
3615 2001-06-22 Jan van Male <jan.vanmale@fenk.wau.nl>
3616
3617 * zipfile.h: Use GCC_JCF_H instead of JCF_H.
3618
3619 2001-06-20 Alexandre Petit-Bianco <apbianco@redhat.com>
3620
3621 * class.c (java_hash_tree_node): Fixed indentation in leading comment.
3622 * parse.y (do_resolve_class): Moved comments out to leading comment
3623 section. Removed local `start', New local `_ht' and
3624 `circularity_hash.' Record `enclosing' in hash table and search
3625 it to detect circularity. Use `enclosing' as an argument to
3626 `lookup_cl.' Free the hash table when done.
3627
3628 2001-06-19 Tom Tromey <tromey@redhat.com>
3629
3630 * lex.c (java_read_char): Disallow invalid and overlong
3631 sequences. Fixes PR java/2319.
3632
3633 2001-06-05 Jeff Sturm <jsturm@one-point.com>
3634
3635 * decl.c (create_primitive_vtable): Don't call make_decl_rtl.
3636
3637 2001-06-04 Alexandre Petit-Bianco <apbianco@redhat.com>
3638
3639 * expr.c (force_evaluation_order): Match wrapped ctor calls, locate
3640 arguments accordingly.
3641
3642 2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
3643
3644 * gcj.texi: Move contents to just after title page.
3645
3646 2001-06-01 Alexandre Petit-Bianco <apbianco@redhat.com>
3647
3648 * parse.y (type_literals:): Use `build_incomplete_class_ref' with
3649 builtin type.
3650 (patch_incomplete_class_ref): Build the class ref, build the class
3651 init if necessary, complete the tree.
3652 Fixes PR java/2605
3653
3654 2001-05-31 Alexandre Petit-Bianco <apbianco@redhat.com>
3655
3656 * parse.y (lookup_field_wrapper): Test `name' code.
3657 (resolve_qualified_expression_name): Test `qual_wfl' code.
3658 (qualify_ambiguous_name): Handle `CONVERT_EXPR', fixe indentation,
3659 handle `qual_wfl' by code.
3660 (maybe_build_primttype_type_ref): Test `wfl' code.
3661
3662 2001-05-23 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
3663
3664 * Make-lang.in ($(srcdir)/java/gcj.info): Added dependencies on
3665 fdl.texi.
3666 (java/gcj.dvi): Use TEXI2DVI instead of custom tex calls. Create
3667 the dvi file in the java directory.
3668
3669 2001-05-25 Sam TH <sam@uchicago.edu>
3670
3671 * gen-table.pl javaop.h jcf.h lex.h,
3672 parse.h: Fix header include guards.
3673
3674 2001-05-23 Joseph S. Myers <jsm28@cam.ac.uk>
3675
3676 * jv-scan.c (version): Update copyright year.
3677
3678 2001-05-21 Per Bothner <per@bothner.com>
3679
3680 * jcf-parse.c (read_class): If class is from .class or .zip file
3681 and it's already been read, don't push/pop parser context.
3682
3683 2001-05-18 Per Bothner <per@bothner.com>
3684
3685 * jvspec.c (lang_specific_pre_link): Re-arrange the linker
3686 command line so the jvgenmain-generated main program comes first.
3687
3688 2001-05-15 Tom Tromey <tromey@redhat.com>
3689
3690 * class.c (build_utf8_ref): Don't generate identifier based on
3691 utf8const contents.
3692
3693 2001-05-12 Richard Henderson <rth@redhat.com>
3694
3695 * java-tree.def (JAVA_EXC_OBJ_EXPR): New.
3696 * expr.c (java_lang_expand_expr): Expand it.
3697 (process_jvm_instruction): Build JAVA_EXC_OBJ_EXPR instead of
3698 calling build_exception_object_ref.
3699 * parse.y (catch_clause_parameter): Likewise.
3700 (build_dot_class_method): Likewise.
3701 (try_reference_assignconv): Likewise.
3702 * check-init.c (check_init): Check JAVA_EXC_OBJ_EXPR not EXC_PTR_EXPR.
3703 * jcf-write.c (generate_bytecode_insns): Likewise.
3704
3705 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
3706
3707 * parse.y (build_unresolved_array_type): Set
3708 EXPR_WFL_QUALIFICATION on the newly created wfl.
3709 Fixes PR java/2538. Fixes PR java/2535.
3710
3711 2001-05-07 Alexandre Petit-Bianco <apbianco@redhat.com>
3712
3713 * parse.y (fix_constructors): Removed unnecessary assignment to
3714 local. Moved assignment to `this$<n>', fixed comments and
3715 indentation.
3716 (build_wfl_wrap): Fixed indentation.
3717 Fixes PR java/2598, java/2579 and java/2658.
3718
3719 2001-05-03 Mo DeJong <mdejong@redhat.com>
3720
3721 * lex.c (java_new_lexer): Call iconv_close on temp handle used to
3722 check for byte swap.
3723
3724 2000-05-02 Jeff Sturm <jsturm@one-point.com>
3725
3726 * expr.c (build_class_init): Move MODIFY_EXPR
3727 outside of COND_EXPR. Remove variable `call'.
3728
3729 2001-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3730
3731 * decl.c: NULL_PTR -> NULL.
3732 * jcf-write.c: Likewise.
3733
3734 2001-05-01 Tom Tromey <tromey@redhat.com>
3735
3736 * Make-lang.in ($(srcdir)/java/gcj.info): Added `-I..'.
3737 (java/gcj.dvi): Added $(srcdir) to TEXINPUTS.
3738 * gcj.texi: Updated copyright text. Include fdl.texi.
3739 (Top): Link to new node.
3740
3741 2001-05-01 Per Bothner <per@bothner.com>
3742
3743 * parse.h (REGISTER_IMPORT): Use tree_cons instead of chainon.
3744
3745 2001-05-01 Per Bothner <per@bothner.com>
3746
3747 * parse.y (java_pop_parser_context): The TREE_VALUE of a link in the
3748 import_list contains the name, not the TREE_PURPOSE.
3749
3750 2001-04-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3751
3752 * jcf-io.c (read_zip_member): Cast to long in comparison with
3753 signed value.
3754
3755 * jvspec.c (lang_specific_driver): Initialize variables.
3756
3757 * mangle.c (find_compression_record_match): Likewise.
3758
3759 * typeck.c (build_null_signature): Provide static prototype. Mark
3760 parameter with ATTRIBUTE_UNUSED.
3761
3762 * verify.c (verify_jvm_instructions): Initialize variable.
3763
3764 2001-04-27 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3765
3766 * parse.y (do_resolve_class): Check for cyclic inheritance during
3767 inner class resolution.
3768
3769 2001-04-27 Per Bothner <per@bothner.com>
3770
3771 * parse.y (java_expand_classes): Don't change ctxp_for_generation
3772 while iterating, since that could cause gc to lose stuff.
3773
3774 2001-04-26 Per Bothner <per@bothner.com>
3775
3776 Fix method search wrt scope of inner classes to match JLS2.
3777 * typeck.c (build_null_signature): New static function.
3778 (has_method): New function. Uses build_null_signature and lookup_do.
3779 * java-tree.h (has_method): New declaration.
3780 * parse.y (find_applicable_accessible_methods_list): Do not search
3781 context of inner classes here.
3782 (patch_method_invocation): Search scope, ie. current and outer clases,
3783 for method matching simple name, to find class.
3784
3785 2001-04-26 Per Bothner <per@bothner.com>
3786
3787 * jcf-write.c (generate_bytecode_insns case SWITCH_EXPR):
3788 Fix thinko: If a single case, use if_icmpeq, not ifeq.
3789
3790 * constants.c (find_methodref_with_class_index): New function.
3791 (find_methodref_index): Use find_methodref_with_class_index.
3792 * java-tree.h (find_methodref_with_class_index): New declaration.
3793 * jcf-write.c (generate_bytecode_insns case CALL_EXPR): Don't change
3794 DECL_CONTEXT, instead use new find_methodref_with_class_index function.
3795 If context changed from interface to class, don't use invokeinterface.
3796
3797 2001-04-25 Per Bothner <per@bothner.com>
3798
3799 * verify.c (verify_jvm_instructions): For field instructions,
3800 check that field index is valid. For invoke instructions, check that
3801 method index is valid.
3802
3803 2001-04-25 Alexandre Oliva <aoliva@redhat.com>
3804
3805 * config-lang.in (target_libs): Copy from $libgcj_saved.
3806
3807 2001-04-25 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
3808
3809 * decl.c (init_decl_processing): Add new class "protectionDomain"
3810 field.
3811 * class.c (make_class_data): Set initial value for "protectionDomain".
3812
3813 2001-04-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3814
3815 * jvspec.c (lang_specific_driver): Fix memory allocation
3816 deficit, by using concat in lieu of xmalloc/sprintf.
3817
3818 2001-04-20 Per Bothner <per@bothner.com>
3819
3820 Fixes to compile multiple .class files at once.
3821 * decl.c (init_decl_processing): Don't set CLASS_LOADED_P.
3822 * java-tree.h (CLASS_PARSED_P): New macro.
3823 (CLASS_LOADED_P): Re-define to use TYPE_SIZE and CLASS_PARSED_P.
3824 * jcf-parse.c (jcf_parse_source): Inline into read_class.
3825 (read_class): Avoid some code duplication.
3826 Don't call JCF_FINISH for a .class file - might be needed later.
3827 (jcf_parse): Don't call layout_class here. Check/set CLASS_PARSED_P
3828 rather than CLASS_LOADED_P, since latter implies class laid out.
3829 (yyparse): Do layout_class and JCF_FINISh here instead, in pass 2.
3830 * parse.y: Don't need to set CLASS_LOADED_P for array types.
3831
3832 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3833
3834 * Make-lang.in (java/boehm.o): Depend on toplev.h.
3835
3836 * boehm.c: Include toplev.h.
3837
3838 2001-04-06 Tom Tromey <tromey@redhat.com>
3839 Alexandre Petit-Bianco <apbianco@redhat.com>
3840
3841 Fix for PR gcj/1404 and PR gcj/2332:
3842 * parse.y (build_array_from_name): If we use the type_wfl then
3843 accumulate dimensions from the original type as well.
3844 (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
3845
3846 2001-04-06 Tom Tromey <tromey@redhat.com>
3847
3848 * parse.y (analyze_clinit_body): Return true if the second operand
3849 of a METHOD_EXPR is nonzero.
3850
3851 2001-04-06 Tom Tromey <tromey@redhat.com>
3852
3853 * Make-lang.in ($(srcdir)/java/parse-scan.c): Run bison from build
3854 directory.
3855 ($(srcdir)/java/parse.c): Likewise.
3856
3857 2001-04-05 Alexandre Petit-Bianco <apbianco@redhat.com>
3858
3859 * gcj.texi: Use `which-gcj' instead of `which-g77.'
3860 (version-gcc): Initialized.
3861 (which-gcj): Likewise.
3862
3863 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
3864
3865 * java-tree.h (struct lang_decl): New macro
3866 `DECL_FIXED_CONSTRUCTOR_P.' New field `fixed_ctor.'
3867 * parse.y (build_instance_initializer): New function.
3868 (add_instance_initializer): Use it.
3869 (java_fix_constructors): Set `current_class' before fix pass.
3870 (fix_constructors): Just return if already fixed. Move `super()'
3871 invokation ahead. Use `build_instance_initializer.'
3872 Fixes PR java/1315.
3873
3874 2001-04-04 Alexandre Petit-Bianco <apbianco@redhat.com>
3875
3876 * parse.y (resolve_qualified_expression_name): Pass field's
3877 DECL_CONTEXT to `not_accessible_p.'
3878 (not_accessible_p): Changed parameters order in `inherits_from_p'
3879 invokation.
3880
3881 2001-03-27 Andrew Haley <aph@cambridge.redhat.com>
3882
3883 * lang-options.h: Add flag_check_references.
3884
3885 2001-04-04 Per Bothner <per@bothner.com>
3886
3887 * java-tree.h (CONSTANT_VALUE_P): New macro.
3888 * jcf-write.c (generate_classfile): Use CONSTANT_VALUE_P.
3889 * parse.y (maybe_build_class_init_for_field): New static function.
3890 (resolve_expression_name, resolve_field_access): Use
3891 maybe_build_class_init_for_field instead of build_class_init
3892 This does not do the init if the field is compile-time-constant.
3893 (resolve_field_access): Simplify.
3894
3895 * parse.y (fold_constant_for_init): Merge test into switch.
3896
3897 2001-04-03 Zack Weinberg <zackw@stanford.edu>
3898
3899 * Make-lang.in (buffer.o, check-init.o, class.o): Don't depend
3900 on gansidecl.h.
3901 * buffer.c, jvgenmain.c: Don't include gansidecl.h.
3902
3903 2001-04-02 Zack Weinberg <zackw@stanford.edu>
3904
3905 * expr.c (pop_type_0): Save the result of the first
3906 lang_printable_name call in a scratch buffer, so it
3907 won't be clobbered by the second call.
3908
3909 2001-03-30 Alexandre Petit-Bianco <apbianco@redhat.com>
3910
3911 * parse-scan.y (array_type:): Rewritten.
3912 (type_declaration:): `empty_statement' replaces `SC_TK.'
3913 (class_member_declaration:): `empty statement' added.
3914 (method_body:): Simplified.
3915 (static_initializer:): Likewise.
3916 (primary_no_new_array:): Use `type_literals.'
3917 (type_literals:): New rule.
3918 (dims:): Set and update `bracket_count.'
3919 Fixes PR java/1074. Fixes PR java/2412.
3920
3921 2001-03-28 Hans Boehm <boehm@acm.org>
3922
3923 * boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Set to use `build_int_2.'
3924 (get_boehm_type_descriptor): Set type on returned value to be a
3925 pointer length integer.
3926
3927 2001-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3928
3929 * expr.c (pop_type_0): Call `concat' rather than building the
3930 string manually.
3931 (pop_type): Add format specifier in call to `error'.
3932
3933 * parse.y (patch_method_invocation): Avoid casting away
3934 const-ness.
3935
3936 2001-03-28 Jeffrey Oldham <oldham@codesourcery.com>
3937
3938 * jvgenmain.c (do_mangle_classname): End string constant with '\0'.
3939
3940 2001-03-28 Richard Henderson <rth@redhat.com>
3941
3942 IA-64 ABI Exception Handling:
3943 * Make-lang.in (except.o): Don't depend on eh-common.h.
3944 * check-init.c (check_init): Handle EXC_PTR_EXPR.
3945 * decl.c (init_decl_processing) [throw_node]: No _Jv_Sjlj_Throw.
3946 [soft_exceptioninfo_call_node]: Remove.
3947 [eh_personality_libfunc, lang_eh_runtime_type]: New.
3948 (end_java_method): No emit_handlers.
3949 * except.c (java_set_exception_lang_code): Remove.
3950 (method_init_exceptions): Don't call it.
3951 (prepare_eh_table_type): No CATCH_ALL_TYPE.
3952 (build_exception_object_ref): New.
3953 (expand_end_java_handler): Update for except.h name changes.
3954 (emit_handlers, expand_resume_after_catch): Remove.
3955 * expr.c (java_lang_expand_expr): Update for except.h name changes.
3956 (process_jvm_instruction): Use build_exception_object_ref.
3957 * java-tree.h (JTI_SOFT_EXCEPTIONINFO_CALL_NODE): Remove.
3958 (soft_exceptioninfo_call_node): Remove.
3959 (build_exception_object_ref): Declare.
3960 * jcf-write.c (generate_bytecode_insns) [CALL_EXPR]: No
3961 soft_exceptioninfo_call_node. Move processing ...
3962 [EXC_PTR_EXPR]: ... here.
3963 * parse.h (BUILD_ASSIGN_EXCEPTION_INFO): Remove dead code.
3964 * parse.y (catch_clause_parameter): Use build_exception_object_ref.
3965 (source_end_java_method): No java_set_exception_lang_code or
3966 emit_handlers.
3967 (build_dot_class_method): Use build_exception_object_ref.
3968 (try_reference_assignconv): Check EXC_PTR_EXPR not
3969 soft_exceptioninfo_call_node.
3970
3971 2001-03-28 Richard Henderson <rth@redhat.com>
3972
3973 * java-tree.h (throw_node): Define as a single member of
3974 java_global_trees instead of a separate array.
3975 (JTI_THROW_NODE): New.
3976 * decl.c (throw_node): Don't declare.
3977 (init_decl_processing): Init a scalar throw_node.
3978 Don't register it for gc.
3979 * check-init.c (check_init): Reference scalar throw_node.
3980 * expr.c (build_java_athrow): Likewise.
3981 * jcf-write.c (generate_bytecode_insns): Likewise.
3982 * parse.h (BUILD_THROW): Likewise.
3983
3984 2001-03-28 Richard Henderson <rth@redhat.com>
3985
3986 * decl.c (end_java_method): Do not save and restore
3987 flag_non_call_exceptions.
3988 * parse.y (source_end_java_method): Likewise.
3989 * lang.c (flag_exceptions): Don't declare.
3990 (java_init_options): Set flag_non_call_exceptions. Set
3991 flag_exceptions here ...
3992 (java_init): ... not here.
3993
3994 2001-03-27 Richard Henderson <rth@redhat.com>
3995
3996 * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
3997 exceptions_via_longjmp.
3998
3999 * lang.c (flag_new_exceptions): Don't declare it.
4000 (java_init_options): Or set it.
4001
4002 2001-03-27 Richard Henderson <rth@redhat.com>
4003
4004 * decl.c (end_java_method): Rename asynchronous_exceptions to
4005 flag_non_call_exceptions.
4006 * parse.y (source_end_java_method): Likewise.
4007
4008 2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4009
4010 * Make-lang.in: Depend on $(SYSTEM_H), not system.h.
4011
4012 2001-03-26 Mark Mitchell <mark@codesourcery.com>
4013
4014 * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE.
4015
4016 2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com>
4017
4018 * parse.y (find_as_inner_class): Follow current package
4019 indications not to mistakingly load an unrelated class.
4020
4021 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4022
4023 * constants.c (PUTN): Use memcpy, not bcopy.
4024
4025 * lex.c (java_read_char): Use memmove, not bcopy.
4026
4027 * parse.y (java_parser_context_resume): Use memcpy, not bcopy.
4028
4029 2001-03-23 Per Bothner <per@bothner.com>
4030
4031 * verify.c (verify_jvm_instructions): Replace 3 pop_type by POP_TYPE
4032 macro for better error pin-pointing.
4033 * java-tree.h: Fix typo in comment.
4034
4035 * jcf-write.c (generate_bytecode_insns): Changes to TRY_FINALLY_EXPR.
4036 Don't include jsr/goto in exception range.
4037 Check if start and end of exception range are the same (also TRY_EXPR).
4038 Don't emit jsr after try_block if CAN_COMPLETE_NORMALLY is false.
4039 However, do emit the following goto even if try_block is empty.
4040 Defer freeing exception_decl until after the finalizer, to make
4041 sure the local isn't reused in the finalizer. Fixes PR java/1208.
4042
4043 * parse.y (java_complete_lhs): If the try-clause is empty, just
4044 return the finally-clause and vice versa.
4045
4046 2001-03-23 Alexandre Petit-Bianco <apbianco@redhat.com>
4047
4048 * gcj.texi (Input Options): documented the check for attribute
4049 `gnu.gcc.gccj-compiled' and the `-fforce-classes-archive-check' flag.
4050 * java-tree.h (flag_force_classes_archive_check): Declared extern.
4051 * jcf-parse.c (HANDLE_GCJCOMPILED_ATTRIBUTE): New macro.
4052 (jcf_parse): Check for the right classes archive if necessary.
4053 * jcf-reader.c (get_attribute): Define `MATCH_ATTRIBUTE' and use it.
4054 (jcf_parse_fields): Fixed indentation.
4055 * jcf-write.c (append_gcj_attribute): New function.
4056 (generate_classfile): Compute the attribute count, invoke
4057 `append_gcj_attribute'.
4058 * jcf.h (typedef struct JCF): `seen_in_zip' and `java_source'
4059 turned into bit-fields. New bit-field `right_zip.'
4060 (JCF_ZERO): Set `right_zip' to zero.
4061 * lang-options.h (-fforce-classes-archive-check): Added flag.
4062 * lang.c (flag_force_classes_archive_check): New flag.
4063 (lang_f_options): New entry `force-classes-archive-check.'
4064 Fixes PR java/1213.
4065
4066 2001-02-07 Andrew Haley <aph@redhat.com>
4067
4068 * gcj.texi (Configure-time Options): Add -fcheck-references.
4069 * expr.c (build_java_indirect_ref): New function.
4070 (java_check_reference): New function.
4071 (build_java_array_length_access): Use build_java_indirect_ref to
4072 check for null references.
4073 (build_java_arrayaccess): Likewise.
4074 (build_get_class): Likewise.
4075 (build_field_ref): Likewise.
4076 (invoke_build_dtable): Likewise.
4077 (build_invokeinterface): Likewise.
4078 * lang.c (lang_f_options): Add flag_check_references.
4079 * jvspec.c (jvgenmain_spec): Add flag_check_references.
4080 * java-tree.h (flag_check_references): New variable.
4081 * lang.c (flag_check_references): Likewise.
4082 * parse.y (patch_invoke): Use java_check_reference.
4083 (patch_assignment): Allow for extra nesting in
4084 _Jv_CheckArrayStore.
4085
4086 2001-03-23 Bryce McKinlay <bryce@albatross.co.nz>
4087
4088 * gjavah.c (cxx_keywords): Update from the definitive list in cp/lex.c.
4089 * lex.c (cxx_keywords): Likewise.
4090
4091 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
4092
4093 * parse.y (qualify_ambiguous_name): Broaden `length'
4094 recognition. Help MODIFY_EXPR be resolved as expression names.
4095 Fixes PR java/2066. Fixes PR java/2400.
4096
4097 2001-03-21 Bryce McKinlay <bryce@albatross.co.nz>
4098
4099 * gjavah.c (process_file): Mark interface definitions with
4100 "__attribute__ ((java_interface))".
4101
4102 2001-03-21 Alexandre Petit-Bianco <apbianco@redhat.com>
4103
4104 * class.c (layout_class): Fixed push_super_field's second
4105 argument. Fixes PR java/2333.
4106 (jdep_resolve_class): Reset TYPE_SIZE if `error_mark_node', it's
4107 too early to lay innerclasses out.
4108
4109 2001-03-20 Tom Tromey <tromey@redhat.com>
4110 Alexandre Petit-Bianco <apbianco@redhat.com>
4111
4112 * parse.y (patch_assignment): Handle the case of a SAVE_EXPR
4113 inside an array reference. Insertion of the array store check
4114 rewritten. Fixes PR java/2299.
4115
4116 2001-03-20 Tom Tromey <tromey@redhat.com>
4117
4118 * lex.c (java_read_unicode): Only accept leading `u's.
4119
4120 2001-03-20 Tom Tromey <tromey@redhat.com>
4121
4122 * jcf-parse.c (read_class): Initialize `class'.
4123
4124 2001-03-20 Matt Kraai <kraai@alumni.carnegiemellon.edu>
4125
4126 * jcf_parse.c (jcf_parse): Eliminate unused variable.
4127
4128 2001-03-19 Mark Mitchell <mark@codesourcery.com>
4129
4130 * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME.
4131 (layout_class): Likewise.
4132 (layout_class_method): Likewise.
4133 (emit_register_classes): Likewise.
4134 * decl.c (builtin_function): Likewise.
4135 (give_name_to_locals): Likewise.
4136
4137 2001-03-19 Per Bothner <per@bothner.com>
4138
4139 * jcf-parse.c (load_inner_classes): Check CLASS_LOADED_P
4140 before trying to load an inner class.
4141
4142 Fixes to process to command-line .class files in two passes.
4143 * java-tree.h (JAVA_FILE_P, CLASS_FILE_P, ZIP_FILE_P): New flags.
4144 (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P): Rename to ..
4145 (CLASS_FROM_CURRENTLY_COMPILED_P): ... because it is more general now.
4146 * class.c (is_compiled_class): Fix for renamed flag.
4147 * parse.y (maybe_create_class_interface_decl): Likewise.
4148 * jcf-parse.c (yyparse): Also set if compiling .class files.
4149 * jcf-parse.c (read_class); Read current_class.
4150 (jcf_parse): Make static.
4151 (load_inner_classes): New function, with code moved from jcf_parse,
4152 because we need to inner classes after the command-line files are read.
4153 (yyparse): Set finput to NULL when it doesn't need to be closed.
4154 Reduce use of main_jcf (basically only for archive) and
4155 use finput instead of main_jcf->read_state.
4156 Inline jcf_figure_file_type into yyparse.
4157 Set JAVA_FILE_P, CLASS_FILE_P, or ZIP_FILE_P on filename list name.
4158 Defer load_inner_classes and parse_class_file to a second pass,
4159 after we've correctly mapped command-line .clas fiels to classes.
4160 (jcf_figure_file_type): Removed.
4161 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): Removed flags.
4162 (JCF_ZERO): Also clear zipd field.
4163 * zipfile.h: Conditionalize on JCF_H insread of JCF_ZIP.
4164
4165 2001-03-18 Matt Kraai <kraai@alumni.carnegiemellon.edu>
4166
4167 * jcf-parse.c (yyparse): Change ch from char * to char.
4168
4169 2001-03-19 Per Bothner <per@bothner.com>
4170
4171 * jvspec.c (lang_specific_driver): Check for .zip and .jar files.
4172 Add constructed filelist-file at end, following -xjava. Thus any .o
4173 and library files are not affected by the -xjava. Also wrap
4174 explicit @FILE with -xjava and -xnone.
4175
4176 2001-03-19 Andrew Haley <aph@cambridge.redhat.com>
4177
4178 * class.c (build_static_field_ref): Call make_decl_rtl() after
4179 setting the DECL_EXTERNAL flag.
4180
4181 2001-03-17 Per Bothner <per@bothner.com>
4182
4183 * decl.c (clear_binding_level): Fix initializer (broke 03-15).
4184
4185 * jcf-write.c (generate_bytecode_insns): Handle emitting iinc
4186 when result is is needed (target is STACK_TARGET).
4187
4188 * parse.h (JDEP_SOLV): Removed.
4189 * parse.y (register_incomplete_type): Use JDEP_TO_RESOLVE instead.
4190
4191 * parse.y (incomplete_class_list): Removed.
4192 (obtain_incomplete_type): Don't use or set incomplete_class_list.
4193 It doesn't work if resolve_class changes the name of an array type
4194 that is on the list and then someone else looks for the modified name.
4195 Also, seems liable to break when compiling multiple source files at
4196 once. So the simplest is to just remove incomplete_class_list -
4197 it is only a minor space win and it is not even clear it saves time.
4198
4199 * parse.y (resolve_class): Remove unneeded promote_type.
4200
4201 2001-03-15 Per Bothner <per@bothner.com>
4202
4203 * java-tree.h (BLOCK_IS_IMPLICIT): New flag.
4204 * parse.h (BLOCK_EXPR_ORIGIN): Removed macro.
4205 * parse.y (declare_local_variables, maybe_absorb_scoping_blocks):
4206 Use BLOCK_IS_IMPLICIT rather than BLOCK_EXPR_ORIGIN.
4207
4208 * jcf-parse.c (yyparse): Set/reset input_filename for source file.
4209 * parse.y (java_expand_classes): Likewise.
4210
4211 * parse.y (expand_start_java_method): Was only called once and had a
4212 misleading name, so inline in caller java_complete_expand_method.
4213 (enter_a_block): Likewise inline in enter_block and remove.
4214
4215 Remove junk from when gcc/java was created (by copying from C/C++).
4216 * decl.c (keep_next_level_flag, keep_next_if_subblocks): Remove.
4217 (struct binding_level): Remove fields keep, keep_if_subblocks,
4218 more_cleanups_ok, have_cleanups (which have never been used).
4219 (pushlevel, poplevel): Remove related useless code.
4220
4221 * class.c (make_class_data): The class_dtable_decl (i.e. the
4222 vtable for Class) should be external, except when compiling Class.
4223
4224 * jvspec.c (lang_specific_driver): Fix -C handling.
4225 Check -save-temps to see if temp @FILE should be deleted.
4226 Follow-up to/fix for February 16 patch.
4227
4228 * verify.c (verify_jvm_instructions): Better error msgs for dup.
4229 (type_stack_dup): Remove no-longer neded error check.
4230
4231 2001-03-15 Bryce McKinlay <bryce@albatross.co.nz>
4232
4233 * mangle.c (mangle_record_type): Rename 'from_pointer' argument
4234 to 'for_pointer'. If this type is for a pointer (argument) mangling,
4235 don't surround the element with 'N..E' if the type name is
4236 unqualified.
4237
4238 2001-03-14 Mark Mitchell <mark@codesourcery.com>
4239
4240 * class.c (build_static_field_ref): Use COPY_DECL_RTL,
4241 DECL_RTL_SET_P, etc.
4242 (make_method_value): Likewise.
4243 (get_dispatch_table): Likewise.
4244
4245 * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
4246
4247 2001-03-07 Tom Tromey <tromey@redhat.com>
4248
4249 * config-lang.in (lang_requires): Define.
4250
4251 2001-03-07 Brad Lucier <lucier@math.purdue.edu>
4252
4253 * typeck.c (convert): Check flag_unsafe_math_optimizations,
4254 not flag_fast_math.
4255
4256 2001-03-05 Per Bothner <per@bothner.com>
4257
4258 Fix a problem where rest_of_decl_compilation applied to
4259 class_dtable_decl causes problems because it was done too early,
4260 before output file was opened.
4261 * decl.c (init_decl_processing): Remove init of class_dtable_decl.
4262 * class.c (class_dtable_decl): Add macro - element of class_roots.
4263 (make_class_data): Define class_dtable_decl.
4264 * java-tree.h (JTI_CLASS_DTABLE_DECL, class_dtable_decl): Removed.
4265
4266 2001-03-01 Zack Weinberg <zackw@stanford.edu>
4267
4268 * java/class.c, java/decl.c, java/java-tree.h: Replace all
4269 uses of 'boolean' with 'bool'.
4270
4271 2001-03-01 Zack Weinberg <zackw@stanford.edu>
4272
4273 * lang-specs.h: Add zero initializer for cpp_spec field to all
4274 array elements.
4275
4276 2001-02-16 Per Bothner <per@bothner.com>
4277
4278 Handle compiling multiple input files at once, and @FILE syntax.
4279 * gcj.texi: Updated documentation to match.
4280 * java-tree.h (flag_filelist_file, init_src_parse): New declarations.
4281 * jcf-parse.c (parse_source_file): Split into ...
4282 (parse_source_file_1): New function - and:
4283 (parse_source_file_2): New function.
4284 (yyparse): On -ffilelist-file, open and scan named file.
4285 On first pass over files, only do parse_source_file_1.
4286 A new second pass calls parse_source_file_2 for each file to compile.
4287 (init_jcf_parse): Call init_src_parse.
4288 * jvspec.c (INDIRECT_FILE_ARG): New flag.
4289 (lang_specific_driver): Support @FILELIST-FILE syntax, as well
4290 as multiple input file combined in one compilation.
4291 * lang-options.h: Add -ffilelist-file
4292 * lang.c (flag_filelist_file): New flag variable.
4293 (lang_f_options): Handle -ffilelist-file.
4294 * lex.c (java_init_lex): Don't clear ctxp->incomplete_class.
4295 * parse.h (struct parse_ctxt): Remove fields incomplete_class and
4296 gclass_list - use global fields of src_parse_roots instead.
4297 * parse.y (src_parse_roots): New array.
4298 (incomplete_class_list, gclass_list): New macros.
4299 (push_parser_context, java_pop_parser_context,
4300 java_parser_context_resume): Don't fiddle with deleted fields.
4301 (various): Use incomplete_class gclass_list and global macros
4302 instead of parse_ctxt fields - the lists are global.
4303 (init_src_parse): New function.
4304
4305 2001-02-23 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4306
4307 * decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
4308
4309 2001-02-20 Alexandre Petit-Bianco <apbianco@redhat.com>
4310
4311 * parse.y (check_inner_class_access): Moved declaration of local
4312 `enclosing_decl_type' to the right location.
4313
4314 2001-02-19 Bryce McKinlay <bryce@albatross.co.nz>
4315
4316 * parse.y (parser_check_super_interface): Don't call
4317 check_pkg_class_access for an inner interface.
4318 (parser_check_super): Don't call check_pkg_class_access for inner
4319 class.
4320 (do_resolve_class): Simplify enclosing type loop. Don't call
4321 check_pkg_class_access if CL and DECL are not set.
4322 (find_in_imports_on_demand): Set DECL if class_type needed to be
4323 loaded. Don't call check_pkg_class_access for an inner class.
4324 (check_inner_class_access): Rewritten to implement member access
4325 rules as per spec 6.6.1.
4326 (check_pkg_class_access): Handle the empty package correctly.
4327 (in_same_package): New function. Determine if two classes are in the
4328 same package.
4329
4330 2001-02-18 Bryce McKinlay <bryce@albatross.co.nz>
4331
4332 * typeck.c (build_java_array_type): Don't try to poke a public `clone'
4333 method into array types.
4334 * parse.y (patch_method_invocation): Bypass access check on clone call
4335 to array instance.
4336
4337 2001-02-15 Alexandre Petit-Bianco <apbianco@redhat.com>
4338
4339 * expr.c (build_instanceof): Check for arrays when trying fold to
4340 false.
4341
4342 2001-02-15 Jim Meyering <meyering@lucent.com>
4343
4344 * Make-lang.in (java.install-common): Depend on `installdirs'.
4345 (java.install-info): Likewise.
4346
4347 2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
4348
4349 * Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
4350
4351 2001-02-14 Tom Tromey <tromey@redhat.com>
4352 Alexandre Petit-Bianco <apbianco@cygnus.com>
4353
4354 Fix for PR java/1261.
4355 * typeck.c (build_java_array_type): Add public `clone' method to
4356 arrays.
4357 * parse.y (resolve_qualified_expression_name): Use current_class
4358 when checking for inaccessibility.
4359 (patch_method_invocation): Fixed error message when accessibility
4360 denied. Added `from_super' argument.
4361
4362 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
4363
4364 * parse.y (resolve_class): Don't build a fake decl. Use the one
4365 already built.
4366 * typeck.c (build_java_array_type): Build and assign decl to array
4367 type.
4368
4369 2001-02-14 Alexandre Petit-Bianco <apbianco@redhat.com>
4370
4371 * parse.y (not_accessible_p): Changed leading comment. Added extra
4372 `where' argument. Use it to enforce protected access rules.
4373 (resolve_qualified_expression_name): Added extra argument to
4374 not_accessible_p.
4375 (patch_method_invocation): Use argument `primary' to provide
4376 not_accessible_p with an extra argument.
4377 (lookup_method_invoke): Added extra argument to not_accessible_p.
4378 (search_applicable_method_list): Likewise.
4379
4380 2001-02-13 Alexandre Petit-Bianco <apbianco@redhat.com>
4381
4382 * parse.y (resolve_qualified_expression_name): Try to resolve as
4383 an inner class access only if `decl' is a TYPE_DECL.
4384
4385 2001-02-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
4386
4387 * decl.c (classdollar_identifier_node): Initialize.
4388 * java-tree.h (enum java_tree_index): New entry
4389 `JTI_CLASSDOLLAR_IDENTIFIER_NODE.'
4390 (classdollar_identifier_node): New macro.
4391 (ID_CLASSDOLLAR_P): Likewise.
4392 * parse.y (build_dot_class_method): Use `classdollar_identifier_node.'
4393 (build_dot_class_method_invocation): Likewise.
4394 (find_applicable_accessible_methods_list): `class$' can't be
4395 inherited.
4396
4397 2001-02-09 Raja R Harinath <harinath@cs.umn.edu>
4398
4399 * Make-lang.in (java/mangle_name.o): Add 'make' prereqs.
4400
4401 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
4402
4403 * Manke-lang.in (JVGENMAIN_OBJS): Added `errors.o'
4404 * jvgenmain.c (error): Reversed 2001-02-09 patch. `error' is now
4405 gone.
4406
4407 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
4408
4409 * mangle_name (append_unicode_mangled_name): Emit `_' or `U'
4410 outside of the `__U' sequence too.
4411 (unicode_mangling_length): Count `_' or `U' outside of the `__U'
4412 sequence too.
4413
4414 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
4415
4416 * jvgenmain.c (error): Reversed 2001-02-01 deletion.
4417
4418 2001-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
4419
4420 * Make-lang.in (JAVA_OBJS): Added java/mangle_name.o
4421 (JVGENMAIN_OBJS): Likewise.
4422 * java-tree.h (append_gpp_mangled_name): New prototype.
4423 * jcf-parse.c (ggc_mark_jcf): Argument now `void *.'
4424 Removed cast calling `gcc_add_root.'
4425 * jvgenmain.c (mangle_obstack): New global, initialized.
4426 (main): Use it.
4427 (do_mangle_class): Constify local `ptr.'
4428 Removed macro `MANGLE_NAME.' Removed cast in `for.' Call
4429 append_gpp_mangle_name and update `count' if necessary.
4430 Use `mangle_obstack.'
4431 * mangle.c (append_unicode_mangled_name): Removed.
4432 (append_gpp_mangled_name): Likewise.
4433 (unicode_mangling_length): Likewise.
4434 (mangle_member_name): Return type set to `void.'
4435 (mangle_field_decl): Don't append `U' in escaped names.
4436 (mangle_method_decl): Likewise.
4437 (mangle_member_name): Just use `append_gpp_mangled_name.'
4438 * mangle_name.c: New file.
4439
4440 2001-02-07 Per Bothner <per@bothner.com>
4441
4442 * check-init.c (check_init): Fix TRY_FINALLY_EXPR logic.
4443
4444 * check-init.c (check_init): Don't call done_alternative after
4445 processing loop code, as a LOOP_EXPR never terminates normally.
4446
4447 2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
4448
4449 * gcj.texi: Change sources.redhat.com reference to gcc.gnu.org.
4450
4451 2001-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4452
4453 * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): Don't handle field
4454 DECLs.
4455
4456 2001-02-06 Tom Tromey <tromey@redhat.com>
4457
4458 * lex.c (java_new_lexer): Longer error message.
4459
4460 2001-02-05 Jeff Sturm <jeff.sturm@commerceone.com>
4461 Alexandre Petit-Bianco <apbianco@cygnus.com>
4462
4463 * typeck.c (build_prim_array_type): Added leading comment.
4464 (build_java_array_type): Moved locals out of
4465 block. Always create the `data' field, fixed alignment to match
4466 C++.
4467
4468 2001-02-04 Tom Tromey <tromey@redhat.com>
4469
4470 * expr.c (java_lang_expand_expr): Don't bother recomputing
4471 `length'. Use rest_of_decl_compilation, not make_decl_rtl.
4472 Fixes PR java/1866.
4473
4474 2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4475
4476 * parse.y (process_imports): Save the original name of the import
4477 for better error report.
4478
4479 2001-02-04 Bryce McKinlay <bryce@albatross.co.nz>
4480
4481 * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
4482 of macros used when compiling jvspec.c.
4483 * jvspec.c (lang_specific_driver): Link with the shared
4484 libgcc by default.
4485
4486 2001-02-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
4487
4488 * check-init.c (check_init): Call internal_error instead of fatal.
4489 * expr.c (java_lang_expand_expr): Likewise.
4490 * jcf-parse.c (get_constant): Likewise.
4491 * mangle.c (java_mangle_decl): Likewise.
4492 * parse.y (make_nested_class_name, java_complete_lhs): Likewise.
4493 (operator_string): Likewise.
4494 * check-init.c (check_init): Call abort instead of fatal.
4495 * class.c (build_class_ref): Likewise.
4496 * constants.c (write_constant_pool): Likewise.
4497 * decl.c (start_java_method): Likewise.
4498 * expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
4499 (java_stack_dup, encode_newarray_type): Likewise.
4500 (build_java_array_length_access): Likewise.
4501 (build_java_check_indexed_type, expand_java_pushc): Likewise.
4502 (build_java_soft_divmod, build_invokeinterface): Likewise.
4503 * java-tree.h (INNER_CLASS_P): Likewise.
4504 * jcf-parse.c (parse_signature, get_name_constant): Likewise.
4505 (give_name_to_class, get_class_constant): Likewise.
4506 * jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
4507 (find_constant_index, generate_bytecode_conditional): Likewise.
4508 (generate_bytecode_insns, perform_relocations): Likewise.
4509 * lex.c (java_unget_unicode, java_lex): Likewise.
4510 * mangle.c (mangle_type, mangle_record_type): Likewise.
4511 (mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
4512 (finish_mangling): Likewise.
4513 * parse.h (MARK_FINAL_PARMS): Likewise.
4514 * parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
4515 (obtain_incomplete_type, java_complete_class): Likewise.
4516 (java_check_regular_methods, java_complete_expand_method): Likewise.
4517 (cut_identifier_in_qualified, check_deprecation): Likewise.
4518 (patch_invoke, find_applicable_accessible_methods_list): Likewise.
4519 (java_complete_lhs, lookup_name_in_blocks): Likewise.
4520 (check_final_variable_indirect_assignment, build_unaryop): Likewise.
4521 * typeck.c (set_local_type, parse_signature_type): Likewise.
4522 (parse_signature_string, build_java_signature): Likewise;
4523 (set_java_signature): Likewise.
4524 * verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
4525 * class.c (add_method): Call fatal_error instead of fatal.
4526 (build_static_field_ref): Likewise.
4527 * expr.c (build_known_method_ref, expand_invoke): Likewise.
4528 * jcf-parse.c (get_constant, jcf_parse): Likewise.
4529 * lex.c (java_new_new_lexer): Likewise.
4530 * jv-scan.c (main): Likewise.
4531 (fatal_error): Renamed from fatal.
4532 * jcf-parse.c (yyparse): Call fatal_io_error instead of
4533 pfatal_with_name.
4534 * jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
4535 (yyparse): Likewise.
4536 * jcf-write.c (make_class_file_name, write_classfile): Likewise.
4537 * lex.c (java_get_line_col): Likewise.
4538 * jcf-parse.c (load_class): Make errors non-fatal.
4539 * lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
4540
4541 2001-02-01 Bryce McKinlay <bryce@albatross.co.nz>
4542
4543 * jvgenmain.c (class_mangling_suffix): Remove unused string.
4544 (error): Remove unused function.
4545 (main): Don't use "__attribute__ alias" on generated class symbol.
4546
4547 2001-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
4548
4549 * jcf-parse.c (init_jcf_parse): Added cast to ggc_add_root's last
4550 argument.
4551 * parse.y (finish_method_declaration): Code accounting for WFLed
4552 method DECL_NAMEs deleted.
4553 (check_abstract_method_definitions): Likewise.
4554 (resolve_type_during_patch): Layout resolved type.
4555 * typeck.c (lookup_do): Removed unused local.
4556
4557 2001-01-30 Bryce McKinlay <bryce@albatross.co.nz>
4558
4559 * java-tree.h: Remove JTI_INTEGER_NEGATIVE_ONE_NODE.
4560 * decl.c (init_decl_processing): Use integer_minus_one_node, not
4561 integer_negative_one_node.
4562 * expr.c (build_java_binop): Likewise.
4563
4564 2001-01-24 Jeff Sturm <jeff.sturm@commerceone.com>
4565
4566 * zextract.c (read_zip_archive): Read file_offset before writing
4567 zipd and consequently clobbering the header contents.
4568
4569 2001-01-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4570
4571 * Make-lang.in: Remove all dependencies on defaults.h.
4572 * decl.c: Don't include defaults.h.
4573 * expr.c: Likewise.
4574 * parse.y: Likewise.
4575
4576 2001-01-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
4577
4578 * ChangeLog (2001-01-21): Fixed typo.
4579 * class.c (layout_class_method): Code accounting for WFLed
4580 method DECL_NAMEs deleted.
4581 * constant.c (find_methodref_index): Likewise.
4582 * decl.c (lang_mark_tree): Mark `wfl' field in struct lang_decl.
4583 * java-tree.h (DECL_FUNCTION_WFL): New macro.
4584 (struct lang_decl): New field `wfl'.
4585 (java_get_real_method_name): Prototype deleted.
4586 * mangle.c (mangle_method_decl): Code accounting for WFLed
4587 method DECL_NAMEs deleted.
4588 * parse.h (GET_METHOD_NAME): Macro deleted.
4589 * parse.y (reset_method_name): Deleted.
4590 (method_header): Set DECL_FUNCTION_WFL.
4591 (check_abstract_method_header): Code accounting for WFLed method
4592 DECL_NAMEs deleted.
4593 (java_get_real_method_name): Deleted.
4594 (check_method_redefinition): Code accounting for WFLed method
4595 DECL_NAMEs deleted. Use DECL_FUNCTION_WFL.
4596 (java_check_regular_methods): Likewise.
4597 (java_check_abstract_methods): Likewise.
4598 (java_expand_classes): Don't call `reset_method_name.'
4599 (search_applicable_method_list): Use DECL_NAMEs instead of
4600 GET_METHOD_NAME.
4601 * typeck.c (lookup_do): Code accounting for WFLed method
4602 DECL_NAMEs deleted.
4603
4604 2001-01-25 Richard Earnshaw <rearnsha@arm.com>
4605
4606 * lex.c (java_read_char): Check for EOF from getc first.
4607
4608 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
4609
4610 * class.c (layout_class): Don't lay the superclass out if it's
4611 already being laid out.
4612 * jcf-parse.c (handle_innerclass_attribute): New function.
4613 (HANDLE_INNERCLASSES_ATTRIBUTE): Invoke
4614 handle_innerclasses_attribute.
4615 (jcf_parse): Don't load an innerclasses if it's already being
4616 laid out.
4617 * jcf-write.c (append_innerclass_attribute_entry): Static
4618 `anonymous_name' and its initialization deleted. `ocii' and `ini'
4619 to be zero for anonymous classes.
4620
4621 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
4622
4623 * class.c (set_constant_value): Set DECL_FIELD_FINAL_IUD if
4624 necessary.
4625 * jcf-parse.c (set_source_filename): Use
4626 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC if necessary.
4627
4628 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
4629
4630 * expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
4631 gets a unique asm name.
4632
4633 2001-01-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
4634
4635 * jcf-parse.c (HANDLE_END_METHODS): Nullify current_method.
4636 (HANDLE_START_FIELD): Invoke MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
4637 if necessary.
4638 (HANDLE_SYNTHETIC_ATTRIBUTE): New macro.
4639 * jcf-reader.c (get_attribute): Handle `Synthetic' attribute.
4640 * parse.y (lookup_package_type_and_set_next): Deleted.
4641 (resolve_package): Removed unnecessary code.
4642 (find_applicable_accessible_methods_list): `finit$' can't be
4643 inherited.
4644 * verify.c (pop_argument_types): Added missing prototype.
4645
4646 2001-01-23 Bryce McKinlay <bryce@albatross.co.nz>
4647
4648 * config-lang.in: Disable java by default.
4649
4650 2001-01-23 Tom Tromey <tromey@redhat.com>
4651
4652 * gcj.texi (Copying): New node.
4653 Added copyright information.
4654
4655 2001-01-21 Per Bothner <per@bothner.com>
4656
4657 Various fixes to allow compiling a compressed .jar/.zip archive.
4658 * zipfile.h (struct ZipFileCache): Replace by struct ZipFile.
4659 (struct ZipFile): Add fields name and next (from ZipFileCache).
4660 (struct ZipDirectory): New field zipf points to owning ZipFile.
4661 * jcf.h (struct ZipDirectory): Add forward declaration.
4662 (struct JCF): Declare zipd field to have type struct ZipDirectory.
4663 Remove seen_in_zip and zip_offset fields.
4664 (JCF_SEEN_IN_ZIP): New macro.
4665 * zextract.c (read_zip_archive): Set ZipDirectory's zipf field.
4666 * jcf-io.c: Change all ZipFileCache to ZipFile.
4667 (read_zip_member): New function.
4668 (open_in_zip): Call read_zip_member.
4669 * jcf-parse.c (find_in_current_zip): Remove function.
4670 (read_class): Merge in find_in_current_zip functionality.
4671 Call read_zip_member if needed.
4672 (parse_zip_file_entries): Use read_zip_member.
4673 (process_zip_dir): Update for removed and added JCF fields.
4674 (jcf_figure_file_type): Re-use, don't copy initial ZipFile struct.
4675
4676 2001-01-21 Per Bothner <per@bothner.com>
4677
4678 Minor optimization of static ggc roots.
4679 * jcf-parse.c (parse_roots): New static field.
4680 (current_field, current_method, current_file_list): Replace by macros
4681 naming fields of parse_roots.
4682 (init_jcf_parse): Combine 3 ggc_add_tree_root calls to 1.
4683 * class.c (class_roots): New static field.
4684 (registered_class, fields_ident, info_ident, class_list):
4685 New macros naming fields of parse_roots.
4686 (build_static_field_ref): Don't register roots here.
4687 (layout_class): Static field list replaced by macro class_list.
4688 (init_class_processing): Call ggc_add_tree_root for 4 roots.
4689 Initialize fields_ident and info_ident here.
4690
4691 2001-01-21 Per Bothner <per@bothner.com>
4692
4693 * jcf-parse.c (ggc_mark_jcf): New function.
4694 (init_jcf_parse): Register current_jcf as ggc root.
4695
4696 2001-01-21 Per Bothner <per@bothner.com>
4697
4698 * lang.c (put_decl_node): Print method's name.
4699
4700 2001-01-21 Per Bothner <per@bothner.com>
4701
4702 * verify.c (VERIFICATION_ERROR_WITH_INDEX): New macro.
4703 (verify_jvm_instructions): Use it, for better error messages on loads.
4704
4705 2001-01-21 Per Bothner <per@bothner.com>
4706
4707 * verify.c (merge_type_state): Still may have to merge even if
4708 LABEL_VERIFIED (label).
4709
4710 2001-01-21 Per Bothner <per@bothner.com>
4711
4712 * parse.y (method_header): Don't set the DECL_NAME of a FUNCTION_DECL
4713 to a EXPR_WITH_FILE_LOCATION - that is just too fragile and wrong.
4714
4715 2001-01-19 Per Bothner <per@bothner.com>
4716
4717 * expr.c (pop_type_0): Only return object_ptr_type_node on mismatch
4718 if expeting an interface type. Refines Tom's change of 2000-09-12.
4719
4720 2001-01-18 Per Bothner <per@bothner.com>
4721
4722 * gcj.texi (Input Options): Mention .java files.
4723
4724 2001-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
4725
4726 * lang-options.h (-Wunsupported-jdk11): Removed.
4727 * lang.c (flag_not_overriding): Deleted.
4728 (flag_static_local_jdk1_1): Likewise.
4729 (lang_W_options): Removed "unsupported-jdk11" entry.
4730 * parse.y (java_check_methods): Removed dead code.
4731
4732 2001-01-17 Tom Tromey <tromey@redhat.com>
4733
4734 Changes suggested by Per Bothner:
4735 * gcj.texi (Input Options): Don't mention input files.
4736 (Code Generation): Updated --main information.
4737 (Invoking jcf-dump): Mention that --javap is incomplete.
4738 From Alexandre Petit-Bianco:
4739 (Warnings): Don't mention -Wunsupported-jdk11.
4740 My stuff:
4741 (Compatibility): Mention JDK 1.2-ness of libraries.
4742 (Resources): Mention resources used when writing gcj.
4743
4744 2001-01-17 Tom Tromey <tromey@redhat.com>
4745
4746 * gcj.texi: New file.
4747 * Make-lang.in ($(srcdir)/java/gcj.info): New target.
4748 (java.info): Depend on gcj.info.
4749 (java/gcj.dvi): New target.
4750 (java.dvi): Depend on gcj.dvi.
4751 (java.install-info): Wrote.
4752
4753 2001-01-16 Jeff Sturm <jeff.sturm@appnet.com>
4754
4755 * expr.c (java_lang_expand_expr): Use TREE_SYMBOL_REFERENCED after
4756 having called make_decl_rtl.
4757
4758 2001-01-14 Per Bothner <per@bothner.com>
4759
4760 Various patches to emit better messages on verification errors.
4761 * expr.c (push_type_0): Return error indication on stack overflow,
4762 instead of callinfg fatal.
4763 (push_type): Now just call push_type_0 (nd fatal on overflow).
4764 (pop_type_0): Return detailed error message (in a char** argument).
4765 (pop_type): If pop_type_0 fails, print error message.
4766 (pop_argument_types): Moved to verify.c.
4767 * verify.c (pop_argument_types): Moved from expr.c.
4768 Return a (possible) error message, rather than void.
4769 (POP_TYPE, POP_TYPE_CONV, PUSH_TYPE, PUSH_PENDING): New macros.
4770 (verify_jvm_instruction): Use new macros, improving error messages.
4771 For case OPCODE_astore use object_ptr_type_node.
4772 * java-tree.h (TYPE_UNDERFLOW, TYPE_UNEXPECTED): New macros.
4773 (pop_type_0, push_type_0, pop_argument_types): Update accordingly.
4774
4775 * parse.y (java_complete_lhs case EXPR_WITH_FILE_LOCATION): If body is
4776 constant, return body without wrapper. (Improves constant folding.)
4777 * lex.c (build_wfl_node): Clear TREE_TYPE from returned node.
4778
4779 2001-01-13 Per Bothner <per@bothner.com>
4780
4781 * expr.c (expand_java_field_op): Assigning to a final field outside
4782 an initializer does not violate JVM spec, so should be warning, not
4783 error. (Sun's verifier does not complain - though MicroSoft's does.)
4784
4785 2001-01-12 Joseph S. Myers <jsm28@cam.ac.uk>
4786
4787 * gjavah.c (version), jcf-dump.c (version): Update copyright year
4788 to 2001.
4789
4790 2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
4791
4792 * parse.y (resolve_expression_name): Permit instance variables from
4793 enclosing context in super constructor call.
4794 (resolve_qualified_expression_name): Permit enclosing class's qualified
4795 "this" in super constructor call.
4796
4797 2001-01-10 Mark Mitchell <mark@codesourcery.com>
4798
4799 * class.c (build_utf8_ref): Remove last argument in call to
4800 make_decl_rtl; use make_function_rtl instead of make_decl_rtl.
4801 (build_class_ref): Likewise.
4802 (build_static_field_ref): Likewise.
4803 (get_dispatch_table): Likewise.
4804 (layout_class_method): Likewise.
4805 (emit_register_classes): Likewise.
4806 * constants.c (build_constant_data_ref): Likewise.
4807 * decl.c (builtin_function): Likewise.
4808 (create_primitive_vtable): Likewise.
4809 * expr.c (build_known_method_def): Likewise.
4810 (build_jni_stub): Likewise.
4811 (java_lang_expand_expr): Likewise.
4812
4813 2001-01-10 Tom Tromey <tromey@redhat.com>
4814
4815 * jvspec.c (jvgenmain_spec): Omit -fencoding from cc1 invocation.
4816
4817 2001-01-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
4818
4819 * java-tree.h (lang_printable_name_wls): New prototype.
4820 * lang.c (put_decl_name): Removed dead code. Use DECL_CONTEXT
4821 rather than `current_class' to print type name. Don't prepend type
4822 names when printing constructor names.
4823 (lang_printable_name_wls): New function.
4824 * jcf-parse.c (jcf_parse_source): Pass NULL `file' argument to
4825 `build_expr_wfl', alway set EXPR_WFL_FILENAME_NODE.
4826 * parse.y (patch_method_invocation): Message tuned for constructors.
4827 (not_accessible_p): Grant `private' access from within
4828 enclosing contexts.
4829
4830 2001-01-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
4831
4832 All files with updated copyright when applicable.
4833 * Make-lang.in (JVGENMAIN_OBS): Removed java/mangle.o.
4834 * class.c (mangle_class_field): Function removed.
4835 (append_gpp_mangled_type, mangle_static_field, mangle_field): Likewise.
4836 (utf8_cmp, cxx_keyword_p): Moved to lex.c.
4837 (build_class_ref): Call `java_mangle_class_field' instead of
4838 `mangle_class_field.'
4839 (build_dtable_decl): Rewritten to call `java_mangle_vtable.'
4840 (layout_class): Call `java_mangle_decl' instead of
4841 `mangle_static_field.'
4842 (cxx_keywords): Initialized static array moved to `lex.c.'
4843 (layout_class_method): Changed leading comment. Simplified to
4844 call `java_mangle_decl.' Local `ptr' moved in for loop body.
4845 * decl.c (lang_mark_tree): Mark field `package_list.'
4846 * java-tree.h (TYPE_PACKAGE_LIST): New macro.
4847 (struct lang_type): New field `package_list.'
4848 (unicode_mangling_length): Prototype removed.
4849 (append_gpp_mangled_name, append_gpp_mangled_classtype,
4850 emit_unicode_mangled_name): Likewise.
4851 (cxx_keyword_p): New prototype.
4852 (java_mangle_decl, java_mangle_class_field,
4853 java_mangle_class_field_from_string, java_mangle_vtable): Likewise.
4854 * jcf-parse.c (jcf_parse_source): Constify `file' argument to
4855 `build_expr_wfl.'
4856 * jvgenmain.c (main_method_prefix): Global variable removed.
4857 (main_method_suffix): Likewise.
4858 (do_mangle_classname): New function.
4859 (main): Call it. Format changed to accommodate new mangling scheme.
4860 * lex.c: (utf8_cmp): Conditionally prototyped.
4861 (cxx_keywords): Moved from class.c, conditionally defined.
4862 (utf8_cmp, cxx_keyword_p): Likewise.
4863 * mangle.c (obstack.h, ggc.h): Included.
4864 (mangle_field_decl): New function.
4865 (mangle_method_decl, mangle_type, mangle_pointer_type,
4866 mangle_array_type, mangle_record_type,
4867 find_compression_pointer_match, find_compression_array_match,
4868 find_compression_record_match,
4869 find_compression_array_template_match, set_type_package_list,
4870 entry_match_pointer_p, emit_compression_string, init_mangling,
4871 finish_mangling, compression_table_add, mangle_member_name): Likewise.
4872 (mangle_obstack): New global.
4873 (MANGLE_RAW_STRING): New macro.
4874 (unicode_mangling_length): Turned static.
4875 (append_unicode_mangled_name): Renamed from
4876 `emit_unicode_mangled_name.' Turned static. `mangle_obstack'
4877 replaces `obstack', removed from the parameter list.
4878 (append_gpp_mangled_name): Turned static. `mangle_obstack'
4879 replaces parameter `obstack', removed from the parameter list. Call
4880 `append_unicode_mangled_name' instead of `emit_unicode_mangled_name.
4881 (append_gpp_mangled_classtype): Removed.
4882 (compression_table, compression_next): New static variables.
4883 * parse.y (temporary_obstack): Extern declaration removed.
4884
4885 2001-01-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
4886
4887 * parse.y (patch_binop): Compute missing type in error situations.
4888
4889 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
4890
4891 * class.c (make_class_data): Push initial value for "arrayclass".
4892 * decl.c (init_decl_processing): Add new class field "arrayclass".
4893
4894 2001-01-05 Bryce McKinlay <bryce@albatross.co.nz>
4895
4896 From patha@softlab.ericsson.se:
4897 * parse.y (switch_label): Use build, not build1, to construct
4898 DEFAULT_EXPR.
4899
4900 2001-01-04 Neil Booth <neil@daikokuya.demon.co.uk>
4901
4902 * lang.c (lang_decode_option): Change -MA to -MP.
4903 * jcf-depend.c (jcf_dependency_add_target, jcf_dependency_set_target):
4904 Update to new prototype; do quote targets.
4905 (jcf_dependency_write): Update.
4906
4907 2000-12-22 Bryce McKinlay <bryce@albatross.co.nz>
4908
4909 Shorten primitive array allocation path:
4910 * decl.c (init_decl_processing): Use _Jv_NewPrimArray not _Jv_NewArray
4911 to create new primitive arrays.
4912 * expr.c (build_newarray): If generating native code, call
4913 soft_newarray_node with a reference to the primitive TYPE identifier
4914 instead of type_value.
4915
4916 2000-12-17 Bryce McKinlay <bryce@albatross.co.nz>
4917
4918 Fix for PRs gcj/312 and gcj/253:
4919 * parse.y (valid_ref_assignconv_cast_p): Load classes for source and
4920 dest if they arn't already.
4921 * class.c (layout_class): Call maybe_layout_super_class on
4922 superinterfaces also, but only if compiling from bytecode.
4923
4924 Fix for PR gcj/373:
4925 * parse.y (create_class): Set ACC_STATIC if class is declared in an
4926 interface.
4927
4928 2000-12-15 Tom Tromey <tromey@redhat.com>
4929
4930 * jcf-parse.c (jcf_parse_source): Set wfl_operator if not already
4931 set.
4932
4933 2000-12-14 Andrew Haley <aph@redhat.com>
4934
4935 * boehm.c (mark_reference_fields): Change test to correctly detect
4936 bitmap overflow.
4937
4938 2000-12-15 Andreas Jaeger <aj@suse.de>
4939
4940 * config-lang.in (lang_dirs): Added.
4941
4942 2000-12-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
4943
4944 * parse.y (end_artificial_method_body): Fixed undefined behavior.
4945 Credits go to rth for finding it.
4946
4947 2000-12-13 Mike Stump <mrs@wrs.com>
4948
4949 * parse.y (check_static_final_variable_assignment_flag): Fix spelling.
4950
4951 2000-11-07 Tom Tromey <tromey@cygnus.com>
4952
4953 * Make-lang.in (JAVA_LEX_C): Added chartables.h.
4954 * lex.c (java_ignorable_control_p): Removed.
4955 (java_letter_or_digit_p): Removed.
4956 (java_start_char_p): New function.
4957 (java_read_char): Return `int', not `unicode_t'. Changed
4958 callers.
4959 (java_read_unicode): Likewise.
4960 (java_read_unicode_collapsing_terminators): Likewise.
4961 (java_get_unicode): Likewise.
4962 (java_new_lexer): Initialize hit_eof.
4963 (java_parse_end_comment): Take `int' argument.
4964 (java_parse_doc_section): Likewise.
4965 (java_parse_escape_sequence): Don't allow backlash-newline.
4966 Return `int'.
4967 * lex.h (JAVA_DIGIT_P): Removed.
4968 (_JAVA_LETTER_OR_DIGIT_P): Removed.
4969 (_JAVA_IDENTIFIER_IGNORABLE): Removed.
4970 (JAVA_START_CHAR_P): Renamed from JAVA_ID_CHAR_P.
4971 (JAVA_PART_CHAR_P): New macro.
4972 (UEOF): Now -1.
4973 (JAVA_CHAR_ERROR): Now -2.
4974 (java_lexer): New field `hit_eof'.
4975 * chartables.h: New file.
4976 * gen-table.pl: new file.
4977
4978 2000-11-20 Tom Tromey <tromey@cygnus.com>
4979 Alexandre Petit-Bianco <apbianco@cygnus.com>
4980
4981 * parse.y (java_complete_lhs): Only allow compound assignment of
4982 reference type if type is String.
4983
4984 2000-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
4985
4986 * Make-lang.in (java/jcf-path.o:): libgcj.jar replaces libgcj.zip.
4987 jcf-path.c: Likewise.
4988
4989 2000-12-09 Anthony Green <green@redhat.com>
4990
4991 * zipfile.h (ZipDirectory): Declare size, uncompressed_size,
4992 filestart and filename_length as int values.
4993
4994 2000-12-07 Mo DeJong <mdejong@redhat.com>
4995
4996 * jcf-io.c (find_class): Correct the logic that tests to see if a
4997 .java file is newer than its .class file. The compiler was
4998 incorrectly printing a warning when file mod times were equal.
4999
5000 2000-12-07 Zack Weinberg <zack@wolery.stanford.edu>
5001
5002 * jvgenmain.c: Use ISPRINT not isascii.
5003
5004 2000-12-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
5005
5006 * parse.y (end_artificial_method_body): Fixed typo.
5007
5008 2000-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
5009
5010 * parse.y (patch_method_invocation): Pick the correct enclosing
5011 context when creating inner class instances.
5012 Fixes gcj/332.
5013
5014 2000-11-26 Joseph S. Myers <jsm28@cam.ac.uk>
5015
5016 * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
5017 Update copyright year to 2000.
5018
5019 2000-11-23 Anthony Green <green@redhat.com>
5020
5021 * jcf-parse.c (init_jcf_parse): Register current_file_list root.
5022 Move current_file_list out of yyparse and make it static.
5023
5024 * expr.c: Declare quick_stack and tree_list_free_list as static
5025 (init_expr_processing): Register quick_stack and
5026 tree_list_free_list roots.
5027
5028 2000-11-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
5029
5030 * parse.y (build_outer_field_access): New local `decl_ctx', use
5031 it. Check for field's context and current class immediate outer
5032 context inheritance.
5033 (outer_field_access_p): Consider fields inherited from the last
5034 enclosing context.
5035 (build_access_to_thisn): Stop at the last enclosing context if
5036 necessary.
5037 Fixes gcj/367.
5038
5039 2000-11-23 J"orn Rennecke <amylaar@redhat.com>
5040
5041 * Make-lang.in (jvspec.o): Depend on $(CONFIG_H).
5042
5043 2000-11-22 Bryce McKinlay <bryce@albatross.co.nz>
5044
5045 * jcf-parse.c (get_constant): Call UT8_CHAR_LENGTH on `utf8', not the
5046 scratch buffer.
5047
5048 2000-11-20 Tom Tromey <tromey@cygnus.com>
5049
5050 * jv-scan.c (help): Document --complexity.
5051 (options): Added --complexity.
5052 (flag_complexity): New global.
5053 (main): Call `report'.
5054 * parse-scan.y (complexity): New global.
5055 (if_then_statement, if_then_else_statement,
5056 if_then_else_statement_nsi, switch_block_statement_group,
5057 while_expression, do_statement, for_begin, continue_statement,
5058 throw_statement, catch_clause, finally, method_invocation,
5059 conditional_and_expression, conditional_or_expression,
5060 conditional_expression): Update complexity.
5061 (reset_report): Reset complexity.
5062 (report): New function.
5063
5064 2000-11-20 Tom Tromey <tromey@cygnus.com>
5065
5066 * lex.c (yylex): Added STRICT_TK case.
5067 * parse.y (STRICT_TK): Added.
5068 * parse-scan.y (STRICT_TK): Added.
5069 * Make-lang.in ($(srcdir)/java/keyword.h): Added missing `\' and
5070 `;'. Use 4, not 3, with -k option. Correctly rename resulting
5071 file.
5072 * keyword.h: Rebuilt.
5073 * keyword.gperf (strictfp): Added.
5074
5075 2000-11-20 Tom Tromey <tromey@cygnus.com>
5076
5077 * lex.c (yylex): Recognize floating point constants with leading
5078 0.
5079
5080 2000-11-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5081
5082 * java-tree.h (cyclic_inheritance_report): Constify.
5083 * parse.y (cyclic_inheritance_report): Likewise.
5084
5085 2000-11-17 Zack Weinberg <zack@wolery.stanford.edu>
5086
5087 * parse.y (goal): Remove call to ggc_add_string_root.
5088
5089 2000-11-16 Zack Weinberg <zack@wolery.stanford.edu>
5090
5091 * jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
5092 Create string in scratch buffer, then pass to build_string.
5093
5094 2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
5095
5096 * parse.y (issue_warning_error_from_context): Add
5097 ATTRIBUTE_PRINTF.
5098
5099 2000-11-11 Anthony Green <green@redhat.com>
5100
5101 * jcf-parse.c (process_zip_dir): Add finput parameter.
5102 (jcf_figure_file_type): Call process_zip_dir with appropriate
5103 argument.
5104
5105 2000-11-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5106
5107 * decl.c (copy_lang_decl): Use memcpy, not bcopy.
5108 * jcf-parse.c (jcf_figure_file_type): Likewise.
5109
5110 2000-11-09 Joseph S. Myers <jsm28@cam.ac.uk>
5111
5112 * parse.y (create_new_parser_context): Use memset () instead of
5113 bzero ().
5114
5115 2000-11-08 Tom Tromey <tromey@cygnus.com>
5116
5117 * gjavah.c (process_file): Only include gcj/cni.h when generating
5118 CNI stubs.
5119
5120 2000-11-07 Joseph S. Myers <jsm28@cam.ac.uk>
5121
5122 * expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
5123 (init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
5124 instead of bzero ().
5125
5126 2000-11-05 Tom Tromey <tromey@cygnus.com>
5127
5128 * lex.h (JAVA_FLOAT_RANGE_ERROR): Typo fix.
5129 * lex.c (IS_ZERO): New define.
5130 (java_perform_atof): Error on floating point underflow.
5131
5132 2000-11-04 Tom Tromey <tromey@cygnus.com>
5133
5134 * lex.c (java_parse_escape_sequence): Only read two octal
5135 characters if the first one is greater than 3. Don't allow
5136 "octal" numbers to include the digits 8 or 9.
5137
5138 2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
5139
5140 * Make-lang.in (java.distdir): Remove.
5141
5142 2000-11-03 Tom Tromey <tromey@cygnus.com>
5143
5144 * Make-lang.in (java.dvi): New target.
5145 Partial fix for PR other/567.
5146
5147 * lang-options.h: Mention -Wout-of-date.
5148 * jcf-dump.c (flag_newer): New global.
5149 * gjavah.c (flag_newer): New global.
5150 * jcf-io.c (find_class): Only warn when flag_newer set.
5151 * lang.c (flag_newer): New global.
5152 (struct string_option): New declaration.
5153 (lang_W_options): New global.
5154 (process_option_with_no): New function.
5155 (lang_decode_option): Use it.
5156
5157 * class.c (cxx_keyword_p): Accept keywords with trailing `$'s.
5158 * gjavah.c (cxx_keyword_subst): Handle any number of trailing
5159 `$'.
5160
5161 * lex.h (_JAVA_IDENTIFIER_IGNORABLE): New macro.
5162 (JAVA_ID_CHAR_P): Also try java_ignorable_control_p.
5163 * lex.c (java_read_unicode): Removed `term_context' argument.
5164 Recognize any number of `u' in `\u'.
5165 (java_read_unicode_collapsing_terminators): New function.
5166 (java_get_unicode): Use it.
5167 (java_lineterminator): Removed.
5168 (yylex): Produce error if character literal is newline or single
5169 quote. Return if eof found in middle of `//' comment. EOF in
5170 `//' comment is only an error if pedantic.
5171 (java_ignorable_control_p): New function.
5172 (java_parse_end_comment): Return if eof found in middle of
5173 comment.
5174 Include flags.h.
5175 * jv-scan.c (pedantic): New global.
5176
5177 2000-10-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
5178
5179 * parse.y (outer_field_access_p): Inherited fields aren't
5180 consider outer fields.
5181 (maybe_build_thisn_access_method): Use
5182 PURE_INNER_CLASS_TYPE_P instead of INNER_CLASS_TYPE_P.
5183 (resolve_expression_name): Trigger an error if a static field
5184 is being accessed as an outer field.
5185
5186 2000-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
5187
5188 * Make-lang.in (LIBGCJ_ZIP_FILE): Define with `$(prefix)'.
5189 Fixes gcj/365.
5190
5191 2000-10-27 Zack Weinberg <zack@wolery.stanford.edu>
5192
5193 * Make-lang.in: Move all build rules here from Makefile.in,
5194 adapt to new context. Wrap all rules that change the current
5195 directory in parentheses. Expunge all references to $(P).
5196 When one command depends on another and they're run all at
5197 once, use && to separate them, not ;. Add OUTPUT_OPTION to
5198 all object-file generation rules. Delete obsolete variables.
5199
5200 * Makefile.in: Delete.
5201 * config-lang.in: Delete outputs= line.
5202
5203 2000-10-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
5204
5205 * parse.y (patch_method_invocation): NULLify this_arg when already
5206 inserted.
5207 (maybe_use_access_method): Handle call to methods unrelated to the
5208 current class. Fixed comment.
5209 Fixes gcj/361.
5210
5211 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
5212
5213 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Check inherited type in
5214 scope.
5215
5216 2000-10-24 Tom Tromey <tromey@cygnus.com>
5217
5218 * lex.c (java_new_lexer): Initialize new fields. Work around
5219 broken iconv() implementations.
5220 (java_read_char): Swap bytes if required. Use fallback decoder if
5221 required.
5222 (byteswap_init, need_byteswap): New globals.
5223 (java_destroy_lexer): Only close iconv handle if it is in use.
5224 * lex.h (java_lexer): New fields read_anything, byte_swap,
5225 use_fallback.
5226 Made out_buffer unsigned.
5227
5228 2000-10-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
5229
5230 * parse.y (register_incomplete_type): Include JDEP_FIELD as a case
5231 where an enclosing context can be set on the jdep.
5232 (do_resolve_class): Fixed identation.
5233
5234 2000-10-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5235
5236 * gjavah.c (NEED_PEEK_ATTRIBUTE, NEED_SKIP_ATTRIBUTE): Define
5237
5238 * jcf-reader.c (peek_attribute, skip_attribute): Only define
5239 when requested.
5240
5241 * parse.h (yyerror): If JC1_LITE, mark with ATTRIBUTE_NORETURN.
5242
5243 * verify.c (CHECK_PC_IN_RANGE): Cast result of stmt-expr to void.
5244
5245 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
5246
5247 * jcf-write.c (OP1): Update `last_bc'.
5248 (struct jcf_block): Fixed indentation and typo in comments. New
5249 field `last_bc'.
5250 (generate_bytecode_insns): Insert `nop' if `jsr' immediately
5251 follows `monitorenter'.
5252 * parse.y (patch_synchronized_statement): New local `tmp'. Call
5253 `patch_string'.
5254 Fixes gcj/232.
5255
5256 2000-10-16 Tom Tromey <tromey@cygnus.com>
5257
5258 * jvspec.c (lang_specific_driver): Recognize -MF and -MT.
5259 * lang-specs.h: Added %{MA}, %{MF*}, %{MT*}.
5260 * lang-options.h: Added -MA, -MT, -MF..
5261 * lang.c (lang_decode_option): Recognize -MA, -MT, -MF.
5262 (DEPEND_TARGET_SET): New macro.
5263 (DEPEND_FILE_ALREADY_SET): Likewise.
5264 (init_parse): Handle new flags.
5265 * jcf.h (jcf_dependency_print_dummies): Declare.
5266 * Make-lang.in (s-java): Added mkdeps.o.
5267 * Makefile.in (BACKEND): Added mkdeps.o.
5268 (../gcjh$(exeext)): Added mkdeps.o.
5269 (../jcf-dump$(exeext)): Added mkdeps.o.
5270 * jcf-depend.c: Include mkdeps.h.
5271 (struct entry, dependencies, targets, MAX_OUTPUT_COLUMNS,
5272 add_entry): Removed.
5273 (jcf_dependency_reset): Rewrote.
5274 (dependencies): New global.
5275 (jcf_dependency_set_target): Rewrote.
5276 (jcf_dependency_add_target): Likewise.
5277 (jcf_dependency_add_file): Likewise.
5278 (munge): Removed.
5279 (print_ents): Removed.
5280 (jcf_dependency_write): Rewrote.
5281 (print_dummies): New global.
5282 (jcf_dependency_print_dummies): New function
5283 (jcf_dependency_write): Call deps_dummy_targets if required.
5284
5285 2000-10-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
5286
5287 * gjavah.c (add_class_decl): Removed unused variables `tname',
5288 `tlen' and `name_index'.
5289 * java-tree.h (BUILD_FILENAME_IDENTIFIER_NODE): New macro.
5290 * jcf-parse.c (jcf_parse_source): Use it and set EXPR_WFL_FILENAME
5291 in `wfl_operator' with value.
5292 (yyparse): Use BUILD_FILENAME_IDENTIFIER_NODE.
5293 (jcf_figure_file_type): Fixed identation.
5294 * lex.c (java_get_line_col): Use EOF. Tuned `^' placement.
5295 * parse.y (analyze_clinit_body): New function.
5296 (static_initializer:): Reset `current_static_block'.
5297 (java_parser_context_restore_global): Set EXPR_WFL_FIILENAME_NODE in
5298 `wfl_operator' with new value.
5299 (lookup_cl): Use EXPR_WFL_FILENAME.
5300 (maybe_yank_clinit): Handle bogus <clinit> bodies, call
5301 analyze_clinit_body.
5302 (build_outer_field_access): Access to this$<n> built from
5303 current_class, not its outer context.
5304 (build_access_to_thisn): Fixed leading comment. Tidied things up.
5305 (resolve_qualified_expression_name): Handle `T.this' and `T.this.f()'.
5306 (patch_method_invocation): Use `is_static_flag' when already
5307 initialized.
5308 (patch_newarray): Removed assignment in ternary operator.
5309
5310 2000-10-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
5311
5312 * except.c (free_eh_ranges): Don't free `whole_range'.
5313
5314 2000-10-15 Anthony Green <green@redhat.com>
5315
5316 * decl.c (init_decl_processing): Call init_class_processing before
5317 anything else.
5318
5319 2000-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
5320
5321 * check-init.c (check_init): Fixed leading comment. Use
5322 LOCAL_FINAL_P.
5323 * decl.c (push_jvm_slot): Use MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
5324 (give_name_to_locals): Likewise.
5325 (lang_mark_tree): Handle FIELD_DECL. Register `am' and `wfl'
5326 fields in lang_decl_var.
5327 * java-tree.h (DECL_FUNCTION_SYNTHETIC_CTOR,
5328 DECL_FUNCTION_ALL_FINAL_INITIALIZED): New macros.
5329 (FIELD_INNER_ACCESS): Removed ugly cast, macro rewritten.
5330 (FIELD_INNER_ACCESS_P, DECL_FIELD_FINAL_IUD, DECL_FIELD_FINAL_LIIC,
5331 DECL_FIELD_FINAL_IERR, DECL_FIELD_FINAL_WFL): New macros.
5332 (LOCAL_FINAL): Rewritten.
5333 (LOCAL_FINAL_P, FINAL_VARIABLE_P, CLASS_FINAL_VARIABLE_P
5334 MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): New macros.
5335 (struct lang_decl): Fixed comments. Added `synthetic_ctor' and
5336 `init_final' fields.
5337 (struct lang_decl_var): Fixed leading comment. Added `am', `wfl',
5338 `final_uid', `final_liic', `final_ierr' and `local_final' fields.
5339 (TYPE_HAS_FINAL_VARIABLE): New macro.
5340 (struct lang_type): Added `afv' field.
5341 * parse.y (check_static_final_variable_assignment_flag): New function.
5342 (reset_static_final_variable_assignment_flag): Likewise.
5343 (check_final_variable_local_assignment_flag): Likewise.
5344 (reset_final_variable_local_assignment_flag): Likewise.
5345 (check_final_variable_indirect_assignment): Likewise.
5346 (check_final_variable_global_assignment_flag): Likewise.
5347 (add_inner_class_fields): Use LOCAL_FINAL_P.
5348 (register_fields): Handle local finals and final variables.
5349 (craft_constructor): Set DECL_FUNCTION_SYNTHETIC_CTOR.
5350 (declare_local_variables): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
5351 (source_start_java_method): Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC
5352 on local finals.
5353 (java_complete_expand_methods): Loop to set
5354 TYPE_HAS_FINAL_VARIABLE. Call
5355 `reset_final_variable_local_assignment_flag' and
5356 `check_final_variable_local_assignment_flag' accordingly before
5357 and after constructor expansion. Call
5358 `reset_static_final_variable_assignment_flag'
5359 before expanding <clinit> and after call
5360 `check_static_final_variable_assignment_flag' if the
5361 current_class isn't an interface. After all methods have been
5362 expanded, call `check_final_variable_global_assignment_flag' and
5363 `check_static_final_variable_assignment_flag' if the current class
5364 is an interface.
5365 (maybe_yank_clinit): Fixed typo in comment.
5366 (build_outer_field_access_methods): Removed old sanity check. Use
5367 FIELD_INNER_ACCESS_P. Call MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC.
5368 Don't create access methods for finals.
5369 (resolve_field_access): Use `CLASS_FINAL_VARIABLE_P'.
5370 (java_complete_tree): Likewise. Reset DECL_FIELD_FINAL_IUD if
5371 existing DECL_INIT has been processed.
5372 (java_complete_lhs): Likewise.
5373 (check_final_assignment): Filter input on `lvalue''s TREE_CODE.
5374 Test for COMPONENT_REF to get to the FIELD_DECL. Implemented new
5375 logic.
5376 (patch_assignment): Use LOCAL_FINAL_P.
5377 (fold_constant_for_init): Reset DECL_FIELD_FINAL_IUD if
5378 DECL_INITIAL is nullified.
5379 Fixes gcj/163.
5380
5381 2000-10-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5382
5383 * Make-lang.in (parse.c, parse-scan.c): Create atomically.
5384
5385 * Makefile.in (parse.c, parse-scan.c): Likewise.
5386
5387 2000-10-12 Mark Mitchell <mark@codesourcery.com>
5388
5389 * class.c (temporary_obstack): Remove.
5390 (make_class): Don't mess with obstascks.
5391 (push_class): Likewise.
5392 (set_super_info): Likewise.
5393 (add_method_1): Likewise.
5394 (add_method): Likewise.
5395 (add_field): Likewise.
5396 (build_utf8_ref): Likewise.
5397 (build_class_ref): Likewise.
5398 (build_static_field_ref): Likewise.
5399 (finish_class): Likewise.
5400 (push_super_field): Likewise.
5401 (layout_class): Likewise.
5402 (layout_class_methods): Likewise.
5403 (init_class_processing): Likewise.
5404 * constants.c (get_tag_node): Likewise.
5405 (build_constant_data_ref): Likewise.
5406 * decl.c (ggc_p): Remove.
5407 (copy_lang_decl): Use ggc_alloc.
5408 (complete_start_java_method): Don't mess with obstacks.
5409 (start_java_method): Likewise.
5410 (end_java_method): Likewise.
5411 * except.c (link_handler): Use xmalloc.
5412 (free_eh_ranges): New function.
5413 (method_init_exceptions): Use it.
5414 (add_handler): Use xmalloc.
5415 (expand_start_java_handler): Don't mess with obstacks.
5416 (prepare_eh_table_type): Likewise.
5417 (expand_end_java_handler): Likewise.
5418 * expr.c (push_value): Likewise.
5419 (create_label_decl): Likewise.
5420 (build_jni_stub): Likewise.
5421 (java_lang_expand_expr): Likewise.
5422 (note_instructions): Use xrealloc.
5423 (java_push_constant_from_pool): Don't mess with obstacks.
5424 (process_jvm_instruction): Likewise.
5425 * java-tree.h (cyclic_inheritance_report): Remove duplicate
5426 declaration.
5427 * jcf-parse.c (get_constant): Don't mess with obstacks.
5428 (read_class): Likewise.
5429 (jcf_parse): Likewise.
5430 * lex.c (expression_obstack): Remove.
5431 (java_lex): Don't use obstack_free.
5432 * parse.h (exit_java_complete_class): Don't mess with obstacks.
5433 (MANGLE_OUTER_LOCAL_VARIABLE_NAME): Adjust.
5434 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): Likewise.
5435 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STRING): Likewise.
5436 * parse.y (gaol): Add more GC roots.
5437 (add_inner_class_fields): Adjust calls to MANGLE_* macros.
5438 (lookup_field_wrapper): Likewise.
5439 (obtain_incomplete_type): Don't mess with obstacks.
5440 (build_alias_initializer_parameter_list): Adjust calls to MANGLE_*
5441 macros.
5442 (craft_constructor): Don't mess with obstacks.
5443 (safe_layout_class): Likewise.
5444 (java_complete_class): Likewise.
5445 (source_end_java_method): Likewise.
5446 (build_outer_field_access_methods): Likewise.
5447 (build_outer_method_access_method): Likewise.
5448 (maybe_build_thisn_access_method): Likewise.
5449 (build_dot_class_method_invocation): Likewise.
5450 (java_complete_tree): Likewise.
5451 (java_complete_lhs): Likewise.
5452 (do_merge_string_cste): Likewise.
5453 (patch_string_cst): Likewise.
5454 (array_constructor_check_entry): Likewise.
5455 * typeck.c (build_java_array_type): Likewise.
5456 (parse_signature_string): Likewise.
5457 (build_java_signature): Likewise.
5458
5459 2000-10-12 Tom Tromey <tromey@cygnus.com>
5460
5461 Fix for PR gcj/356:
5462 * gjavah.c (add_class_decl): Don't special-case inner classes.
5463 (add_namelet): Likewise.
5464
5465 2000-10-11 Rodney Brown <RodneyBrown@mynd.com>
5466
5467 * java-tree.h: Constify current_encoding.
5468 * lang.c: Constify current_encoding.
5469
5470 2000-10-10 Jeff Sturm <jeff.sturm@appnet.com>
5471
5472 * jvgenmain.c (class_mangling_suffix): Omit `.'.
5473 (main): Use `$' when NO_DOLLAR_IN_LABEL is not set, otherwise `.'.
5474
5475 2000-10-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
5476
5477 * expr.c (java_lang_expand_expr): Reinstall 1999-08-14 Anthony's
5478 patch. Fixes gcj/340.
5479
5480 2000-10-10 Tom Tromey <tromey@cygnus.com>
5481
5482 * lex.c (java_new_lexer): Initialize out_first and out_last
5483 fields.
5484 * lex.h (java_lexer): Added out_buffer, out_first, out_last.
5485
5486 2000-10-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
5487
5488 * parse.y (pop_current_osb): New function.
5489 (array_type:): Use `dims:', changed actions
5490 accordingly. Suggested by Anthony Green.
5491 (array_creation_expression:): Used pop_current_osb.
5492 (cast_expression:): Likewise.
5493 (search_applicable_method_list): Fixed indentation.
5494
5495 2000-10-08 Anthony Green <green@redhat.com>
5496
5497 * parse.y (array_type_literal): Remove production.
5498 (type_literals): Refer to array_type, not array_type_literal.
5499
5500 2000-10-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
5501
5502 Patch contributed by Corey Minyard.
5503 * decl.c (check_local_named_variable): New function.
5504 (tree check_local_unnamed_variable): Likewise.
5505 (find_local_variable): Splitted. Call check_local_{un}named_variable.
5506
5507 2000-10-07 Anthony Green <green@redhat.com>
5508
5509 * class.c (layout_class): Handle case where superclass can't be
5510 layed out yet.
5511
5512 2000-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
5513
5514 * Makefile.in (keyword.h): Refer to GNU FTP site for updated
5515 gperf.
5516
5517 2000-10-05 Tom Tromey <tromey@cygnus.com>
5518
5519 * jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
5520 * jvgenmain.c (class_mangling_prefix): Removed.
5521 (class_mangling_suffix): New global.
5522 (main): Use it.
5523 * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending
5524 `$'.
5525 (print_method_info): Handle overrides for static and final
5526 methods.
5527 (process_file): Generate declaration for class object field.
5528 * class.c (cxx_keywords): New array.
5529 (utf8_cmp): New function.
5530 (cxx_keyword_p): New function.
5531 (layout_class_method): Mangle C++ keywords by appending `$'.
5532 (mangle_field): New function.
5533 (mangle_class_field): Use mangle_field. Mangle class name as
5534 `class$'.
5535 (mangle_static_field): Use mangle_field.
5536
5537 2000-10-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
5538
5539 * decl.c (find_local_variable): Removed uncessary type check and
5540 fixed range check typo. From Corey Minyard.
5541
5542 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
5543
5544 * decl.c (give_name_to_locals): New local `code_offset'. Call
5545 `maybe_adjust_start_pc'.
5546 * expr.c (note_instructions): New function.
5547 (expand_byte_code): Don't collect insn starts here.
5548 (peek_opcode_at_pc): New function.
5549 (maybe_adjust_start_pc): Likewise.
5550 * java-tree.h (maybe_adjust_start_pc): Declare.
5551 (note_instructions): Likewise.
5552 * jcf-parse.c (parse_class_file): Call `note_instructions'.
5553
5554 2000-09-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
5555
5556 * parse.y (field_access:): Fixed indentation.
5557 (qualify_ambiguous_name): Properly qualify `this.a[b].c'.
5558
5559 2000-09-07 Tom Tromey <tromey@cygnus.com>
5560
5561 Fix for PR gcj/307:
5562 * parse.y (patch_binop): Use JNUMERIC_TYPE_P, not
5563 JPRIMITIVE_TYPE_P, for arithmetic operators.
5564 (patch_method_invocation): Indentation fix.
5565 (try_builtin_assignconv): Handle boolean specially. Fixed typo.
5566 (valid_builtin_assignconv_identity_widening_p): Handle boolean.
5567 (do_unary_numeric_promotion): Cleaned up code.
5568 (valid_cast_to_p): Handle boolean correctly.
5569
5570 2000-09-27 Tom Tromey <tromey@cygnus.com>
5571
5572 * lex.c (java_read_unicode): Reset bs_count when finished with
5573 `\u' sequence.
5574
5575 2000-10-01 Mark Mitchell <mark@codesourcery.com>
5576
5577 Convert to GC.
5578 * Make-lang.in (s-java): Don't depend on ggc-callbacks.o.
5579 * Makefile.in (BACKEND): Don't include ggc-callbacks.o.
5580 (typeck.o): Depend on ggc.h.
5581 * class.c (add_method_1): Use GC functions for allocation.
5582 (init_class_processing): Register roots.
5583 * decl.c (ggc_p): Set to 1.
5584 (pending_local_decls): Make it static.
5585 (push_jvm_slot): Use GC functions for allocation.
5586 (init_decl_processing): Register roots.
5587 (give_name_to_locals): Use GC functions for allocation.
5588 (lang_mark_tree): New function.
5589 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Use GC
5590 functions for allocation.
5591 * jcf-parse.c (jcf_parse_source): Use ggc_strdup.
5592 * lex.c (java_lex): Use build_string, rather than replicating it
5593 inline.
5594 * parse.y (goal): Add more roots.
5595 (mark_parser_ctxt): New function.
5596 * typeck.c: Include ggc.h.
5597
5598 2000-09-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
5599
5600 * parse.y (maybe_yank_clinit): Also keep <clinit> if its body
5601 contains something else than MODIFY_EXPR.
5602
5603 2000-09-23 Mark Mitchell <mark@codesourcery.com>
5604
5605 * Make-lang.in (JAVA_SRCS): Include java-tree.h.
5606 * Makefile.in (parse.o): Depend on ggc.h.
5607 (class.o): Likewise.
5608 (constants.o): Likewise.
5609 (decl.o): Likewise.
5610 (expr.o): Likewise.
5611 (jcf-parse.o): Likewise.
5612 (jcf-write.o): Likewise.
5613 (mangle.o): Likewise.
5614 * class.c: Include ggc.h.
5615 (build_static_field_ref): Register GC roots.
5616 (layout_class): Likewise.
5617 (init_class_processing): Likewise.
5618 * constants.c: Include ggc.h.
5619 (current_constant_pool_data_ref): Remove.
5620 (tag_nodes): Move it to ...
5621 (get_tag_node): ... here. Register GC roots.
5622 * decl.c: Include ggc.h. Remove many global tree definitions.
5623 (throw_node): Define.
5624 (java_global_trees): Likewise.
5625 (predef_filenames): Make the size a constant.
5626 (init_decl_processing): Adjust accordingly.
5627 (init_decl_processing): Call init_jcf_parse. Register GC roots.
5628 * expr.c: Include ggc.h.
5629 (init_expr_processing): Register GC roots.
5630 (build_invokeinterface): Likewise.
5631 * java-tree.h: Replace extern tree declarations with macros.
5632 (java_global_trees): New variable.
5633 (java_tree_index): New enumeration.
5634 (init_jcf_parse): Declare.
5635 * jcf-parse.c: Include ggc.h.
5636 (current_class): Remove declaration.
5637 (main_class): Likewise.
5638 (all_class_list): Likewise.
5639 (predefined_filename_p): Adjust for constant size of
5640 predef_filenames.
5641 (init_jcf_parse): New function.
5642 * jcf-write.c: Include ggc.h.
5643 (generate_classfile): Register GC roots.
5644 (append_synthetic_attribute): Likewise.
5645 (append_innerclass_attribute_entry): Likewise.
5646 * lang.c: Include ggc.h.
5647 (lang_print_error): Register GC roots.
5648 * parse.h (struct parser_ctxt): Rename fields to avoid conflicts
5649 with macros.
5650 * parse.y: Include ggc.h.
5651 (wfl_operator): Remove.
5652 (goal): Register GC roots.
5653 (java_pop_parser_context): Adjust for new field names.
5654 (java_parser_context_save_global): Likewse.
5655 (java_parser_context_restore_global): Likewise.
5656 (java_parser_context_suspend): Likewise.
5657 (java_parser_context_resume): Likewise.
5658 (verify_constructor_circularity): Register GC roots.
5659 (lookup_cl): Likewise.
5660 (java_reorder_fields): Likewise.
5661 (build_current_this): Likewise.
5662 (class_in_current_package): Likewise.
5663 (argument_types_convertible): Likewise.
5664 (patch_cast): Rename wfl_op parameter to avoid macro conflicts.
5665
5666 2000-09-14 Tom Tromey <tromey@cygnus.com>
5667
5668 * lex.h: Use HAVE_ICONV_H, not HAVE_ICONV.
5669
5670 2000-09-13 Tom Tromey <tromey@cygnus.com>
5671
5672 * jcf-parse.c: Include <locale.h>.
5673 * jv-scan.c: Include <locale.h>.
5674
5675 2000-09-12 Tom Tromey <tromey@cygnus.com>
5676
5677 * expr.c (pop_type_0): Return `Object' if trying to merge two
5678 interface types.
5679 * verify.c (merge_types): Don't return `TYPE_UNKNOWN' for
5680 interface types; `Object' is always a valid supertype.
5681
5682 2000-09-12 Tom Tromey <tromey@cygnus.com>
5683
5684 Fix for PR gcj/33:
5685 * jv-scan.c (help): Document --encoding.
5686 (options): Added `encoding' entry.
5687 (OPT_ENCODING): New define.
5688 (main): Handle --encoding.
5689 Include <langinfo.h> if nl_langinfo exists.
5690 * lang-options.h: Document --classpath, --CLASSPATH, --main, and
5691 --encoding.
5692 * jcf-parse.c Include <langinfo.h> if we have nl_langinfo.
5693 (parse_source_file): Correctly call java_init_lex. Added `finput'
5694 argument. Use nl_langinfo to determine default encoding.
5695 * java-tree.h (current_encoding): Declare.
5696 * parse.y (java_parser_context_restore_global): Don't restore
5697 `finput'.
5698 (java_parser_context_save_global): Don't set `finput' field.
5699 (java_pop_parser_context): Don't restore `finput'. Free old lexer
5700 if required.
5701 * lang.c (current_encoding): New global.
5702 (lang_decode_option): Recognize `-fencoding='.
5703 (finish_parse): Don't close finput.
5704 * parse.h (struct parser_ctxt): Removed `finput' and
5705 `unget_utf8_value' fields. Added `lexer' field.
5706 (java_init_lex): Fixed declaration.
5707 * lex.c (java_new_lexer): New function.
5708 (java_destroy_lexer): Likewise.
5709 (java_read_char): Added `lex' argument. Handle iconv case.
5710 (java_read_unicode): Added `lex' argument. Count backslashes in
5711 lexer structure.
5712 (java_init_lex): Added `finput' and `encoding' arguments. Set
5713 `lexer' field in ctxp.
5714 (BAD_UTF8_VALUE): Removed.
5715 (java_lex): Handle seeing UEOF in the middle of a string literal.
5716 * lex.h: Include <iconv.h> if HAVE_ICONV defined.
5717 (java_lexer): New structure.
5718 (UNGETC): Removed.
5719 (GETC): Removed.
5720 (DEFAULT_ENCODING): New define.
5721 (java_destroy_lexer): Declare.
5722
5723 2000-09-12 Tom Tromey <tromey@cygnus.com>
5724
5725 Fix for PR gcj/343:
5726 * lex.c (java_init_lex): Initialize java_io_serializable.
5727 * parse.y (java_io_serializable): New global.
5728 (valid_ref_assignconv_cast_p): An array can be cast to
5729 serializable.
5730
5731 2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
5732
5733 * decl.c, expr.c: Include defaults.h if not already included.
5734 Don't define the *_TYPE_SIZE macros.
5735
5736 2000-09-09 Geoffrey Keating <geoffk@cygnus.com>
5737
5738 * typeck.c (build_java_array_type): Correct first parameter
5739 in ADJUST_FIELD_ALIGN invocation.
5740
5741 2000-09-06 Tom Tromey <tromey@cygnus.com>
5742
5743 * lang-specs.h: Also recognize `-femit-class-files'.
5744
5745 2000-09-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
5746
5747 * verify.c (merge_types): Load the types to merge if necessary.
5748
5749 2000-09-02 Anthony Green <green@redhat.com>
5750
5751 * jcf-io.c: Include zlib.h.
5752 (open_in_zip): Read compressed class file archives.
5753 * zipfile.h (ZipDirectory): Add uncompressed_size and
5754 compression_method fields.
5755 * zextract.c (read_zip_archive): Collect file compression info.
5756
5757 2000-08-15 Bryce McKinlay <bryce@albatross.co.nz>
5758
5759 * parse.y (do_resolve_class): Also explore superclasses of
5760 intermediate enclosing contexts when searching for inner classes.
5761
5762 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
5763
5764 * parse.y (variable_declarator_id:): Better error message.
5765 (expression_statement:): Use YYNOT_TWICE.
5766 (cast_expression:): Likewise.
5767 (assignment:): Likewise.
5768
5769 2000-08-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
5770
5771 * parse.y (do_merge_string_cste): New locals. Create new
5772 STRING_CSTs each time, use memcpy. Fixes gcj/311.
5773
5774 2000-08-07 Hans Boehm <boehm@acm.org>
5775
5776 * boehm.c (mark_reference_fields): Set marking bits for all words in
5777 a multiple-word record.
5778 (get_boehm_type_descriptor): Use the procedure marking descriptor for
5779 java.lang.Class.
5780
5781 2000-08-31 Mike Stump <mrs@wrs.com>
5782
5783 * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext),
5784 jcf-dump$(exeext)): Make parallel safe.
5785
5786 2000-08-29 Zack Weinberg <zack@wolery.cumb.org>
5787
5788 * jcf-parse.c (set_source_filename): Constify a char *.
5789 * jcf-write.c (append_innerclasses_attribute,
5790 make_class_file_name): Constify a char *. Don't recycle a
5791 variable for an unrelated purpose.
5792 * parse.y: (build_alias_initializer_parameter_list): Constify a char *.
5793 (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings.
5794
5795 2000-08-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
5796
5797 * expr.c (can_widen_reference_to): Fixed indentation.
5798 * java-tree.h (CLASS_METHOD_CHECKED_P): Added leading comment.
5799 * parse.y: `finit$' replaces `$finit$' in comments.
5800 (try_builtin_assignconv): Fixed leading comment.
5801
5802 2000-08-25 Greg McGary <greg@mcgary.org>
5803
5804 * gjavah.c (cxx_keyword_subst): Use ARRAY_SIZE.
5805
5806 2000-08-24 Greg McGary <greg@mcgary.org>
5807
5808 * lang.c (lang_decode_option): Use ARRAY_SIZE.
5809 * parse.y (BINOP_LOOKUP): Likewise.
5810
5811 2000-08-22 Andrew Haley <aph@cygnus.com>
5812
5813 * javaop.h (WORD_TO_INT): Mask lower 32 bits of a jword before
5814 sign extending. Fixes gcj/321.
5815 * jcf-parse.c (get_constant): Mask lower 32 bits of a jint before
5816 combining to make a jlong. Fixes gcj/321.
5817
5818 2000-08-21 Nix <nix@esperi.demon.co.uk>
5819
5820 * lang-specs.h: Do not process -o or run the assembler if
5821 -fsyntax-only.
5822
5823 2000-08-16 Andrew Haley <aph@cygnus.com>
5824
5825 * typeck.c (build_java_array_type): Rewrite code to do array
5826 alignment. Take into account back-end macros when aligning array
5827 data. Remove setting of TYPE_USER_ALIGN; Java doesn't allow the
5828 user to set alignment. Fixes gcj/252 and 160.
5829
5830 2000-08-09 Tom Tromey <tromey@cygnus.com>
5831
5832 * parse.y (check_abstract_method_definitions): Now return `int'.
5833 Check implemented interfaces. Fixes PR gcj/305.
5834
5835 * parse.y (patch_switch_statement): Disallow `long' in switch
5836 expressions. Fixes PR gcj/310.
5837
5838 2000-08-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
5839
5840 * decl.c (finit_leg_identifier_node): New global.
5841 (init_decl_processing): Use `finit$' to initialize
5842 finit_identifier_node. Use `$finit$' to initialize
5843 finit_leg_identifier_node.
5844 * expr.c (expand_java_field_op): Use ID_FINIT_P.
5845 * java-tree.h (finit_identifier_node): Changed attached comment.
5846 (finit_leg_identifier_node): New declaration.
5847 (ID_FINIT_P): Take finit_identifier_node and
5848 finit_leg_identifier_node into account. This is a backward
5849 compatibility hack.
5850
5851 2000-08-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
5852
5853 * jcf-write.c (generate_bytecode_conditional): Re-installed lost
5854 Jan 6 2000 patch.
5855 (generate_bytecode_insns): Check `nargs' before emitting it.
5856 * verify.c (merge_type_state): Fixed typo.
5857 * ChangeLog: Fixed typo in some jcf-write.c entries mentioning
5858 generate_bytecode_{conditional,insns}.
5859
5860 2000-08-13 Anthony Green <green@redhat.com>
5861
5862 * check-init.c (check_init): Add case for BIT_FIELD_REF (required
5863 for -pg builds).
5864
5865 2000-08-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
5866
5867 * class.c (maybe_layout_super_class): Fixed indentation.
5868 * java-tree.h (CLASS_METHOD_CHECKED_P): New macro.
5869 (java_check_methods): New function declaration.
5870 * jcf-parse.c (get_constant): Let `char_len' go up to 3. Use `str'
5871 instead of `str_ptr'.
5872 * jcf-write.c (generate_bytecode_insns): Emit number the of args
5873 of a `invokeinterface' at the right time.
5874 * parse.h (WFL_STRIP_BRACKET): New macro.
5875 (SET_TYPE_FOR_RESOLUTION): Use it.
5876 * parse.y (build_unresolved_array_type): Reuse `type_or_wfl'.
5877 (check_class_interface_creation): Don't check for cross package
5878 innerclass name clashes.
5879 (method_header): Behave properly if MDECL is `error_mark_node'.
5880 (method_declarator): Return `error_mark_node' if bogus current
5881 class.
5882 (resolve_class): Apply WFL_STRIP_BRACKET on `cl' if necessary.
5883 (resolve_and_layout): New local `decl_type', set and used. Call
5884 java_check_methods.
5885 (java_check_methods): New method.
5886 (java_layout_classes): Use it.
5887 (resolve_qualified_expression_name): No EH check necessary in
5888 access$<n>.
5889 (java_complete_lhs): Use VAR_DECL's DECL_INITIAL when evaluating
5890 `case' statement.
5891 (patch_assignment): Set DECL_INITIAL on integral final local.
5892
5893 2000-08-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
5894
5895 * java-tree.h (flag_extraneous_semicolon): New extern.
5896 * lang-options.h: (-Wextraneous-semicolon): New option.
5897 * lang.c (flag_redundant): Fixed typo in leading comment.
5898 (flag_extraneous_semicolon): New global.
5899 (lang_decode_option): Set `flag_extraneous_semicolon' when
5900 -Wall. Decode `-Wextraneous-semicolon'.
5901 * parse.y (type_declaration:): Removed `SC_TK' hack, added
5902 `empty_statement' rule.
5903 (class_body_declaration): Likewise.
5904 (method_body:): Accept `;' as a method body.
5905 (static_initializer:): Removed `SC_TK' hack.
5906 (constructor_block_end:): Likewise.
5907 (empty_statement:): Report deprecated empty declaration. Fixes
5908 gcj/295
5909
5910 2000-08-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
5911
5912 * parse.y (build_dot_class_method_invocation): Changed parameter
5913 name to `type'. Build signature from `type' and convert it to a
5914 STRING_CST if it's an array.
5915 (patch_incomplete_class_ref): `build_dot_class_method_invocation'
5916 to use `ref_type' directly.
5917
5918 2000-08-06 Ovidiu Predescu <ovidiu@cup.hp.com>
5919
5920 * lang-options.h: Added a comma after the last element to avoid
5921 syntax errors when other languages define additional options.
5922
5923 2000-08-04 Zack Weinberg <zack@wolery.cumb.org>
5924
5925 * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist.
5926 * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS.
5927 (jc1): Link with $(BACKEND).
5928 (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND).
5929
5930 2000-08-02 Zack Weinberg <zack@wolery.cumb.org>
5931
5932 * jvspec.c: Adjust type of second argument to
5933 lang_specific_driver, and update code as necessary.
5934
5935 * class.c (build_dtable_decl): Initialize dummy.
5936
5937 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
5938
5939 * parse.y (maybe_yank_clinit): When generating bytecode: non empty
5940 method bodies not to rule out discarding `<clinit>'; don't use
5941 <clinit> to initialize static fields with constant initializers.
5942
5943 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
5944
5945 * gjavah.c (print_method_info): Added `synth' parameter. Skip
5946 synthetic methods.
5947 (method_synthetic): New global.
5948 (HANDLE_METHOD): Recognize synthetic method and tell
5949 `print_method_info' about it.
5950 (HANDLE_END_METHOD): Do not issue an additional `;\n' if we're
5951 processing a synthetic method.
5952 * jcf-reader.c (skip_attribute): New function.
5953 ( skip_attribute): Likewise.
5954
5955 2000-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
5956
5957 * parse.y (build_outer_field_access): Fixed comments.
5958 (fix_constructors): Emit the initialization of this$<n> before
5959 calling $finit$.
5960 (resolve_qualified_expression_name): Build an access to `decl' if
5961 necessary.
5962
5963 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
5964
5965 * parse-scan.y (curent_class): Non longer const.
5966 (inner_qualifier, inner_qualifier_length): Deleted.
5967 (current_class_length): New global.
5968 (bracket_count): Fixed typo in leading comment.
5969 (anonymous_count): New global.
5970 (class_instance_creation_expression:): Handle anonymous classes.
5971 (anonymous_class_creation:): New rule.
5972 (push_class_context): Rewritten.
5973 (pop_class_context): Likewise.
5974 (INNER_QUALIFIER): Macro deleted.
5975 (report_class_declaration): call `push_class_context' when
5976 entering the function. `fprintf' format modified not to use
5977 INNER_QUALIFIER.
5978 (report_class_declaration): Assign `package_name' and
5979 `current_class' to NULL separately.
5980
5981 2000-07-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
5982
5983 * expr.c (build_invokeinterface): Call layout_class_methods on
5984 target interface.
5985
5986 2000-07-27 Tom Tromey <tromey@cygnus.com>
5987 Anthony Green <green@cygnus.com>
5988 Alexandre Petit-Bianco <apbianco@cygnus.com>
5989
5990 * class.c (make_class_data): Create vtable for abstract classes.
5991 (get_dispatch_table): Changed to cope with abstract classes.
5992
5993 2000-07-27 Tom Tromey <tromey@cygnus.com>
5994
5995 * parse.y (patch_method_invocation): Don't reverse the argument
5996 list when dealing with anonymous class constructors. Fixed typo in
5997 comment.
5998
5999 2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
6000
6001 * parse.y (build_alias_initializer_parameter_list): Reverse
6002 crafted list when building aliases for anonymous class
6003 constructors.
6004
6005 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
6006
6007 * parse.y (jdep_resolve_class): Don't bother checking potential
6008 innerclass access if `decl' is NULL.
6009 (find_in_imports_on_demand): TREE_PURPOSE of `import' contains the
6010 WFL.
6011
6012 2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
6013
6014 * parse.c: Remove (again.)
6015
6016 2000-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
6017
6018 * parse.y (find_as_inner_class): Removed 2000-07-19 patches.
6019 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Local `decl' moved
6020 outside the `if' statement, alias to innerclass removed, `decl'
6021 used to mark the class complete.
6022
6023 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
6024
6025 * parse.y (simple_name:): Fixed typo in error message.
6026
6027 2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
6028
6029 * parse.y (java_complete_lhs): LOOP_EXPR:, SWITCH_EXPR: the node
6030 or its first operand can be error marks.
6031
6032 2000-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
6033
6034 * parse.h (SET_TYPE_FOR_RESOLUTION): Use GET_CPC.
6035 * parse.y (method_header): Likewise.
6036
6037 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
6038
6039 * parse.y (process_imports): Consider that one might be trying to
6040 import an innerclass. Fixes gcj/254
6041
6042 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
6043
6044 * parse.y (find_as_inner_class): Handle the case where the
6045 enclosing context of an innerclass has been loaded as bytecode.
6046
6047 2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
6048
6049 * parse.y (simple_name:): Reject `$' in type names.
6050 (resolve_type_during_patch): Use `type' as a second
6051 argument to resolve_no_layout. Fixes gcj/257.
6052
6053 2000-07-18 Bryce McKinlay <bryce@albatross.co.nz>
6054
6055 * parse.y (find_most_specific_methods_list): Select the only
6056 non-abstract method even if max has been set.
6057 Fixes gcj/285, gcj/298.
6058
6059 2000-07-18 Jeff Sturm <jeff.sturm@appnet.com>
6060
6061 * lang-specs.h: Added %(jc1) to java compiler options.
6062
6063 2000-07-14 Zack Weinberg <zack@wolery.cumb.org>
6064
6065 * .cvsignore: New file.
6066
6067 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6068
6069 * parse.y (not_accessible_p): Access granted to innerclasses
6070 (indirectly) extending the reference type. Fixes gcj/249.
6071
6072 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6073
6074 * parse.y (patch_method_invocation): Fixed comment.
6075 (maybe_use_access_method): Build this$<n>s to the context of the
6076 target method, or a type that extends it. Fixes gcj/242.
6077
6078 2000-07-13 Mark Mitchell <mark@codesourcery.com>
6079
6080 * parse.c: Remove.
6081
6082 2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6083
6084 * parse.y (fold_constant_for_init): Avoid bullish conversion.
6085
6086 2000-07-13 Tom Tromey <tromey@cygnus.com>
6087
6088 * lang-specs.h: Added %{I*}.
6089
6090 2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
6091
6092 * lang-specs.h: Use the new named specs. Remove unnecessary braces.
6093
6094 2000-07-12 Mark Mitchell <mark@codesourcery.com>
6095
6096 * parse-scan.c: Remove.
6097
6098 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
6099
6100 * class.c (set_super_info): Handled protected inner classes.
6101 (common_enclosing_context_p): Bail early if arguments aren't both
6102 inner classes.
6103 (get_access_flags_from_decl): Handle private and protected inner
6104 classes.
6105 * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro.
6106 (CLASS_PROTECTED): Likewise.
6107 (struct lang_type): New bitfield `poic'.
6108 * parse.y (jdep_resolve_class): Call check_inner_class_access on
6109 inner classes only.
6110 (check_inner_class_access): Renamed arguments, added
6111 comments. Handles protected inner classes (fixes gcj/225)
6112 (not_accessible_p): Fixed comments. Avoid handling inner classes.
6113
6114 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
6115
6116 * parse.y (resolve_qualified_expression_name): Verify qualified
6117 access to `this'. Fixes gcj/239.
6118
6119 2000-07-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
6120
6121 * jcf-write.c (generate_classfile): Don't install ConstantValue
6122 for null pointers.
6123
6124 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
6125
6126 * parse.y (resolve_qualified_expression_name): Handle inner class
6127 access. Fixes gcj/256.
6128
6129 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
6130
6131 * jcf-write.c (generate_classfile): Properly install the
6132 ConstantValue attribute and the initial value constant pool index
6133 on string constants.
6134 * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
6135 class files.
6136
6137 2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
6138
6139 * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
6140 construct.
6141 * parse.y (find_as_inner_class): Fixed typo.
6142 (do_resolve_class): Explore enclosing contexts when searching for
6143 innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
6144 (check_inner_class_access): Check `decl' which can be null in case
6145 of previous errors.
6146
6147 2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6148
6149 * java-tree.h (java_debug_context): Declared `extern'.
6150 (safe_layout_class): Likewise.
6151 * parse.y (resolve_field_access): Field must be `static' in order
6152 to be replaced by its initial value. Added comments.
6153 (find_applicable_accessible_methods_list): Fixed typo.
6154 (find_most_specific_methods_list): Methods found in innerclasses
6155 take over methods founds in the enclosing contexts.
6156 (java_complete_tree): Loosen restrictions on the type of DECLs
6157 that can be replaced by their initialization values.
6158 (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p'.
6159
6160 2000-07-05 Tom Tromey <tromey@cygnus.com>
6161
6162 * Make-lang.in (PARSE_DIR): New macro.
6163 (PARSE_RELDIR): Likewise.
6164 (PARSE_C): Likewise.
6165 (PARSE_SCAN_C): Likewise.
6166 ($(PARSE_C)): New target.
6167 ($(PARSE_SCAN_C)): Likewise.
6168 (SET_BISON): New macro.
6169 (BISONFLAGS): Likewise.
6170 (JAVABISONFLAGS): Likewise.
6171
6172 2000-07-02 Bryce McKinlay <bryce@albatross.co.nz>
6173
6174 * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
6175 argument on the first pass for CNI as well as JNI.
6176 (print_method_info): Set up method name on the first pass only.
6177
6178 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
6179
6180 * parse.y (parser_qualified_classname): Removed parameter
6181 `is_static'.
6182 (create_interface): Removed first passed parameter to
6183 parser_qualified_classname.
6184 (create_class): Likewise. Don't install alias on static
6185 innerclasses. Fixes gcj/275.
6186
6187 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
6188
6189 * parse.y (maybe_generate_pre_expand_clinit): Don't build a
6190 debugable statement with empty_stmt_node. Fixes gcj/272
6191
6192 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
6193
6194 * expr.c (build_instanceof): Layout type after it's loaded. Fixes
6195 gcj/271.
6196
6197 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
6198
6199 * jcf-write.c (push_long_const): Appropriately cast short negative
6200 constant to jword.
6201
6202 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
6203
6204 * parse.y (verify_constructor_super): Use loop variable
6205 `m_arg_type' initialized with `mdecl_arg_type'.
6206
6207 2000-06-29 Tom Tromey <tromey@cygnus.com>
6208
6209 * parse.y (resolve_field_access): Handle case where `type_found'
6210 is NULL.
6211
6212 2000-06-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
6213
6214 * expr.c (lookup_field): The same field can be found through two
6215 different interface. Don't declare it ambiguous in that case.
6216
6217 2000-06-27 Tom Tromey <tromey@cygnus.com>
6218
6219 * lex.c (java_lineterminator): Don't recognize \r after \n. If \r
6220 follows \r, then unget it at a lower level.
6221
6222 2000-06-26 Tom Tromey <tromey@cygnus.com>
6223
6224 * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to
6225 java_complete_tree.
6226
6227 2000-06-25 Tom Tromey <tromey@cygnus.com>
6228
6229 * parse.y (for_statement): Wrap expression in a WFL if it is a
6230 constant. For PR gcj/268.
6231
6232 2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
6233
6234 * parse.y (do_resolve_class): Minor optimiztion in the package
6235 list search. Removed unnecessary test and return statement.
6236 (valid_ref_assignconv_cast_p): Order of arguments to
6237 enclosing_context_p fixed.
6238
6239 2000-06-24 Tom Tromey <tromey@cygnus.com>
6240
6241 * expr.c (lookup_field): Print error and return error_mark_node if
6242 field reference is ambiguous.
6243
6244 * parse.y (check_abstract_method_definitions): Also check if
6245 `other_method' is abstract.
6246
6247 2000-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
6248
6249 * class.c (set_super_info): Handle ACC_PRIVATE for (inner)
6250 classes.
6251 * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro.
6252 (struct lang_type): New field `pic'.
6253 (CLASS_PRIVATE): New macro.
6254 * parse.y (check_inner_class_access): New function.
6255 (jdep_resolve_class): Call it.
6256
6257 2000-06-23 Tom Tromey <tromey@cygnus.com>
6258
6259 * parse.y (patch_incomplete_class_ref): Initialize the returned
6260 class. For PR gcj/260.
6261
6262 2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
6263
6264 * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'.
6265
6266 2000-06-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
6267
6268 * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
6269 Java specific checks.
6270 * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage
6271 screened by DECL_P.
6272 * java-tree.def (CASE_EXPR): Marked 'e'.
6273 (DEFAULT_EXPR): Likewise.
6274 * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage
6275 screened by DECL_P.
6276 * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for
6277 Java specific checks.
6278 (generate_bytecode_insns): Test try_block for BLOCK before using
6279 BLOCK_EXPR_BODY.
6280 * parse.y (build_wfl_wrap): Added `location' argument. Set
6281 EXPR_WFL_LINECOL accordingly.
6282 (dim_expr:): Wrap constants with WFLs.
6283 (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC.
6284 (resolve_package): Check for `stmt' not being a BLOCK before
6285 building a debuggable statement with it.
6286 (make_qualified_primary): Added extra parameter to build_wfl_wrap
6287 invocation.
6288 (resolve_field_access): Make sure `decl' is a DECL before treating
6289 it as such.
6290 (maybe_build_primttype_type_ref): Make sure `wfl''s node is an
6291 IDENTIFIER_NODE before treating it as such.
6292 (patch_new_array_init): Make sure `elt' is a TREE_LIST before
6293 treating it as such.
6294 (find_applicable_accessible_methods_list): CLASS_INTERFACE macro
6295 to be applied only on non array types.
6296
6297 2000-06-16 Per Bothner <per@bothner.com>
6298
6299 * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN): Don't
6300 define in terms of DECL_RESULT, as that fails when --enable-checking.
6301
6302 2000-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6303
6304 * jcf-write.c (CHECK_PUT): Add static prototype. Make pointer
6305 types the same in comparison.
6306 (CHECK_OP): Add static prototype.
6307
6308 2000-06-13 Jakub Jelinek <jakub@redhat.com>
6309
6310 * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN.
6311 * parse.y (java_complete_class): Set DECL_USER_ALIGN.
6312 * parse.c: Rebuilt.
6313
6314 2000-06-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6315
6316 * decl.c (create_primitive_vtable): Prototype.
6317
6318 * jcf-write.c (generate_bytecode_insns): Initialize variable
6319 `saved_context'.
6320
6321 * lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
6322
6323 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
6324
6325 * parse.y (find_applicable_accessible_methods_list): Use a hashtable
6326 to track searched classes, and do not search the same class more than
6327 once. Call find_applicable_accessible_methods_list on immediate
6328 superclass, instead of search_applicable_method_list on all ancestors.
6329 Fix for PR gcj/238.
6330
6331 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz>
6332
6333 * parse.y (register_fields): Permit static fields in inner classes
6334 if they are final. Fix for PR gcj/255.
6335
6336 2000-06-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
6337
6338 * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries.
6339 * parse.y (find_in_imports): Returned type changed to void,
6340 leading comment fixed.
6341 (register_package): New function.
6342 (qualify_and_find): Likewise.
6343 (package_declaration:): Use `register_package'.
6344 (single_type_import_declaration:): Removed local variable
6345 `node'. Added missing `;' for consistency.
6346 (type_import_on_demand_declaration:): Use `chainon' to link new
6347 entries.
6348 (lookup_field_wrapper): Lookup local variables defined in outer
6349 contexts first.
6350 (java_complete_class): Don't reverse the list of imported on demand.
6351 (do_resolve_class): Reorganized. Removed local variable
6352 `original_name'. Call `qualify_and_find' with the current package
6353 name, invoke `find_in_imports_on_demand' right after. Call
6354 `qualify_and_find' with the packages we've seen so far. Fixed
6355 operations numbering in comments.
6356 (java_expand_class): Don't reverse `package_list'.
6357 (find_most_specific_methods_list): New local variables `abstract'
6358 and `candidates'. Use them to pick the right method.
6359
6360 2000-06-06 Tom Tromey <tromey@ferrule.cygnus.com>
6361
6362 * parse.y (check_modifiers_consistency): Don't subtract out
6363 `PUBLIC_TK' from argument to THIS_MODIFIER_ONLY.
6364
6365 2000-06-04 Philipp Thomas <pthomas@suse.de>
6366
6367 * Makefile.in (INTLLIBS): New.
6368 (LIBS): Add above.
6369 (DEPLIBS): Ditto.
6370
6371 2000-06-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
6372
6373 * class.c (get_dispatch_table): Build the vtable dummy entry list
6374 element with a null purpose. Fixed leading comment.
6375 (build_dtable_decl): Build an accurate dtable type when appropriate
6376 and use it.
6377
6378 2000-06-02 Richard Henderson <rth@cygnus.com>
6379
6380 * lang.c (lang_get_alias_set): New.
6381
6382 2000-05-31 Alexandre Petit-Bianco <apbianco@cygnus.com>
6383
6384 * parse.y (resolve_field_access): Complete the DECL_INITIAL tree
6385 before using it as the accessed field.
6386
6387 2000-05-31 Tom Tromey <tromey@cygnus.com>
6388
6389 * java-tree.h (boolean_array_vtable, byte_array_vtable,
6390 char_array_vtable, short_array_vtable, int_array_vtable,
6391 long_array_vtable, float_array_vtable, double_array_vtable):
6392 Declare.
6393 * expr.c (get_primitive_array_vtable): New function.
6394 (create_primitive_vtable): New function.
6395 (java_lang_expand_expr): Enable code to statically generate
6396 arrays.
6397 * decl.c (init_decl_processing): Create primitive vtables.
6398 (boolean_array_vtable, byte_array_vtable, char_array_vtable,
6399 short_array_vtable, int_array_vtable, long_array_vtable,
6400 float_array_vtable, double_array_vtable): Define.
6401
6402 2000-05-26 Zack Weinberg <zack@wolery.cumb.org>
6403
6404 * java/parse.y (find_applicable_accessible_methods_list):
6405 Don't add an uninitialized value to the list.
6406
6407 2000-05-25 Tom Tromey <tromey@cygnus.com>
6408
6409 * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC
6410 when trying to see if field's class should be initialized. Always
6411 initialize field's declaring class, not qualified class.
6412 For PR gcj/162.
6413
6414 * parse.y (array_constructor_check_entry): Pass `wfl_value', not
6415 `wfl_operator', to maybe_build_primttype_type_ref.
6416 Fixes PR gcj/235.
6417
6418 2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
6419
6420 * parse.y (patch_method_invocation): Don't try to lookup methods
6421 in primitive types.
6422
6423 2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
6424
6425 * parse.y (resolve_field_access): Call the appropriate <clinit>
6426 before accessing the length of a static array. Craft a decl for
6427 the field while its time. Fixes PR gcj/129.
6428
6429 2000-05-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
6430
6431 * parse.y (resolve_package): Correctly set `*next' (was off by
6432 one.)
6433 (resolve_qualified_expression_name): Fixed comment.
6434
6435 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
6436
6437 * jcf-parse.c (jcf_parse_source): Reset current_class and
6438 current_function_decl to NULL before parsing a new file.
6439
6440 2000-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
6441
6442 * parse.y (block_end:): If the collected block doesn't feature a
6443 statement, insert an empty statement.
6444
6445 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
6446
6447 * parse.y (maybe_yank_clinit): New function.
6448 (maybe_generate_pre_expand_clinit): Always link <clinit> at the
6449 end of the list of methods belonging to a class.
6450 (java_complete_expand_method): Check whether <clinit> is really
6451 necessary and expand it accordingly.
6452
6453 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
6454
6455 * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be
6456 processed by the method's switch statement.
6457
6458 2000-05-19 Tom Tromey <tromey@cygnus.com>
6459
6460 * java-tree.h: Added init state enum.
6461 * decl.c (emit_init_test_initialization): Initialize class
6462 initialization check variable by looking at class' state.
6463
6464 2000-05-19 Tom Tromey <tromey@cygnus.com>
6465
6466 * java-tree.h (build_instanceof): Declare.
6467 (build_get_class): Declare.
6468 * parse.y (patch_binop): Use build_instanceof.
6469 * expr.c (build_instanceof): New function. If class is final,
6470 don't make a function call.
6471 (expand_java_INSTANCEOF): Use it.
6472 (build_get_class): New function.
6473
6474 2000-05-18 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
6475
6476 * jcf-write.c (generate_classfile): Scan the source_file for
6477 slashes with the right pointer variable.
6478
6479 2000-05-17 Andrew Cagney <cagney@b1.cygnus.com>
6480
6481 * lang.c (lang_decode_option): Update -Wunused flags by calling
6482 set_Wunused.
6483 * decl.c (poplevel): Replace warn_unused with warn_unused_label.
6484
6485 2000-05-09 Zack Weinberg <zack@wolery.cumb.org>
6486
6487 * check_init.c (check_init): Constify local char *.
6488 * class.c (push_class): Constify local char *.
6489 * java_tree.h: Update prototypes.
6490 * jcf-io.c (open_class): Constify filename parameter and
6491 return value.
6492 (find_class): Remove redundant string copy. Cast return from
6493 open_class.
6494 * jcf-parse.c (read_class, parse_class_file, yyparse):
6495 Constify local char *.
6496 * jcf-write.c (generate_bytecode_insns, generate_classfile):
6497 Constify local char *.
6498 * jcf.h (JCF): Constify filename and classname.
6499 (JCF_FINISH): Cast args to FREE to char * when appropriate.
6500 * lang.c (init_parse): Constify parameter and return value.
6501 * lex.c (java_get_line_col): Constify filename parameter.
6502 * parse.h: Constify parser_ctxt.filename. Update prototypes.
6503 * parse.y (java_parser_context_suspend,
6504 issue_warning_error_from_context, safe_layout_class): Constify
6505 local char *.
6506 * parse.c: Regenerate.
6507
6508 2000-05-08 Tom Tromey <tromey@cygnus.com>
6509
6510 * expr.c (build_jni_stub): Cache the result of
6511 _Jv_LookupJNIMethod.
6512
6513 2000-05-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6514
6515 * decl.c (predef_filenames_size): Now 7.
6516 (predef_filenames): New seventh entry.
6517
6518 2000-05-04 Tom Tromey <tromey@cygnus.com>
6519
6520 * boehm.c (mark_reference_fields): Don't mark RawData fields.
6521 Keep track of when we've seen a reference field after a
6522 non-reference field.
6523 (get_boehm_type_descriptor): Handle case where we see
6524 non-reference fields but no trailing reference field.
6525 * decl.c (rawdata_ptr_type_node): Define.
6526 (init_decl_processing): Initialize rawdata_ptr_type_node.
6527 * java-tree.h (rawdata_ptr_type_node): Declare.
6528
6529 2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6530
6531 * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
6532 specifiers in calls to fprintf.
6533
6534 2000-05-03 Andrew Haley <aph@cygnus.com>
6535
6536 * expr.c (build_java_jsr): Use emit_jump, not expand_goto.
6537
6538 * javaop.h (WORD_TO_INT): New function.
6539 (IMMEDIATE_s4): Use WORD_TO_INT.
6540 * jcf.h (JPOOL_INT): Ditto.
6541
6542 * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
6543 separator.
6544
6545 2000-04-19 Tom Tromey <tromey@cygnus.com>
6546
6547 * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
6548 on native function.
6549 * jcf-parse.c (parse_class_file): Call build_jni_stub for native
6550 JNI methods.
6551 * expr.c (build_jni_stub): New function.
6552 * lang-specs.h: -fjni and -femit-class-file are incompatible.
6553 * parse.c: Rebuilt.
6554 * parse.y (java_complete_expand_methods): Expand a native method
6555 and call build_jni_stub if -fjni given.
6556 * lang-options.h: Document -fjni.
6557 * lang.c (flag_jni): New global.
6558 (lang_f_options): Added `jni' entry.
6559 * java-tree.h (soft_lookupjnimethod_node,
6560 soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
6561 Declare.
6562 (flag_jni): Declare.
6563 (build_jni_stub): Declare.
6564 (struct lang_decl): Added `native' flag.
6565 (METHOD_NATIVE): Redefined to use `native' field of lang specific
6566 structure.
6567 * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
6568 soft_jnipopsystemframe_node): New globals.
6569 (init_decl_processing): Set them. _Jv_InitClass only takes one
6570 argument.
6571
6572 * java-tree.def: Put into `C' mode.
6573
6574 2000-04-27 Tom Tromey <tromey@cygnus.com>
6575
6576 Fix for PR gcj/2:
6577 * expr.c (expand_invoke): Generate check to see if object pointer
6578 is null in nonvirtual invocation case.
6579 * java-tree.h (soft_nullpointer_node): Declare.
6580 * decl.c (soft_nullpointer_node): New global.
6581 (init_decl_processing): Initialize soft_nullpointer_node.
6582 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
6583 or `private' methods.
6584 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
6585
6586 2000-04-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
6587
6588 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
6589 from <clinit>
6590
6591 2000-04-26 Tom Tromey <tromey@cygnus.com>
6592
6593 * zextract.c (find_zip_file_start): New function.
6594 (read_zip_archive): Use it.
6595
6596 2000-04-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
6597
6598 * parse.y (register_incomplete_type): Handle JDEP_ANONYMOUS.
6599
6600 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
6601
6602 * class.c (common_enclosing_context_p): New function.
6603 * java-tree.h (common_enclosing_context_p): Added prototype.
6604 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow
6605 classes sharing an outer context with the current instance.
6606 * parse.y (build_access_to_thisn): Fixed leading comment.
6607 (verify_constructor_super): New local `supper_inner'. Skip
6608 enclosing context argument in the case of inner class constructors.
6609 (patch_method_invocation): Insert proper context as second
6610 parameter to pure inner class constructor super invocations.
6611
6612 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
6613
6614 * parse.y (end_class_declaration): Reset the interface number
6615 counter.
6616
6617 2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
6618
6619 * parse.y (source_start_java_method): Deleted unnecessary code.
6620 (patch_method_invocation): Fixed comment.
6621
6622 2000-04-24 Robert Lipe <robertlipe@usa.net>
6623
6624 * parse.h (_jdep): Member `kind' now ENUM_BITFIELD.
6625
6626 2000-04-23 Tom Tromey <tromey@cygnus.com>
6627
6628 * boehm.c (mark_reference_fields): Use int_byte_position.
6629
6630 2000-04-22 Tom Tromey <tromey@cygnus.com>
6631
6632 * boehm.c (mark_reference_fields): Only call byte_position on
6633 non-static fields.
6634
6635 2000-04-22 Tom Tromey <tromey@cygnus.com>
6636
6637 * boehm.c (mark_reference_fields): Added `last_view_index'
6638 argument. Use DECL_FIELD_OFFSET to determine field's offset.
6639
6640 2000-04-20 Mo DeJong <mdejong@cygnus.com>
6641
6642 * parse.h (INTERFACE_INNER_MODIFIERS): New macro.
6643 * parse.y (check_class_interface_creation): Fixed comments. Select
6644 permitted modifiers for (inner) interfaces. Changed error message
6645 to report rejected modifiers used with local classes.
6646
6647 2000-04-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
6648
6649 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes
6650 of directly inherited type considered in scope.
6651 * parse.y (do_resolve_class): Search inherited classes for inner
6652 classes.
6653
6654 2000-04-20 Tom Tromey <tromey@cygnus.com>
6655
6656 * parse.y (not_accessible_p): Use member's class, not current
6657 class, when doing inheritance check for protected reference.
6658 Fixes PR gcj/124.
6659
6660 2000-04-20 Jason Schroeder <shrode@subnature.com>
6661
6662 * jcf-dump.c (SPECIAL_IINC): Fixed typo printing iinc instruction.
6663
6664 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
6665
6666 * parse.y (lookup_field_wrapper): Search for final local aliases.
6667 (resolve_expression_name): Let lookup_field_wrapper search for
6668 final local aliases. Force the value of `name' if one is found.
6669 (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have
6670 an expression name. Fixed comments.
6671
6672 2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
6673
6674 * parse.y (yyerror): `msg' can be null, don't use it in that case.
6675
6676 2000-04-19 Tom Tromey <tromey@cygnus.com>
6677
6678 * gjavah.c (cxx_keyword_subst): Avoid potential infinite loop.
6679
6680 2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
6681
6682 * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'.
6683
6684 2000-04-18 Tom Tromey <tromey@cygnus.com>
6685
6686 PR gcj/211:
6687 * gjavah.c (utf8_cmp): Changed return value.
6688 (cxx_keyword_subst): Handle all C++ keywords. Allocate new return
6689 result.
6690 (cxx_keywords): New global.
6691 (get_field_name): Handle new result of cxx_keyword_subst.
6692 (print_method_info): Likewise.
6693
6694 2000-04-17 Bryce McKinlay <bryce@albatross.co.nz>
6695
6696 * gjavah.c (print_name_for_stub_or_jni): Don't prefix method names
6697 with a newline, for CNI.
6698 (print_stub_or_jni): Print a space or newline before method name for
6699 CNI as well as JNI.
6700 (print_cxx_classname): Don't write leading "::" in CNI stub method.
6701 (process_file): Include gcj/cni.h if generating CNI stubs.
6702
6703 2000-04-16 Tom Tromey <tromey@cygnus.com>
6704
6705 * gjavah.c (decompile_method): Use print_field_name.
6706 Fixes PR gcj/205.
6707
6708 2000-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
6709
6710 * parse.y (java_expand_classes): Reverse the package list once.
6711 (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string
6712 reduction.
6713 (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
6714 the `==' and `!=' operators.
6715
6716 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6717
6718 * jcf-write.c (generate_bytecode_insns): At invokation time,
6719 always relate an interface method to the type of its selector.
6720
6721 2000-04-05 Tom Tromey <tromey@cygnus.com>
6722
6723 Fix for PR gcj/2:
6724 * expr.c (expand_invoke): Generate check to see if object pointer
6725 is null in nonvirtual invocation case.
6726 * java-tree.h (soft_nullpointer_node): Declare.
6727 * decl.c (soft_nullpointer_node): New global.
6728 (init_decl_processing): Initialize soft_nullpointer_node.
6729 * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
6730 or `private' methods.
6731 (patch_invoke): Handle INVOKE_NONVIRTUAL case.
6732
6733 2000-04-05 Tom Tromey <tromey@cygnus.com>
6734
6735 Fix for PR gcj/140:
6736 * parse.y (check_final_assignment): Recognize assignments to the
6737 `length' field of an array when generating class files.
6738
6739 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6740
6741 * class.c (decl_hash): Prototype removed.
6742 (decl_compare): Likewise.
6743
6744 2000-04-05 Tom Tromey <tromey@cygnus.com>
6745
6746 * parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter.
6747 * parse.y (check_modifiers_consistency): Check for final/volatile
6748 clash. Fixes PR gcj/164.
6749
6750 2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
6751
6752 * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash',
6753 made global.
6754 (java_hash_compare_tree_node): Renamed from `decl_compare, made
6755 global.
6756 (add_method_1): Use `java_hash_hash_tree_node' and
6757 `java_hash_compare_tree_node'.
6758 * java-tree.h: (java_hash_hash_tree_node): Prototyped.
6759 (java_hash_compare_tree_node): Likewise.
6760 * parse.y (find_applicable_accessible_methods_list): Create,
6761 delete and use a hash table to remember already searched interfaces.
6762
6763 2000-04-03 Matt Welsh <mdw@cs.berkeley.edu>
6764
6765 * jcf-depend.c (add_entry): Fixed bug where list was always replaced
6766 with latest entry.
6767
6768 2000-04-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
6769
6770 * boehm.c (mark_reference_fields, set_bit): Prototype.
6771 (set_bit): Un-ANSI-fy definition.
6772
6773 * class.c (init_test_hash_newfunc, decl_hash, decl_compare):
6774 Prototype.
6775
6776 * decl.c (emit_init_test_initialization): Likewise.
6777
6778 * gjavah.c (jni_print_char): Likewise.
6779
6780 * parse.y (create_new_parser_context): Likewise.
6781
6782 2000-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
6783
6784 * expr.c (java_lang_expand_expr): Added Anthony's Thu Jan 6 2000
6785 patch missing hunk. Fixed indentation.
6786
6787 2000-03-30 Tom Tromey <tromey@cygnus.com>
6788
6789 * gjavah.c (D_NAN_MASK): Only define as word-reversed when
6790 HOST_FLOAT_WORDS_BIG_ENDIAN and HOST_WORDS_BIG_ENDIAN disagree.
6791
6792 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
6793
6794 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
6795 when negative *before* using it as an array index.
6796 * ChangeLog: Fixed typo.
6797
6798 2000-03-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
6799
6800 * parse-scan.y (pop_class_context): Reset `inner_qualifier_length'
6801 to 0 when it reaches -1.
6802
6803 2000-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
6804
6805 * jcf-parse.c (get_constant): Properly cast `num' during the
6806 invocation of `add_double'.
6807 * jcf-write.c (push_long_const): Properly cast `lo' before
6808 comparing it to short bounds.
6809 * parse-scan.y (interface_declaration:): Rule re-arrange so that
6810 `interface_body:' is reduced after the current interface is
6811 pushed.
6812
6813 2000-03-26 Tom Tromey <tromey@cygnus.com>
6814
6815 * jvspec.c (jvgenmain_spec): Add `%{<...}' construct for each
6816 Java-specific `-f' option.
6817
6818 2000-03-26 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6819
6820 * decl.c (init_decl_processing): Only call initialize_sizetypes once.
6821 Adjust order of making types.
6822 Make bitsize_*_node values.
6823
6824 2000-03-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6825
6826 * class.c (make_field_value): Use byte_position.
6827 * expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
6828 (java_array_data_offset): Likewise.
6829 * java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
6830 bzero call.
6831
6832 2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
6833
6834 * parse.y (check_abstract_method_definitions): New local
6835 `end_type_reached'. Make sure we also consider `end_type'.
6836 (java_check_abstract_method_definitions): Make sure we eventually
6837 consider `java.lang.Object'.
6838 (maybe_use_access_method): Don't use access method if not in the
6839 context of a pure inner class or if the method's context is right.
6840 (find_applicable_accessible_methods_list): New static flag
6841 `object_done'. Don't search abstract classes as interfaces. Fixed
6842 indentation. Fixed the `java.lang.Object' only search. Search
6843 class interface(s) first, then fully search enclosing contexts.
6844 (find_most_specific_methods_list): Pick the closest candidate when
6845 they're all abstract.
6846
6847 2000-03-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
6848
6849 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
6850 properly initialize `finished_label'. Don't emit gotos for empty
6851 try statements.
6852
6853 2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
6854
6855 * except.c (emit_handlers): Clear catch_clauses_last.
6856
6857 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
6858
6859 * parse.y (check_method_types_complete): New function.
6860 (create_class): Reset anonymous class counter only when seeing an
6861 non inner classe.
6862 (java_complete_class): JDEP_METHOD: Don't recompute signature
6863 if incomplete.
6864
6865 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
6866
6867 * class.c (build_static_ref): Fixed indentation in comment.
6868 * java-tree.def (TRY_EXPR): Fixed typo in name.
6869 (CLASS_LITERAL): Likewise.
6870 * java-tree.h: (TYPE_DOT_CLASS): New macro.
6871 (struct lang_type): New field `dot_class'.
6872 * jcf-write.c (generate_bytecode_insns): Fixed error message.
6873 (generate_classfile): Method `class$' is synthetic.
6874 * parse.y (build_do_class_method): New function.
6875 (build_dot_class_method_invocation): Likewise.
6876 (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary.
6877 (resolve_qualified_expression_name): Handle CLASS_LITERAL.
6878 (qualify_ambiguous_name): Likewise.
6879 (patch_incomplete_class_ref): Invoke synthetic method if necessary.
6880 (build_try_statement): Fixed leading comment.
6881
6882 2000-03-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
6883
6884 * class.c (make_field_value): Properly handle sizes.
6885 (get_dispatch_vector): Use tree_low_cst and host_integerp.
6886 (layout_class_method): Count using trees.
6887 * decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node.
6888 * expr.c (java_array_data_offset): Use int_bit_position.
6889 (build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
6890 (build_invokevirtual): Use tree_low_cst and do computations with trees.
6891
6892 2000-03-16 Tom Tromey <tromey@cygnus.com>
6893
6894 * lang.c (flag_hash_synchronization): New global.
6895 (lang_f_options): Added `hash-synchronization'.
6896 * lang-options.h: Mention -fhash-synchronization.
6897 * java-tree.h (flag_hash_synchronization): Declare.
6898 * expr.c (java_lang_expand_expr): Only push `sync_info' value when
6899 hash table synchronization is disabled.
6900 * decl.c (init_decl_processing): Only push `sync_info' value when
6901 hash table synchronization is disabled.
6902 * class.c (make_class_data): Only push `sync_info' field when hash
6903 table synchronization is disabled. Removed dead code.
6904
6905 2000-03-16 Tom Tromey <tromey@cygnus.com>
6906
6907 * lang.c (lang_decode_option): Enable -Wunused when -Wall given.
6908
6909 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
6910
6911 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous
6912 classes.
6913 * parse.y (patch_method_invocation): Handle anonymous classes
6914 creation in static context.
6915
6916 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
6917
6918 * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro.
6919 * parse.y (resolve_qualified_expression_name): Use it.
6920 (patch_method_invocation): Likewise.
6921
6922 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
6923
6924 * parse.y (register_incomplete_type): JDEP_ENCLOSING set
6925 depending on the type of dependency which dictates what the
6926 current class is.
6927 (unresolved_type_p): Resolved types limited to the current class.
6928
6929 2000-03-15 Tom Tromey <tromey@cygnus.com>
6930
6931 * decl.c (init_decl_processing): Set type of `sync_info' to be
6932 pointer to Object.
6933
6934 * boehm.c (get_boehm_type_descriptor): Correctly compute `bits'.
6935 Correctly compute bit number for current slot. Zero `high' and
6936 `low' in DS_LENGTH case. Don't skip inherited fields. Use
6937 mark_reference_fields.
6938 (mark_reference_fields): New function.
6939
6940 2000-03-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
6941
6942 * parse.y (register_incomplete_type): Fixed initialization of
6943 JDEP_ENCLOSING.
6944
6945 2000-02-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
6946
6947 * parse-scan.y (inner_qualifier, inner_qualifier_length): New
6948 static globals.
6949 (push_class_context, pop_class_context): New function.
6950 (class_body:): Call pop_class_context.
6951 (interface_body:): Likewise.
6952 (INNER_QUALIFIER): New macro.
6953 (report_class_declaration): Changed output format and use
6954 INNER_QUALIFIER. Call push_class_context.
6955
6956 2000-02-14 Andrew Haley <aph@cygnus.com>
6957
6958 * check-init.c (check_init): Add new cases for unary and binary
6959 tree nodes.
6960
6961 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6962
6963 * parse.y (resolve_package): Set `next' once a type name has been
6964 progressively discovered.
6965 (resolve_qualified_expression_name): Propagate resolution only if
6966 there are remaining qualifiers. Take into account `q' might have
6967 been cleared after re-qualification.
6968 * parse.y (patch_method_invocation): New local `resolved'.
6969 Section dealing with qualified expression rewritten to use
6970 resolve_field_access.
6971
6972 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
6973
6974 * parse.h (PUSH_CPC): Fixed indentation.
6975 (DEBUG_CPC): New macro.
6976 (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
6977 SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
6978 * parse.y (class_body_declaration:): Use
6979 SET_CPC_INSTANCE_INITIALIZER_STMT.
6980 (method_declaration:): Check for null current_function_decl.
6981 (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
6982 (java_parser_context_pop_initialized_field): Better handling of
6983 empty lists.
6984 (maybe_make_nested_class_name): Mark nested class name as
6985 qualified when necessary.
6986 (end_class_declaration): Don't call java_parse_context_resume when
6987 one or more error occurred.
6988 (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
6989 (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
6990 SET_CPC_INITIALIZER_STMT.
6991 (method_header): Check for inner classes declaring static methods.
6992 (resolve_qualified_expression_name): Handle situation where `this'
6993 is implied.
6994
6995 2000-03-13 Hans Boehm <boehm@acm.org>
6996
6997 * typeck.c (build_prim_array_type): Correctly set the high word too.
6998
6999 2000-03-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
7000
7001 * parse.y (java_complete_expand_methods): Leave <clinit> out of
7002 ordinary methods.
7003 (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
7004 list of methods for interfaces.
7005
7006 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7007
7008 * parse.y (qualify_ambiguous_name): Properly handle expressions
7009 using `null'.
7010
7011 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7012
7013 * parse.y (check_final_assignment): Extended to process
7014 COMPOUND_EXPR.
7015 (patch_assignment): Have check_final_assignment called only once.
7016
7017 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7018
7019 * java-tree.h (IS_INIT_CHECKED): New flag.
7020 * check-init.c (check_init): Test and set IS_INIT_CHECKED.
7021 * parse.y (patch_string): Call force_evaluation_order on the
7022 completed string concatenation tree.
7023 * expr.c (force_evaluation_order): Call force_evaluation_order on
7024 function's arguments too.
7025
7026 2000-03-06 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7027
7028 * decl.c (emit_init_test_initialization): Mark KEY as unused.
7029 * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
7030 (build_anewarray): Likewise.
7031 * parse.y (patch_newarray): Likewise.
7032 * parse.c: Regenerated.
7033
7034 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
7035
7036 * decl.c (init_decl_processing): Added new class fields `depth',
7037 `ancestors', and `idt' to class_type_node. Use
7038 _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
7039 * class.c (make_class_data): Push initial values for new fields.
7040 * java-tree.h: Updated prototype for `build_invokeinterface'.
7041 * expr.c (build_invokeinterface): Changed parameters to accept
7042 `method' tree. Calculate index of `method' in its declaring
7043 interface. Build call to _Jv_LookupInterfaceMethodIdx.
7044 (expand_invoke): Call `build_invokeinterface' with new parameters.
7045 * parse.y (patch_invoke): Call `build_invokeinterface' with new
7046 parameters.
7047
7048 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
7049
7050 * typeck.c (lookup_do): Search superinterfaces first
7051 when looking up an interface method. From Godmar Back
7052 <gback@cs.utah.edu>
7053
7054 2000-03-06 Tom Tromey <tromey@cygnus.com>
7055
7056 * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
7057
7058 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
7059
7060 * java-tree.h (lookup_argument_method2): Declared.
7061 (safe_layout_class): Prototype moved from parse.h.
7062 * parse.h (safe_layout_class): Prototype moved to java-tree.h.
7063 * parse.y (java_check_regular_methods): Local `super_class' gone.
7064 Call lookup_argument_method2 instead of lookup_argument_method.
7065 Perform modifier match for methods found declared in implemented
7066 interfaces. Fixed indentation problem. Overriding/hiding error
7067 report to take place only for methods found in classes.
7068 * typeck.c (lookup_argument_method): Changed leading
7069 comment. Re-written by calling lookup_do.
7070 (lookup_argument_method2): New function.
7071 (lookup_java_method): Re-written by calling lookup_do.
7072 (lookup_do): New function.
7073
7074 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
7075
7076 * check-init.c (check_init): Removed dead code. Handle (blank)
7077 final variables.
7078 * parse.y (declare_local_variables): New local `final_p', set it
7079 and use it to initialize LOCAL_FINAL.
7080 (check_final_assignment): Only check FIELD_DECLs.
7081
7082 2000-02-17 Tom Tromey <tromey@cygnus.com>
7083
7084 * Makefile.in (JAVA_OBJS): Added boehm.o.
7085 (boehm.o): New target.
7086 * Make-lang.in (JAVA_SRCS): Added boehm.c.
7087 * java-tree.h (flag_use_boehm_gc): Declare.
7088 (get_boehm_type_descriptor): Declare.
7089 * lang.c (lang_f_options): Added `use-boehm-gc'.
7090 (flag_use_boehm_gc): New global.
7091 * lang-options.h: Added -fuse-boehm-gc.
7092 * boehm.c: New file.
7093 * class.c (get_dispatch_table): If class uses a Boehm type
7094 descriptor, put it in the vtable.
7095 (make_class_data): Removed dead code.
7096
7097 2000-03-03 Per Bothner <per@bothner.com>
7098
7099 * decl.c (init_decl_processing): Initialize sizetype properly.
7100
7101 2000-03-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7102
7103 * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
7104 (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
7105 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
7106 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
7107 (jcf_parse): New local `current'. Load innerclasses seen in outer
7108 context being processed.
7109 * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
7110 * jcf-write.c (append_innerclasses_attribute): New function.
7111 (append_innerclasses_attribute_entry): Likewise.
7112 (get_access_flags): Handle static classes. Set anonymous and local
7113 classes to be private.
7114 (generate_classfile): Attribute count adjusted. Call
7115 append_innerclasses_attribute.
7116 * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
7117 PURE_INNER_CLASS_TYPE_P.
7118 * parse.y (parser_qualified_classname): New parameter `is_static',
7119 produce non qualified name accordingly.
7120 (block_statement:): Set LOCAL_CLASS_P when declaring local class.
7121 (create_interface): Added argument to parser_qualified_classname.
7122 (create_class): Added argument to parser_qualified_classname. Setup
7123 alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
7124 (add_inner_class_fields): Fixed indentation.
7125 (method_declarator): Use PURE_INNER_CLASS_DECP_P.
7126 (method_declarator): Fixed typo in comment.
7127 (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
7128 (build_current_thisn): Likewise.
7129 (patch_method_invocation): Likewise.
7130
7131 2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
7132
7133 * decl.c (current_function_decl): Move to toplev.c.
7134
7135 2000-02-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7136
7137 * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
7138 (DECL_BIT_INDEX): Use underlying representation.
7139 * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
7140
7141 2000-02-27 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7142
7143 * expr.c (build_java_ret): Pass proper type to size_binop.
7144
7145 2000-02-25 Anthony Green <green@cygnus.com>
7146
7147 * expr.c (build_class_init): Mark the decl to be ignored by
7148 check_init.
7149 * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
7150 * check-init.c: Move DECL_BIT_INDEX to java-tree.h
7151 * class.c (init_test_hash_newfunc): New function.
7152 (decl_hash): New function.
7153 (decl_compare): New function.
7154 * decl.c (emit_init_test_initialization): New function.
7155 (complete_start_java_method): Traverse the init test hashtable,
7156 calling emit_init_test_initialization.
7157 (always_initialize_class_p): Define.
7158 * expr.c (build_class_init): Use initialization tests when
7159 emitting class initialization code.
7160 (always_initialize_class_p): Declare.
7161 * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
7162 1.
7163 * java-tree.h: Include hash.h.
7164 (DECL_FUNCTION_INIT_TEST_TABLE): Define.
7165 (struct lang_decl): Add init_test_table field.
7166 (init_test_hash_entry): Define.
7167
7168 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
7169
7170 * gjavah.c (main): Avoid using `argi' to report unimplemented
7171 options.
7172
7173 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
7174
7175 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
7176 initialize locals to avoid warnings. Local `exception_type' moved
7177 into if statement.
7178
7179 2000-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
7180
7181 * parse.y (resolve_expression_name): Use `orig' as a second
7182 argument to resolve_field_access.
7183 (resolve_field_access): Removed unnecessary code when dealing with
7184 static fields.
7185
7186 2000-02-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
7187
7188 * class.c (push_super_field): Don't push the field twice.
7189 * jcf-parse.c (parse_source_file): Call java_reorder_fields.
7190 * parse.h (java_reorder_fields): Prototyped.
7191 * parse.y (java_reorder_fields): New function.
7192 (java_layout_class): Simplified not to worry about re-ordering.
7193
7194 2000-02-23 Tom Tromey <tromey@cygnus.com>
7195
7196 * gjavah.c (print_name): In JNI case, correctly quote string.
7197 (print_method_info): Don't handle overrides in JNI mode.
7198
7199 2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
7200
7201 * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
7202 value type set to `boolean_type_node'.
7203
7204 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
7205
7206 * jcf-dump.c (main): Test for correct condition after
7207 output file creation.
7208
7209 2000-02-19 Anthony Green <green@cygnus.com>
7210
7211 * jcf-depend.c (add_entry): Fix test for first list entry.
7212
7213 2000-02-19 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
7214
7215 * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
7216 * constants.c (build_constants_constructor): Likewise.
7217
7218 2000-02-19 Anthony Green <green@cygnus.com>
7219
7220 * jcf-depend.c (add_entry): Add entries to the end of the list.
7221
7222 1999-11-03 Pekka Nikander <pekka.nikander@hut.fi>
7223
7224 * decl.c (INT_TYPE_SIZE): Define if necessary.
7225 (expand_java_return): Handle the case of a native integer smaller
7226 than a JVM integer.
7227
7228 2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
7229
7230 * gjavah.c (help): Use GCCBUGURL.
7231 * jv-scan.c (help): Likewise.
7232 * jcf-dump.c (help): Likewise.
7233
7234 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
7235
7236 * jcf-write.c (generate_bytecode_insns): Don't generate empty
7237 `finally' clauses.
7238
7239 2000-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
7240
7241 * jcf-parse.c (load_class): Call `fatal' if no file containing
7242 the target class are found.
7243
7244 2000-02-16 Zack Weinberg <zack@wolery.cumb.org>
7245
7246 * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
7247 lex.c, lex.h, and PARSE_H to...
7248 (parse.o, parse-scan.o): ...here, respectively.
7249
7250 * lex.c: Split out code that may trigger SIGFPE from yylex()
7251 to its own function.
7252 * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
7253
7254 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7255
7256 * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
7257
7258 2000-02-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
7259
7260 * parse.y (outer_field_access_p): Stop in time when outer contexts
7261 are exhausted.
7262 (resolve_qualified_expression_name): Properly qualify *everything*
7263 after a package.type to be resoled as expression names.
7264 (find_applicable_accessible_methods_list): Save/restore `class' to
7265 isolate it from a possible outer context search.
7266
7267 2000-02-15 Tom Tromey <tromey@cygnus.com>
7268
7269 * gjavah.c (jni_print_char): New function.
7270 (print_full_cxx_name): Use it.
7271 (decode_signature_piece): Likewise.
7272 (print_cxx_classname): Likewise.
7273
7274 2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7275
7276 * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
7277 version.o.
7278 (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
7279
7280 * gjavah.c: Include version.h.
7281
7282 * jcf-dump.c: Likewise.
7283
7284 * jv-scan.c: Likewise.
7285
7286 2000-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
7287
7288 * parse.y (outer_field_access_fix): First parameter now a tree
7289 node. Check for assignement to final. First argument to
7290 build_outer_field_access_fix modified to accommodate prototype.
7291 (build_outer_field_access): Don't check for assignment to final
7292 here.
7293 (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
7294 possibly returned by outer_field_access_fix. Changed
7295 outer_field_access_fix's first argument.
7296 (check_final_assignment): $finit$'s context is OK.
7297 (patch_unaryop): Use node instead of its line/column value when
7298 calling outer_field_access_fix.
7299
7300 2000-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
7301
7302 * parse.y (interface_declaration:): No longer tagged
7303 <node>. Re-installed default action.
7304 (class_member_declaration:): Handle inner interfaces.
7305 (interface_member_declaration): Handle inner interfaces and
7306 classes.
7307 (create_interface): Push error if one seen. Suspend parsing
7308 context when processing an inner interface.
7309 (register_fields): Inner class static field limitations not to
7310 apply to inner interfaces.
7311
7312 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7313
7314 * jcf-parse.c (load_class): Update `java_error_count' when a
7315 class' file can't be found.
7316 (parse.y): Avoid (byte)code generation when errors seen.
7317
7318 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7319
7320 * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
7321 decodes a valid node.
7322 (patch_binop): Handle TRUNC_DIV_EXPR.
7323
7324 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7325
7326 * parse.y (resolve_package): New local `acc'. Try to progressively
7327 build and guess a package and type name.
7328
7329 2000-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
7330
7331 * parse.y (find_applicable_accessible_methods_list): Load and
7332 layout the search class if necessary.
7333 (java_complete_tree): Keep to original type of the folded initial
7334 value.
7335
7336 2000-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
7337
7338 * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
7339 Generate error message if circularity is detected. New static
7340 local `list'.
7341 * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro. *
7342 * jcf-write.c (generate_bytecode_insns): Very simply handle
7343 SAVE_EXPR.
7344 * parse.y (java_check_circular_reference): Use
7345 `cyclic_inheritance_report' during report, if necessary.
7346 (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
7347 walking NEW_ARRAY_INIT twice.
7348
7349 2000-02-09 Tom Tromey <tromey@cygnus.com>
7350
7351 * parse.y (check_class_interface_creation): Allow inner classes to
7352 be `private' or `protected', check modifiers' consistency. Prevent
7353 block local classes from bearing any modifiers.
7354
7355 2000-02-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7356
7357 * except.c (check_start_handlers): Re-add prototype lost in last
7358 patch.
7359 (maybe_start_try): Remove excess argument to `check_start_handlers'.
7360
7361 2000-02-09 Andrew Haley <aph@cygnus.com>
7362
7363 * decl.c (clear_binding_level): Remove excess initializer.
7364 (maybe_poplevels): Remove unused variable.
7365 (force_poplevels): Ditto.
7366 (struct binding_level): Add comment.
7367
7368 2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
7369
7370 * jcf-write.c (generate_classfile): Don't consider
7371 pre-initialization with reference value (use <clinit> instead.)
7372 * parse.y (java_fix_constructors): No generated constructor for
7373 interfaces.
7374 (build_outer_field_access): Removed debug message.
7375 (outer_field_expanded_access_p): Adapted to bytecode generation.
7376 (build_outer_field_access_method): Use fix_method_argument_names.
7377 (build_outer_method_access_method): Fixed indentation. Added
7378 comment. Handle access method generation for static and also void
7379 methods.
7380 (build_access_to_thisn): Inserted debug message.
7381 (maybe_build_thisn_access_method): Use fix_method_argument_names.
7382 (resolve_qualified_expression_name): Fixed comment.
7383 (not_accessible_p): Adapted to bytecode generation. Added comment.
7384 (patch_method_invocation): Added comment.
7385 (maybe_use_access_method): Fixed leading comment. Handle static
7386 methods.
7387 (java_complete_lhs): Don't shortcut handling of initialized upon
7388 declaration String type static fields when generating bytecode.
7389 (patch_unaryop): Handle outer field access when generating
7390 bytecode.
7391
7392 2000-02-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
7393
7394 * java-tree.h (FIELD_THISN): New macro.
7395 * jcf-write.c (append_synthetic_attribute): New function.
7396 (generate_classfile): Set "Synthetic" attribute on this$<n>,
7397 val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
7398 * parse.y (add_inner_class_fields): Set FIELD_THISN for created
7399 this$<n> fields.
7400 (build_outer_field_access): Turned on access functions usage and
7401 generation when compiling to bytecode.
7402 (maybe_use_access_method): Likewise.
7403
7404 2000-01-25 Andrew Haley <aph@cygnus.com>
7405
7406 * java-except.h (struct eh_range): Add `expanded' field.
7407 (maybe_start_try): Add end_pc arg.
7408 (maybe_end_try): Ditto.
7409 * java-tree.h (force_poplevels): new function.
7410 * expr.c (expand_byte_code): Don't call maybe_start_try or
7411 maybe_end_try.
7412 * except.c (add_handler): Reset expanded.
7413 (expand_start_java_handler): Set expanded.
7414 (check_start_handlers): Don't expand a start handler that's
7415 already been expanded.
7416 (maybe_start_try): Add end_pc arg. Only expand a handler which
7417 ends after end_pc.
7418 (expand_end_java_handler): call force_poplevels.
7419 (force_poplevels): new function.
7420 * decl.c (binding_level): Add start_pc of binding level.
7421 (maybe_pushlevels): Call maybe_start_try when pushing binding
7422 levels.
7423 (maybe_poplevels): Call maybe_end_try when popping binding levels.
7424 (LARGEST_PC): Define.
7425 (clear_binding_level): Use LARGEST_PC.
7426
7427 * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
7428 * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
7429 (binding_depth, is_class_level, current_pc): new variables.
7430 (struct binding_level): ditto.
7431 (indent): new function.
7432 (push_jvm_slot): add debugging info.
7433 (maybe_pushlevels): ditto.
7434 (maybe_poplevels): ditto.
7435 (pushlevel): ditto.
7436 (poplevel): ditto.
7437 (start_java_method): ditto.
7438 (give_name_to_locals): comment only.
7439 * except.c (binding_depth, is_class_level, current_pc):
7440 new variables.
7441 (expand_start_java_handler): add debugging info.
7442 (expand_end_java_handler): ditto.
7443
7444 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7445
7446 * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
7447 (print_name_for_stub_or_jni, process_file): Constify a char*.
7448
7449 2000-02-03 Tom Tromey <tromey@cygnus.com>
7450
7451 * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
7452
7453 2000-01-31 Scott Bambrough <scottb@netwinder.org>
7454
7455 * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
7456 assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
7457 defined to be 1.
7458
7459 2000-02-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
7460
7461 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
7462 * java-tree.h (TYPE_II_STMT_LIST): New macro.
7463 (struct lang_type): New field `ii_block'.
7464 * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
7465 CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
7466 * parse.h (struct parser_ctxt): New field `instance_initializers'.
7467 (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
7468 CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
7469 CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
7470 macros.
7471 * parse.y (add_instance_initializer): New function.
7472 (in_instance_initializer): New static global.
7473 (class_body_declaration:): Link instance initializer block.
7474 (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
7475 (array_creation_expression:): Remove unused local.
7476 (java_parser_context_push_initialized_field): Fixed leading
7477 comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
7478 CPC_INSTANCE_INITIALIZER_LIST.
7479 (java_parser_context_pop_initialized_field): Likewise.
7480 (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
7481 (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
7482 CPC_INITIALIZER_STMT.
7483 (fix_constructors): New local `class_type'. Use it. Call
7484 add_instance_initializer.
7485 (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
7486 (patch_return): Forbid return in instance initializers.
7487 (patch_throw_statement): Enforce exception handling in the context
7488 of instance initializers.
7489
7490 2000-02-03 Tom Tromey <tromey@cygnus.com>
7491
7492 * Make-lang.in (java.mostlyclean): Remove executables in
7493 `mostlyclean'.
7494
7495 2000-01-31 Scott Bambrough <scottb@netwinder.org>
7496
7497 * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
7498 HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
7499 (java_float_finite): Convert to use union Word from javaop.h.
7500 (java_double_finite): Convert to use union DWord from javaop.h.
7501
7502 2000-02-02 Tom Tromey <tromey@cygnus.com>
7503
7504 * gjavah.c (options): Added `jni' entry.
7505 (help): Document -jni.
7506 (flag_jni): New global.
7507 (process_file): Handle JNI output. Don't print text from
7508 -prepend, -add, etc, when generating stubs. Only remove `.class'
7509 suffix if it actually exists.
7510 (main): Create a `.c' file when run with `--jni --stubs'. Create
7511 correct output file name with `--jni'.
7512 (print_include): Mangle header name differently in JNI case.
7513 (HANDLE_METHOD): In JNI mode, call print_method_info to generate
7514 method list.
7515 (print_method_info): Handle JNI case. Put signature info into
7516 method name. Handle case when STREAM is NULL.
7517 (print_name_for_stub_or_jni): New function.
7518 (print_stub_or_jni): Renamed from `print_stub'. Handle JNI.
7519 (print_cxx_classname): Handle JNI.
7520 (print_full_cxx_name): Likewise.
7521 (decode_signature_piece): Likewise.
7522 (overloaded_jni_method_exists_p): New function.
7523 (struct method_name): Added `signature' and `sig_length' fields.
7524 (HANDLE_END_FIELD): Do nothing in JNI mode.
7525
7526 2000-02-02 Tom Tromey <tromey@cygnus.com>
7527
7528 * jv-scan.c: Include version.c, <getopt.h>.
7529 (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
7530 (options): New array.
7531 (usage): New function.
7532 (version): New function.
7533 (main): Use getopt_long to parse command line.
7534 * jcf-dump.c: Include version.c, <getopt.h>.
7535 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
7536 OPT_JAVAP): New macros.
7537 (options): New array.
7538 (usage): Return `void'. Changed message.
7539 (help): New function.
7540 (version): New function.
7541 (main): Use getopt_long_only to parse command line.
7542 * gjavah.c: Include <getopt.h>.
7543 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
7544 OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
7545 OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
7546 (options): New array.
7547 (java_no_argument): Removed.
7548 (help): Updated with missing options.
7549 (main): Use getopt_long_only to parse command line.
7550 (usage): Changed message.
7551
7552 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7553
7554 * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
7555 * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
7556 ANONYMOUS_ARRAY_INITIALIZER): New access macros.
7557 * parse.y (array_creation_expression:): Handle anonymous arrays.
7558 (build_array_from_name): Don't set `ret_name' if null.
7559 (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
7560 (qualify_ambiguous_name): Likewise.
7561 (java_complete_expand_class): Likewise.
7562
7563 2000-02-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
7564
7565 * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
7566 * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
7567 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
7568 (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
7569 (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
7570 AIPL_FUNCTION_COMPLETED_INVOCATION.
7571 (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
7572 AIPL_FUNCTION_INVOCATION_READY.
7573 (AIPL_FUNCTION_DECLARATION): New enum entry.
7574 * parse.y (reorder_static_initialized): New function.
7575 (java_parser_context_pop_initialized_field): Use it.
7576 (add_inner_class_fields): Use
7577 MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
7578 augmented. Install marker after last alias initializer, if any.
7579 (generate_finit): Fixed typo. Don't try to retain only the used
7580 fields.
7581 (method_header): Compute and set DECL_FUNCTION_NAP.
7582 (method_declarator): Fixed comment. Insert alias initializer in
7583 parameter list.
7584 (build_alias_initializer_parameter_list): Fixed leading
7585 comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
7586 replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
7587 (java_complete_expand_class): Code to retain only used aliases
7588 removed.
7589 (java_complete_expand_methods): New local `first_decl'. Generate
7590 $finit$ first, then expand the constructors, regular methods and
7591 <clinit>.
7592 (java_complete_expand_method): Don't report error on missing
7593 return statement if previously detected bogus.
7594 (fix_constructors): Don't patch constructor parameters list.
7595 (patch_method_invocation): Use new AIPL enum values. Reverse
7596 alias initializer list for anonymous classes.
7597
7598 2000-01-30 Anthony Green <green@redhat.com>
7599
7600 * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
7601 determine how many stack slots to pop.
7602
7603 2000-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
7604
7605 * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
7606 error handling/recovery.
7607 * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
7608
7609 2000-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
7610
7611 * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
7612 FIELD_LOCAL_ALIAS_USED): New macros.
7613 (DECL_FUNCTION_NAP): New macro.
7614 (struct lang_decl): New field `nap'.
7615 (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
7616 (struct lang_type): New fields `finit_stmt_list' and
7617 `clinit_stmt_list'.
7618 (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
7619 * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
7620 (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
7621 UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
7622 (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
7623 AIPL_FUNCTION_INVOCATION_READY): New enum fields.
7624 (BUILD_THROW): Macro line separator re-indented.
7625 * parse.y (end_class_declaration): New function.
7626 (maybe_generate_pre_expand_clinit): New name for
7627 java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
7628 pre-expand static fields.
7629 (maybe_generate_clinit): Function deleted.
7630 (check_for_static_method_reference): Prototype's parameter list
7631 indented.
7632 (generate_finit): New name for maybe_generate_finit. Changed
7633 leading comment. Function rewritten to use
7634 TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
7635 (build_alias_initializer_parameter_list): New function.
7636 (java_parser_context_pop_initialized_field): Likewise.
7637 (add_inner_class_fields): Likewise.
7638 (type_declaration:): Call end_class_declaration.
7639 (class_member_declaration:): Likewise.
7640 (formal_parameter_list:): Fixed typos.
7641 (formal_parameter:): Use ARG_FINAL_P to mark created tree list
7642 element. Improved error handling.
7643 (block_statement:): Call end_class_declaration.
7644 (anonymous_class_creation:): Likewise.
7645 (create_anonymous_class): Fixed comments.
7646 (create_class): Call add_inner_class_fields.
7647 (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
7648 (method_header): Use MARK_FINAL_PARMS.
7649 (finish_method_declaration): Use UNMARK_FINAL_PARMS.
7650 (method_declarator): Propagate final argument flag.
7651 (craft_constructor): New local `artificial'. Call
7652 build_alias_initializer_parameter_list. Use
7653 CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
7654 (source_start_java_method): Mark parm decls with LOCAL_FINAL if
7655 necessary.
7656 (complete_expand_class): Get rid of unused outer context local
7657 alias fields.
7658 (java_complete_expand_methods): Fixed leading
7659 comment. Generate/pre-expand <clinit> first. Changed method
7660 expansion order to regular, $finit$, constructors, <clinit>.
7661 (java_complete_expand_method): Set current_function_decl.
7662 (fix_constructors): Fix constructor parameter list to account for
7663 outer context local alias initializers.
7664 (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
7665 (resolve_expression_name): Lookup outer context local aliases. New
7666 local `access', use it.
7667 (patch_method_invocation): Patch inner class ctor invocation with
7668 outer context local aliases initialization values. $finit$
7669 invocation patching now includes things generated with
7670 build_alias_initializer_parameter_list.
7671 (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
7672 (build_super_invocation): Likewise.
7673 (patch_assignment): Changed comment.
7674
7675 2000-01-27 Andrew Haley <aph@cygnus.com>
7676
7677 * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
7678 (emit_if): Ditto.
7679 (emit_jsr): Ditto.
7680
7681 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7682
7683 * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
7684 concatenation.
7685 (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
7686
7687 * parse.y (register_fields): Don't pass a format specifier to
7688 OBSOLETE_MODIFIER_WARNING.
7689 (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
7690 instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
7691 specifier.
7692 (check_modifiers): Change function into a macro.
7693 (check_class_interface_creation): Pass a literal format string.
7694
7695 2000-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
7696
7697 * buffer.h: PROTO -> PARAMS.
7698 * check-init.c: Likewise.
7699 * class.c: Likewise.
7700 * constants.c: Likewise.
7701 * convert.h: Likewise.
7702 * decl.c: Likewise.
7703 * except.c: Likewise.
7704 * expr.c: Likewise.
7705 * gjavah.c: Likewise.
7706 * java-except.h: Likewise.
7707 * java-tree.h: Likewise.
7708 * jcf-depend.c: Likewise.
7709 * jcf-dump.c: Likewise.
7710 * jcf-parse.c: Likewise.
7711 * jcf-path.c: Likewise.
7712 * jcf-reader.c: Likewise.
7713 * jcf-write.c: Likewise.
7714 * jcf.h: Likewise.
7715 * jv-scan.c: Likewise.
7716 * jvgenmain.c: Likewise.
7717 * jvspec.c: Likewise.
7718 * lang.c: Likewise.
7719 * lex.c: Likewise.
7720 * lex.h: Likewise.
7721 * parse-scan.y: Likewise.
7722 * parse.h: Likewise.
7723 * parse.y: Likewise.
7724 * typeck.c: Likewise.
7725 * verify.c: Likewise.
7726 * xref.c: Likewise.
7727 * xref.h: Likewise.
7728 * zextract.c: Likewise.
7729 * zipfile.h: Likewise.
7730
7731 2000-01-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
7732
7733 * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
7734 (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
7735 * constants.c (build_constant_data_ref): Check for cached
7736 current_constant_pool_data_ref. Cache current_constant_pool_data_ref
7737 in TYPE_CPOOL_DATE_REF.
7738 * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
7739 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
7740 (struct lang_type): New fields `cpool' and `cpool_data_ref'.
7741 (LOCAL_FINAL): New macro.
7742 * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
7743 constant pool -- don't try to reuse.
7744 (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
7745 TYPE_LANG_SPECIFIC.
7746 (find_in_current_zip): Use TYPE_JCF.
7747 * parse.h (java_check_final): Prototype removed.
7748 * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
7749 (maybe_create_class_interface_decl,
7750 check_class_interface_creation): Likewise.
7751 (java_expand_finals): Function removed.
7752 (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
7753 (block_statement:): Fixed comment.
7754 (anonymous_class_creation:): Likewise.
7755 (check_class_interface_creation): Reversed Jan 12, 2000 extra
7756 argument patch.
7757 (check_class_interface_creation): Loosened error report on (inner)
7758 public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
7759 (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
7760 (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
7761 argument patch.
7762 (create_interface): Likewise.
7763 (anonymous_class_counter): New static global.
7764 (create_anonymous_class): Reversed Jan 12, 2000 extra argument
7765 patch. Fixed comments.
7766 (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
7767 anonymous_class_counter when declaring a toplevel class.
7768 (craft_constructor): Fixed constructor name when handling
7769 anonymous classes. Anonymous class constructors to feature hidden
7770 this$<n> parameter.
7771 (java_fix_constructors): Added comment.
7772 (java_check_final): Function removed.
7773 (java_complete_expand_methods): Fixed comment. Don't generate
7774 class data, save its outgoing constant pool instead.
7775 (verify_constructor_super): Skip anonymous class constructor
7776 hidden this$<n> parameter.
7777 (java_expand_classes): New local `saved_ctxp'. Removed call to
7778 java_expand_finals and java_check_final. Expand anonymous class
7779 constructors. Generate class data.
7780 (build_super_invocation): Skip anonymous class hidden this$<n>
7781 parameter.
7782 * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
7783 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
7784 (set_java_signature): Likewise.
7785
7786 2000-01-18 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
7787
7788 * gjavah.c: Delete ACC_VISIBILITY define.
7789 * jcf.h: Add ACC_VISIBILITY define.
7790 * parse.y: final: rule tagged <value>.
7791 (java_check_regular_methods): Use ACC_VISIBILITY define for
7792 default package access check.
7793 (local_variable_declaration_statement): Use final: rule.
7794
7795 2000-01-17 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
7796
7797 * parse.y (format_parameter:): Use final: rule instead of modifiers:.
7798 (final:): New rule.
7799
7800 2000-01-17 Tom Tromey <tromey@cygnus.com>
7801
7802 * gjavah.c (print_field_info): Allow non-static final fields.
7803
7804 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
7805
7806 * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
7807 * parse.y (patch_anonymous_class): New function.
7808 (create_anonymous_class): Register incomplete type when the
7809 class/interface to extends/implement isn't known yet.
7810 (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
7811 (verify_constructor_super): Tuned error message.
7812
7813 2000-01-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
7814
7815 * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
7816 (ANONYMOUS_CLASS_P): New macro.
7817 (TYPE_SIGNATURE, TYPE_JCF): New macros.
7818 (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
7819 * parse.y (create_class): Added leading argument.
7820 (maybe_create_class_interface_decl,
7821 check_class_interface_creation): Likewise.
7822 (craft_constructor): New function.
7823 (verify_constructor_super): Added argument in prototype.
7824 (class_declaration:): Inserted leading argument.
7825 (for_begin:): Use FOR_LOOP_P.
7826 (anonymous_class_creation): Create WFL of the anonymous class to
7827 instantiate. Call build_new_invocation. Added comments.
7828 (check_class_interface_creation): Handle parameter `anonymous' in
7829 verbose mode class creation announce.
7830 (link_nested_class_to_enclosing): Exclude anonymous classes.
7831 (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
7832 anonymous class, even though they appear to have an enclosing
7833 context.
7834 (create_interface): Pass extra argument to
7835 check_class_interface_creation.
7836 (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
7837 (create_class): Call check_class_interface_creation and
7838 maybe_create_class_interface_decl with extra new argument. Don't
7839 add private this$<n> to anonymous classes.
7840 (method_declarator): Insert hidden this$<n> to anonymous class
7841 constructors.
7842 (java_fix_constructors): Deleted code creating default
7843 constructor. Call craft_constructor instead.
7844 (java_check_regular_methods): Set `saw_constructor' to 1 for
7845 anonymous classes.
7846 (fix_constructors): Pass extra argument to verify_constructor_super.
7847 (verify_constructor_super): New local `sdecl', use it. Search for
7848 matching constructor (possibly featuring arguments) in super
7849 class.
7850 (lookup_method_invoke): Craft constructor according to arguments
7851 list when dealing with anonymous class constructors.
7852 (build_super_invocation): Pass arguments to anonymous class super
7853 constructors.
7854 (search_loop): Use FOR_LOOP_P.
7855 (labeled_block_contains_loop_p): Likewise.
7856
7857 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
7858
7859 * class.c (set_super_info): Set CLASS_STATIC when appropriate.
7860 (enclosing_context_p): New function.
7861 (get_access_flags_from_decl): Handle CLASS_STATIC.
7862 (maybe_layout_super_class): Extra first argument passed to
7863 do_resolve_class.
7864 (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
7865 ID_INIT_P.
7866 * decl.c (access0_identifier_node): New global.
7867 (init_decl_processing): access0_identifier_node initialized.
7868 (pushdecl): Set DECL_CONTEXT only on non type decls.
7869 * expr.c (lookup_field): Lookup inner class fields in enclosing
7870 contexts.
7871 (expand_invoke): Use ID_INIT_P.
7872 (expand_java_field_op): Use DECL_CLINIT_P.
7873 * java-tree.def (CLASS_LITERAL): New tree code.
7874 * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
7875 DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
7876 (struct lang_decl): New field `inner_access'.
7877 (enclosing_context_p): Prototyped.
7878 (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
7879 ID_CLINIT_P): New macros.
7880 (CLASS_STATIC): New macro.
7881 (CLASS_ACCESS0_GENERATED_P): New macro.
7882 (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
7883 TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
7884 INNER_CLASS_P): New macros.
7885 (DECL_INNER_CLASS_LIST): New macro.
7886 * jcf-parse.c (yyparse): Avoid the use of ANSI string
7887 concatenation.
7888 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
7889 the shift value to int. Fixed typo in comment.
7890 * lex.c (inst_id, wpv_id): Initialize.
7891 * mangle.c (unicode_mangling_length): Take `$' into account.
7892 * parse.h (DRECOVER, RECOVER): Terminate properly.
7893 (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
7894 (typedef struct _jdep): New field `enclosing'.
7895 (JDEP_ENCLOSING): New macro.
7896 (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
7897 (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
7898 (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
7899 GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
7900 GET_ENCLOSING_CPC_CONTEXT): New macros.
7901 (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
7902 (do_resolve_class): Added extra argument in prototype.
7903 * parse.y (resolve_class): Added extra argument in prototype.
7904 (maybe_create_class_interface_decl): Likewise.
7905 (maybe_use_access_method, build_wfl_wrap): New functions.
7906 (java_complete_expand_classes, java_complete_expand_class):
7907 Likewise.
7908 (java_parser_context_push_initialized_field,
7909 java_parser_context_suspend, java_parser_context_resume):
7910 Likewise.
7911 (maybe_make_nested_class_name, make_nested_class_name,
7912 set_nested_class_simple_name_value,
7913 link_nested_class_to_enclosing, find_as_inner_class,
7914 find_as_inner_class_do, check_inner_class_redefinition,
7915 build_thisn_assign, build_current_thisn, build_access_to_thisn,
7916 maybe_build_thisn_access_method, build_outer_field_access,
7917 build_outer_field_access_methods, build_outer_field_access_expr,
7918 build_outer_method_access_method, build_new_access_id,
7919 build_outer_field_access_method, outer_field_access_p,
7920 outer_field_expanded_access_p, outer_field_access_fix,
7921 build_incomplete_class_ref, patch_incomplete_class_ref,
7922 create_anonymous_class): Likewise.
7923 (inst_id, wpv_id): New static global variables.
7924 (synchronized:): New rule, tagged <node>.
7925 (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
7926 rules.
7927 (anonymous_class_creation:): New rule, tagged <node>.
7928 (NEW_TK): Tagged <node>.
7929 (type_literals, array_type_literal): New rules, tagged <node>.
7930 (class_declaration:): Removed action when reducing by class_body:
7931 (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
7932 using GET_CPC in sub-rules.
7933 (class_member_declaration): Handle inner classes.
7934 (method_declaration): When reducing method_header:, reset
7935 current_function_decl when appropriate.
7936 (method_declarator:): Set the number of formal parameter to 0 for
7937 method declared without arguments.
7938 (constructor_declarator:): Likewise.
7939 (static_initializer:): List of elements kept in a list.
7940 (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
7941 use of the keyword `static' for type declarations.
7942 (block_statement:): Handle inner class declarations.
7943 (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
7944 type qualified `this'.
7945 (class_instance_creation_expression): Use anonymous_class_creation:
7946 to handle inner class instances creation. Handle qualified `new'.
7947 (something_dot_new): Added appropriate actions.
7948 (create_new_parser_context): New function.
7949 (java_push_parser_context, java_parser_context_save_global,
7950 java_parser_context_suspend): Use create_new_parser_context.
7951 (check_modifiers): Changed leading comment.
7952 (check_class_interface_creation): Handle interclasses.
7953 (add_superinterfaces): Fixed comment.
7954 (create_interface): Build qualified name from the raw_name instead
7955 of its matching WFL. Push the initialized fields list. raw_name added
7956 as an extra argument to maybe_create_class_interface_decl.
7957 (create_class): Build qualified name from the raw_name instead of
7958 its matching WFL. Removed assignment to current_parsed_class_un.
7959 Call PUSH_ERROR before returning an error. Suspend the current
7960 parser context when processing an inner class. Push the
7961 initialized fields list. raw_name added as an extra argument to
7962 maybe_create_class_interface_decl. Add the private this$<n>
7963 field.
7964 (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
7965 (register_fields): Get the class type from GET_CPC and handle
7966 previous errors. Added code to handle the creation of static
7967 fields in inner classes. Initialized fields initialization
7968 statements kept in a list of lists.
7969 (maybe_generate_finit): Initialized fields initialization
7970 statements kept in a list of lists. Use GET_CPC.
7971 (maybe_generate_clinit): Likewise.
7972 (method_header): Use GET_CPC and GET_CPC_UN.
7973 (parser_qualified_classname): Handle inner classes.
7974 (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
7975 (java_fix_constructors): Hide pointer to enclosing context
7976 instance in constructor list when dealing with inner classes.
7977 (jdep_resolve_class): Call resolve_class with extra first argument
7978 JDEP_ENCLOSING.
7979 (resolve_class): Add enclosing context as a first extra argument
7980 to do_resolve_class.
7981 (do_resolve_class): Call find_as_inner_class. Handle WFLs
7982 properly.
7983 (resolve_no_layout): Extra argument added to resolve_class
7984 invocation.
7985 (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
7986 (java_get_real_method_name): Use GET_CPC_UN.
7987 (check_abstract_method_definitions): Use DECL_CLINIT_P.
7988 (java_check_abstract_methods): Handle static method declared in
7989 inner classes by an error.
7990 (java_check_regular_methods): Use DECL_CLINIT_P.
7991 (source_start_java_method): Also set DECL_MAX_LOCALS.
7992 (create_artificial_method): Call java_parser_context_save_global
7993 and java_parser_context_restore_global instead of saving/restoring
7994 the context by hand.
7995 (expand_start_java_method): Improved verbose mode message.
7996 (java_complete_expand_methods): Fixed leading comment. Use
7997 DECL_CLINIT_P.
7998 (fix_constructors): Added assignment to this$<n> if necessary.
7999 (java_expand_classes): Call java_complete_expand_classes instead
8000 of java_complete_expand_methods.
8001 (make_qualified_primary): Simplified.
8002 (merge_qualified_name): Optimized for missing left or right parts.
8003 (resolve_expression_name): Handle access to outer class fields from
8004 interclasses.
8005 (resolve_qualified_expression_name): New macro
8006 RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
8007 classes. Report error on non appropriate qualification of
8008 `new'. Handle qualified `this'.
8009 (not_accessible_p): Allow access to outer class private fields from
8010 inner classes.
8011 (patch_method_invocation): Handle method invocations through
8012 access methods and inner class constructor invocations.
8013 (find_applicable_accessible_methods_list): Search enclosing
8014 contexts of an inner class.
8015 (search_applicable_methods_list): Fixed typo.
8016 (argument_types_convertible): Handle inner class constructors'
8017 hidden outer context reference argument.
8018 (qualify_ambiguous_name): Handle qualified `this'.
8019 (java_complete_lhs): Handle use of field accessed through
8020 artificial access methods in various cases of assignments. Handle
8021 CLASS_LITERAL node.
8022 (check_final_assignment): Use DECL_CLINIT_P.
8023 (valid_ref_assignconv_cast_p): Handle the destination being an
8024 enclosing context of the source.
8025 (patch_unaryop): Handle use of field accessed through artificial
8026 access methods.
8027 (patch_return): Use DECL_CLINIT_P.
8028 (patch_throw_statement): Use DECL_CLINIT_P.
8029 (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
8030 * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
8031 ID_INIT_P.
8032
8033 2000-01-16 Anthony Green <green@cygnus.com>
8034
8035 * parse.y (build_string_concatenation): Only use
8036 StringBuffer(String) shortcut if String arg is constant.
8037
8038 2000-01-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
8039
8040 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
8041 the shift value to int. Fixed typo in comment.
8042
8043 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
8044
8045 * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
8046 * jcf-write.c: Likewise.
8047 * parse.y: Likewise.
8048 * parse.c: Regenerate.
8049
8050 2000-01-09 Anthony Green <green@cygnus.com>
8051
8052 * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
8053 bytecodes in the correct order.
8054
8055 2000-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8056
8057 * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
8058
8059 2000-01-06 Anthony Green <green@cygnus.com>
8060
8061 * expr.c (java_lang_expand_expr): Switch to permanent obstack
8062 before building constant array decl.
8063
8064 2000-01-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
8065
8066 * jcf-write.c (generate_bytecode_conditional): Fixed indentation in
8067 method invocation and typo in conditional expression.
8068 (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
8069 the appropriate NOTE_POP.
8070 * parse.y (patch_binop): Shift value mask to feature the right
8071 type.
8072
8073 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8074
8075 * class.c (assume_compiled, assume_compiled_node): Add static
8076 prototype.
8077 (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
8078
8079 * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
8080
8081 * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
8082
8083 * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
8084 to `__modifier' to avoid stringifying it.
8085
8086 * parse.y (verify_constructor_circularity): Don't call a variadic
8087 function with a non-literal format string.
8088 (java_check_abstract_methods): Move unreachable code inside
8089 `continue' statement.
8090 (lookup_method_invoke): Call xstrdup, not strdup.
8091
8092 * expr.c (expand_java_field_op): Avoid the use of ANSI string
8093 concatenation.
8094
8095 * jcf-parse.c (yyparse): Likewise.
8096
8097 * jv-scan.c (main): Likewise.
8098
8099 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8100
8101 * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
8102 ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
8103 ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
8104 concatenation.
8105
8106 * parse.y (synchronized, variable_redefinition_error,
8107 check_class_interface_creation, create_interface, create_class,
8108 method_header, finish_method_declaration,
8109 check_modifiers_consistency, method_declarator,
8110 complete_class_report_errors, check_abstract_method_definitions,
8111 java_check_regular_methods, check_throws_clauses,
8112 java_check_abstract_methods, read_import_dir,
8113 check_pkg_class_access, declare_local_variables, fix_constructors,
8114 cut_identifier_in_qualified, resolve_expression_name,
8115 resolve_qualified_expression_name, patch_method_invocation,
8116 java_complete_lhs, patch_assignment, try_builtin_assignconv,
8117 patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
8118 patch_exit_expr, patch_exit_expr, patch_switch_statement,
8119 patch_try_statement, patch_synchronized_statement,
8120 patch_throw_statement, check_thrown_exceptions,
8121 patch_conditional_expr): Likewise.
8122
8123 1999-12-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8124
8125 * Makefile.in (LIBDEPS): Added gcc's errors.o
8126 (../jcf-dump$(exeext):): Link with gcc's errors.o
8127 (../gcjh$(exeext):): Likewise.
8128 * expr.c (expand_java_NEW): Layout the entire target type instead of
8129 laying out its methods only.
8130 (lookup_field): Layout the class after having loaded it.
8131 * java-tree.h (java_debug_context): Declared.
8132 * jcf-io.c (toplev.h): Included.
8133 (find_class): Removed assignment to jcf's outofsynch
8134 field. Force source file to be read if newer than its matching
8135 class file. Tweaked debug messages.
8136 * jcf-parse.c (jcf_out_of_synch): Deleted.
8137 (read_class): Call to jcf_out_of_synch removed.
8138 * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
8139 (jcf_out_of_synch): Prototype deleted.
8140 * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
8141 `deprecated' and `class_err': integer turned into bit-fields.
8142 New bit-fields `saved_data_ctx' and `saved_data'. Fixed comments.
8143 * parse.y (package_list): New global.
8144 (package_declaration:): Record newly parsed package name.
8145 (extra_ctxp_pushed_p): Static global deleted.
8146 (java_parser_context_save_global): Create buffer context for the
8147 purpose of saving globals, if necessary.
8148 (java_parser_context_restore_global): Pop context pushed for the
8149 purpose of saving globals, if necessary.
8150 (java_debug_context_do): New prototype and function.
8151 (java_debug_context): Likewise.
8152 (do_resolve_class): Use already parsed package names to qualify
8153 and lookup class candidate.
8154 (java_pre_expand_clinit): Removed unnecessary local variable.
8155
8156 1999-12-17 Tom Tromey <tromey@cygnus.com>
8157
8158 * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
8159 fixes PR gcj/119.
8160 (process_file): Use `\n\' at end of each line in string.
8161
8162 1999-12-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
8163
8164 * expr.c (expand_invoke): Layout the loaded class before
8165 attempting to use it.
8166 (expand_java_field_op): Allow final field assignments to take
8167 place in $finit$.
8168 * typeck.c (convert): Return error_mark_node if expr is null.
8169
8170 1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
8171
8172 * class.c (class_depth): Return -1 if the class doesn't load
8173 properly.
8174 * expr.c (can_widen_reference_to): Check for errors during depth
8175 computation and return 0 accordingly.
8176 * jcf-parse.c (parse_source_file): Call java_fix_constructors to
8177 create default constructors and add an other error check.
8178 * parse.h (java_fix_constructors): Prototyped.
8179 * parse.y (java_pre_expand_clinit): Likewise.
8180 (build_super_invocation): Re-prototyped to feature one argument.
8181 (java_check_circular_reference): Directly use `current'.
8182 (java_fix_constructors): New function.
8183 (java_check_regular_methods): Don't create default constructors
8184 here, but abort if none were found.
8185 (java_complete_expand_methods): Pre-process <clinit> calling
8186 java_pre_expand_clinit.
8187 (java_pre_expand_clinit): New function.
8188 (fix_constructors): build_super_invocation invoked with the
8189 current method declaration as an argument.
8190 (build_super_invocation): Use the context of the processed method
8191 decl argument instead of current_class.
8192 * typeck.c (lookup_java_method): Take WFLs in method names into
8193 account.
8194
8195 1999-12-14 Per Bothner <per@bothner.com>
8196
8197 * class.c (make_class_data): flag_keep_inline_functions to keep
8198 private methods in the method array.
8199
8200 1999-12-15 Anthony Green <green@cygnus.com>
8201
8202 * check-init.c (check_init): Take into account both types of
8203 `throw's when checking for uninitialized variables.
8204
8205 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8206
8207 * parse.y (java_complete_lhs): Force convertion of array
8208 dimensions to int_type_node, that's what runtime's ABI expects.
8209
8210 1999-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
8211
8212 * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
8213 operand of a WFL, until the Java front-end gets fixed with regard
8214 to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
8215
8216 1999-12-10 Andrew Haley <aph@cygnus.com>
8217
8218 * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
8219 decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
8220 expr.c (build_java_athrow): Add support for sjlj-exceptions.
8221 java-tree.h: Ditto.
8222 jcf-write.c: Ditto.
8223
8224 1999-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
8225
8226 * expr.c (java_lang_expand_expr): Switch to permanent obstack
8227 before calling expand_eh_region_start and expand_start_all_catch.
8228 * except.c (expand_start_java_handler): Switch to permanent
8229 obstack before calling expand_eh_region_start.
8230 (expand_end_java_handler): Switch to permanent obstack before
8231 calling expand_start_all_catch.
8232
8233 1999-12-5 Anthony Green <green@cygnus.com>
8234
8235 * decl.c (init_decl_processing): Mark throw_node as a noreturn
8236 function with side effects.
8237 (init_decl_processing): Mark all memory allocating DECLs with
8238 DECL_IS_MALLOC.
8239
8240 1999-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8241
8242 * except.c (expand_end_java_handler): Call
8243 expand_resume_after_catch and end_catch_handler.
8244
8245 1999-11-30 Anthony Green <green@cygnus.com>
8246
8247 * verify.c (verify_jvm_instructions): Create new return label
8248 chain if non existent (don't rely on the verified state of the jsr
8249 target.)
8250
8251 1999-11-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
8252
8253 * jcf-write.c (generate_bytecode_insns): Fixed indentation for
8254 COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
8255
8256 * parse.y (patch_assignment): Removed bogus final class test on
8257 lhs when checking on whether to emit an ArrayStoreException runtime
8258 check.
8259 * expr.c (expand_java_arraystore): Likewise.
8260
8261 1999-11-28 Anthony Green <green@cygnus.com>
8262
8263 * decl.c (find_local_variable): Reuse single slot decls when
8264 appropriate.
8265
8266 1999-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
8267
8268 * jcf-parse.c (saw_java_source): Global variable removed.
8269 (read_class): Don't use `saw_java_source'. Added extra braces.
8270 (yyparse): Code setting `saw_java_source' removed.
8271
8272 1999-11-24 Mark Mitchell <mark@codesourcery.com>
8273
8274 * except.c (emit_handlers): Zero catch_clauses after emitting them.
8275
8276 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
8277
8278 * verify.c (merge_type_state): Non verified subroutines being
8279 considered more than once to trigger passive type merge.
8280
8281 1999-11-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
8282
8283 * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
8284 in case of error. Error message tuned.
8285
8286 1999-11-21 Anthony Green <green@cygnus.com>
8287
8288 * constants.c (find_methodref_index): Unwrap method names before
8289 inserting them in the constant pool.
8290
8291 * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
8292
8293 * class.c (assume_compiled_node): New typedef.
8294 (assume_compiled_tree): New static data.
8295 (find_assume_compiled_node): New function.
8296 (add_assume_compiled): New function.
8297 (assume_compiled): New function.
8298 * class.c (make_class_data): Use assume_compiled.
8299 (is_compiled_class): Use assume_compiled.
8300
8301 * java-tree.h (add_assume_compiled): Declare.
8302
8303 * lang.c (lang_decode_option): Parse new options.
8304
8305 1999-11-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8306
8307 * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
8308 int_type_node: that's what `_Jv_AllocObject' expects.
8309
8310 1999-11-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
8311
8312 * parse.y (lookup_method_invoke): Use lang_printable_name to
8313 reliably build the type name during error report. Fixes PR gcj/97.
8314
8315 1999-11-09 Tom Tromey <tromey@cygnus.com>
8316
8317 * jcf-path.c: Include <sys/stat.h>.
8318 (jcf_path_init): Search for libjava.zip. Fixes PR gcj/84.
8319 (DIR_UP): New macro.
8320
8321 1999-11-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
8322
8323 * parse.y (source_end_java_method): Resume permanent allocation,
8324 reversing Apr 27 1998 patch.
8325 (patch_string_cst): Pop obstacks after having pushed the permanent
8326 ones.
8327
8328 1999-11-05 Tom Tromey <tromey@cygnus.com>
8329
8330 * class.c (finish_class): Emit inlined methods if any native
8331 methods exist in the class. Fixes PR gcj/85.
8332
8333 1999-11-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
8334
8335 * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
8336 (qualify_ambiguous_name): Likewise.
8337
8338 1999-11-03 Godmar Back <gback@cs.utah.edu>
8339
8340 * typeck.c: (lookup_java_method): search all inherited
8341 interfaces when looking up interface method.
8342
8343 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8344
8345 * parse.y (method_header:): Issue error message for rule `type
8346 error'.
8347 (synchronized:): Error report when not using synchronized.
8348
8349 1999-11-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
8350
8351 * parse.y (resolve_qualified_expression_name): Prevent `this' from
8352 being used before the superclass constructor has been called.
8353 (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
8354 instead of `CALL_THIS_CONSTRUCTOR_P'.
8355
8356 1999-10-30 Todd T. Fries <todd@lighthouse.fries.net>
8357
8358 * check-init.c: Fix typo in comment.
8359
8360 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8361
8362 * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
8363 and final method.
8364
8365 1999-10-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
8366
8367 * parse.y (expression_statement:): Call function to report
8368 improper invocation of a constructor.
8369 (parse_ctor_invocation_error): New function.
8370
8371 1999-10-26 Mark Mitchell <mark@codesourcery.com>
8372
8373 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
8374 remember_end_note.
8375
8376 1999-10-21 Tom Tromey <tromey@cygnus.com>
8377
8378 * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
8379 in generated `main'.
8380
8381 1999-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
8382
8383 * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
8384 (qualify_ambiguous_name): Likewise.
8385
8386 1999-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
8387
8388 * parse.y (java_complete_tree): fold_constant_for_init to work on
8389 permanent_obstack.
8390 (java_complete_lhs): Likewise.
8391 (array_constructor_check_entry): Complete an initializer element
8392 on permanent_obstack.
8393
8394 1999-10-19 Tom Tromey <tromey@cygnus.com>
8395
8396 * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
8397 From Mike Moreton <mike@pillim.demon.co.uk>.
8398
8399 1999-10-15 Greg McGary <gkm@gnu.org>
8400
8401 * java-tree.h (flag_bounds_check): Remove extern decl.
8402 * lang.c (flag_bounds_check): Remove global variable.
8403 (lang_f_options): Remove "bounds-check" entry.
8404 (lang_init_options): Default flag_bounds_check to "on".
8405
8406 1999-10-14 Tom Tromey <tromey@cygnus.com>
8407
8408 * jvgenmain.c (usage): New function.
8409 (main): Use it. Also, handle `-D' options.
8410 * jvspec.c (lang_specific_driver): Recognize -D.
8411 (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
8412
8413 * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
8414
8415 1999-10-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8416
8417 * jcf-dump.c (print_constant, disassemble_method): Don't call a
8418 variadic function with a non-literal format string.
8419
8420 * parse-scan.y (report_main_declaration): Likewise.
8421
8422 * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
8423
8424 * parse.y (read_import_dir, patch_assignment, patch_binop,
8425 patch_array_ref): Likewise.
8426
8427 * typeck.c (build_java_array_type): Likewise.
8428
8429 * verify.c (verify_jvm_instructions): Likewise.
8430
8431 1999-10-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
8432
8433 * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
8434
8435 1999-10-07 Anthony Green <green@cygnus.com>
8436
8437 * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
8438 where CHECK_PUT may fail for valid reasons.
8439
8440 * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
8441 UNSAFE_PUTN): New macros.
8442
8443 1999-10-04 Tom Tromey <tromey@cygnus.com>
8444
8445 * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
8446 well. Fixes Java PR gcj/59.
8447 * parse-scan.y (yyerror): Report errors.
8448
8449 1999-09-24 Glenn Chambers <GChambers@provsol.com>
8450
8451 * decl.c (insert_block): Remove unconditional `abort'.
8452
8453 1999-09-24 Bernd Schmidt <bernds@cygnus.co.uk>
8454
8455 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
8456 FUNCTION_CODE now of type int. All callers changed.
8457 Set the builtin's DECL_BUILT_IN_CLASS.
8458
8459 1999-09-23 Tom Tromey <tromey@cygnus.com>
8460
8461 * jvspec.c (lang_specific_driver): Don't read spec file if
8462 -fsyntax-only given.
8463
8464 1999-09-22 Tom Tromey <tromey@cygnus.com>
8465
8466 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
8467
8468 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
8469 (WORDS_TO_LONG): Likewise.
8470 (WORDS_TO_DOUBLE): Likewise.
8471
8472 1999-09-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
8473
8474 * jcf-write.c (RELOCATION_VALUE_0): New macro.
8475 (RELOCATION_VALUE_1): Likewise.
8476 (emit_iinc, emit_reloc, push_constant1, push_constant2,
8477 push_in_const, push_long_const): Prototyped.
8478 (push_constant1): Argument `index' is of type HOST_WIDE_INT.
8479 (push_constant2): Likewise.
8480 (push_int_const): Cast find_constant1's integer arguments to `jword'.
8481 (find_constant_wide): Cast find_constant2's integer arguments to
8482 `jword'.
8483 (find_constant_index): Cast find_constant2's and find_constant2's
8484 integer arguments to `jword'.
8485 (emit_pop): Argument `value' is of type HOST_WIDE_INT.
8486 (emit_switch_reloc): Use RELOCATION_VALUE_0.
8487 (emit_if): Use RELOCATION_VALUE_1.
8488 (emit_goto): Likewise.
8489 (emit_jsr): Likewise.
8490 (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
8491 argument to push_long_const to HOST_WIDE_INT.
8492
8493 1999-09-15 Andreas Schwab <schwab@suse.de>
8494
8495 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
8496
8497 1999-09-20 Nick Clifton <nickc@cygnus.com>
8498
8499 * lang.c (lang_decode_option): Extend comment.
8500
8501 1999-09-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
8502
8503 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
8504 instead of fndecl.
8505
8506 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8507
8508 * gjavah.c (get_field_name, print_method_info, print_include,
8509 add_namelet): Use xmalloc, not malloc.
8510
8511 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
8512 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
8513 NULL pointer.
8514
8515 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
8516
8517 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
8518
8519 * jcf-path.c (add_entry): Likewise.
8520
8521 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
8522
8523 * jv-scan.c (xmalloc): Remove definition.
8524
8525 * jvgenmain.c (xmalloc): Likewise.
8526
8527 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
8528
8529 * lex.c (java_store_unicode): Use xrealloc, not realloc.
8530
8531 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
8532 concat, not xmalloc/sprintf.
8533 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
8534 (xstrdup): Remove definition.
8535
8536 * parse.y (duplicate_declaration_error_p,
8537 constructor_circularity_msg, verify_constructor_circularity,
8538 check_abstract_method_definitions, java_check_regular_methods,
8539 java_check_abstract_methods, patch_method_invocation,
8540 check_for_static_method_reference, patch_assignment, patch_binop,
8541 patch_cast, array_constructor_check_entry, patch_return,
8542 patch_conditional_expr): Use xstrdup, not strdup.
8543
8544 * zextract.c (ALLOC): Use xmalloc, not malloc.
8545
8546 1999-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8547
8548 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
8549
8550 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
8551 (do_spec, lang_specific_pre_link, lang_specific_driver,
8552 input_filename, input_filename_length): Don't declare.
8553 (main_class_name, jvgenmain_spec, lang_specific_driver):
8554 Constify a char*.
8555 (lang_specific_driver): All calls to the function pointer
8556 parameter now explicitly call `fatal'.
8557
8558 1999-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
8559
8560 * parse.y (find_applicable_accessible_methods_list): Search
8561 abstract classes as interfaces.
8562
8563 1999-09-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
8564
8565 * class.c (finish_class): We're now outside a valid method
8566 declaration. Tell the rest of gcc so.
8567
8568 1999-09-08 Bruce Korb autogen@linuxbox.com
8569
8570 * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
8571
8572 1999-09-07 Tom Tromey <tromey@cygnus.com>
8573
8574 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
8575 java-array.h.
8576 (decode_signature_piece): Don't emit "::" in JArray<>.
8577 (print_namelet): Only print trailing `;' when printing a class.
8578
8579 1999-09-10 Bernd Schmidt <bernds@cygnus.co.uk>
8580
8581 * java-tree.h: Delete declarations for all tree nodes now moved to
8582 global_trees.
8583 * decl.c: Delete their definitions.
8584
8585 1999-09-04 Mark Mitchell <mark@codesourcery.com>
8586
8587 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
8588 * Makefile.in (OBJS): Add ggc-callbacks.o.
8589 (OBJDEPS): Likewise.
8590
8591 1999-09-03 Tom Tromey <tromey@cygnus.com>
8592
8593 * parse.y (strip_out_static_field_access_decl): Return operand if
8594 it satisfies JDECL_P.
8595
8596 1999-09-02 Tom Tromey <tromey@cygnus.com>
8597
8598 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
8599 Handle nested arrays, like `[[I'.
8600
8601 1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8602
8603 * class.c (finish_class): Remove unused parameter, all callers
8604 changed.
8605
8606 * expr.c (build_java_athrow): Change return type to void.
8607 (java_lang_expand_expr): Make sure each case in switch returns a
8608 value.
8609
8610 * java-tree.h (finish_class): Fix prototype to take void args.
8611
8612 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
8613 (main): Issue return from main, not exit.
8614
8615 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
8616
8617 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
8618
8619 * jv-scan.c (main): Issue return from main, not exit.
8620
8621 * parse.y (check_abstract_method_definitions,
8622 java_check_abstract_method_definitions): Add static prototypes.
8623 (java_complete_expand_methods): Fix call to `finish_class'.
8624
8625 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
8626 and `prevpc'.
8627
8628 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8629
8630 * lang.c (language_string): Constify.
8631
8632 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8633
8634 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
8635 Remove hacks for stuff which comes from libiberty.
8636
8637 * Make-lang.in: Likewise.
8638
8639 1999-08-30 Hans-Peter Nilsson <hp@axis.se>
8640
8641 * Makefile.in (xref.o): Depend on xref.c explicitly.
8642
8643 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8644
8645 * java-tree.h (lang_printable_name): Constify a char*.
8646
8647 * lang.c (lang_printable_name): Likewise.
8648
8649 1999-08-27 Jeffrey A Law (law@cygnus.com)
8650
8651 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
8652 comments in C code.
8653
8654 1999-08-26 Tom Tromey <tromey@cygnus.com>
8655
8656 * gjavah.c (print_cxx_classname): Print "::" before qualified
8657 name.
8658
8659 1999-08-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
8660
8661 * parse.y (lookup_cl): Changed leading comment. Now does its best
8662 to set the column number.
8663 (qualify_ambiguous_name): Take WFL wrappers into account.
8664
8665 1999-08-25 Gregg Townsend <gmt@cs.arizona.edu>
8666
8667 * verify.c (verify_jvm_instructions): Don't check instruction
8668 validity beyond end of method.
8669
8670 1999-08-25 Tom Tromey <tromey@cygnus.com>
8671
8672 * jvspec.c (lang_specific_driver): Correctly handle --help again.
8673
8674 1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8675
8676 * gjavah.c (print_name, print_base_classname, utf8_cmp,
8677 cxx_keyword_subst, generate_access, name_is_method_p,
8678 get_field_name, print_field_name, super_class_name, print_include,
8679 decode_signature_piece, print_class_decls, usage, help,
8680 java_no_argument, version, add_namelet, print_namelet): Add static
8681 prototype.
8682 (print_base_classname, utf8_cmp, cxx_keyword_subst,
8683 name_is_method_p): Constify a char*.
8684 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
8685 Provide a final else clause in an if-else-if.
8686 (print_field_info): Add missing final arg in function call to
8687 `print_field_name'.
8688 (print_method_info, decompile_method, decode_signature_piece,
8689 print_c_decl, print_full_cxx_name, print_stub,
8690 print_mangled_classname, super_class_name, print_include,
8691 add_namelet, add_class_decl, print_class_decls, process_file,
8692 help): Constify a char*.
8693
8694 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
8695 push_int_const, find_constant_wide, find_constant_index,
8696 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
8697 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
8698 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
8699 emit_if, emit_goto, emit_jsr, call_cleanups,
8700 make_class_file_name): Add static prototypes.
8701 (generate_bytecode_return, generate_bytecode_insns): Pass a
8702 NULL_PTR, not a NULL_TREE.
8703
8704 * jv-scan.c: Include "jcf.h".
8705 (main): Declare using DEFUN macro.
8706
8707 * jvspec.c (find_spec_file, lang_specific_pre_link,
8708 lang_specific_driver): Add prototypes.
8709 (find_spec_file): Constify a char*.
8710
8711 * keyword.gperf (hash, java_keyword): Add prototypes.
8712
8713 * lang.c (lang_print_error): Add static prototype.
8714 (lang_init): Prefer memcpy over bcopy to avoid casts.
8715
8716 * lex.c (yylex): Add static prototype.
8717
8718 * parse-scan.y: Include "lex.c" earlier.
8719
8720 * parse.h: Remove redundant declaration for `yylex'.
8721
8722 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
8723 labeled_block_contains_loop_p): Add static prototypes.
8724 (not_accessible_p): Make static to match prototype.
8725
8726 * verify.c (start_pc_cmp): Don't needlessly cast away const.
8727
8728 1999-08-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
8729
8730 * parse.y (check_method_redefinition): Changed leading comment.
8731 (check_abstract_method_definitions): New function.
8732 (java_check_abstract_method_definitions): New function.
8733 (java_check_regular_methods): Call it.
8734 (verify_constructor_super): Fixed indentation.
8735 (lookup_method_invoke): Likewise.
8736
8737 1999-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
8738
8739 * parse.y (method_header): Return a null pointer if the current
8740 class node is null.
8741 (finish_method_declaration): Return if the current function decl
8742 is null.
8743 (source_start_java_method): Likewise.
8744 (java_method_add_stmt): Likewise.
8745
8746 1999-08-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
8747
8748 * class.c (emit_register_class): Removed unnecessary call to
8749 start_sequence.
8750 * parse.y (labeled_block_contains_loop_p): Removed unused local
8751 variable.
8752
8753 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8754
8755 * parse.y (java_refold): Added prototype.
8756
8757 1999-08-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
8758
8759 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
8760 (java_stabilize_reference): Removed unnecessary `else'.
8761 (java_complete_lhs): Set flag to remember boolean. Call
8762 java_refold. Added comments.
8763 (java_decl_equiv): New function.
8764 (binop_compound_p): Likewise.
8765 (java_refold): Likewise.
8766 (patch_unaryop): Striped static field access assigned to decl and
8767 op. Changed promotion scheme for ++/-- operators.
8768 (search_loop): New function.
8769 (labeled_block_contains_loop_p): Likewise.
8770 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
8771 comment.
8772 (patch_bc_statement): Call search_loop. Fixed comment.
8773
8774 1999-08-14 Anthony Green <green@cygnus.com>
8775
8776 * expr.c (java_lang_expand_expr): Mark static array data as
8777 referenced.
8778
8779 1999-08-10 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
8780
8781 * jvgenmain.c (main): NUL-terminate name_obstack.
8782
8783 1999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8784
8785 * check-init.c (check_bool2_init, done_alternative): Add static
8786 prototypes.
8787
8788 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
8789 (add_method, build_utf8_ref, build_class_ref,
8790 append_gpp_mangled_type, layout_class_method): Constify a char*.
8791
8792 * decl.c (push_promoted_type, make_binding_level): Add static
8793 prototypes.
8794 (push_promoted_type, pushdecl): Constify a char*.
8795
8796 * except.c (find_handler_in_range, link_handler,
8797 check_start_handlers): Add static prototypes.
8798
8799 * expr.c (process_jvm_instruction): Constify a char*.
8800
8801 * gjavah.c (main): Constify a char*.
8802
8803 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
8804 Constify a char*.
8805
8806 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
8807 static prototypes.
8808 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
8809 munge, print_ents): Constify a char*.
8810
8811 * jcf-dump.c (disassemble_method): Constify a char*.
8812 (print_constant_pool, print_exception_table): Add static prototypes.
8813 (print_constant, print_exception_table, main, disassemble_method):
8814 Constify a char*.
8815
8816 * jcf-io.c (find_classfile, find_class): Likewise.
8817
8818 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
8819 (set_source_filename, predefined_filename_p): Add static prototypes.
8820 (set_source_filename, get_constant, get_class_constant,
8821 find_in_current_zip): Constify a char*.
8822
8823 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
8824 static prototypes.
8825 (add_entry, add_path, jcf_path_classpath_arg,
8826 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
8827
8828 * jcf-reader.c (get_attribute, jcf_parse_preamble,
8829 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
8830 jcf_parse_one_method, jcf_parse_methods,
8831 jcf_parse_final_attributes): Add static prototypes.
8832 (get_attribute): Constify a char*.
8833
8834 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
8835 jcf_dependency_add_target, jcf_path_classpath_arg,
8836 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
8837
8838 * jv-scan.c (main): Constify a char*.
8839 (gcc_obstack_init): Add prototype arguments.
8840
8841 * jvgenmain.c (gcc_obstack_init): Likewise.
8842 (main): Constify a char*.
8843
8844 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
8845 static prototypes.
8846 (put_decl_string, lang_print_error): Constify a char*.
8847 (lang_init): Remove redundant extern prototype.
8848
8849 * mangle.c (emit_unicode_mangled_name): Constify a char*.
8850
8851 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
8852 Add static prototypes.
8853 (get_type_from_signature): Constify a char*.
8854
8855 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
8856 Add static prototypes.
8857 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
8858 (verify_jvm_instructions): Constify a char*.
8859
8860 * xref.c (xref_flag_value): Likewise.
8861
8862 * xref.h (xref_flag_value): Likewise.
8863
8864 * zextract.c (makeword, makelong): Add static prototypes.
8865 (makeword, makelong): Constify a uch*.
8866
8867 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8868
8869 * lang.c (java_dummy_print): Constify a char*.
8870 (lang_print_error): Likewise.
8871 (lang_init): Remove redundant prototype for `print_error_function'.
8872 (lang_init_source): Likewise.
8873 (lang_identify): Constify a char*.
8874
8875 1999-08-09 Tom Tromey <tromey@cygnus.com>
8876
8877 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
8878 (WORDS_TO_LONG): Likewise.
8879 (WORDS_TO_DOUBLE): Likewise.
8880
8881 1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8882
8883 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
8884
8885 * expr.c (java_stack_pop, java_array_data_offset,
8886 build_java_throw_out_of_bounds_exception, case_identity,
8887 build_java_check_indexed_type): Add static prototypes.
8888 (linenumber_table, expand_invoke, expand_java_field_op,
8889 build_primtype_type_ref, expand_byte_code): Constify a char*.
8890
8891 * java-tree.h (build_primtype_type_ref, linenumber_table):
8892 Constify a char*.
8893 (java_lang_expand_expr): Add prototype.
8894
8895 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
8896 `java_lang_expand_expr'.
8897
8898 * lex.c (java_lex_error): Constify a char*.
8899 (java_get_unicode, java_read_char, java_allocate_new_line,
8900 java_unget_unicode, java_sneak_unicode): Prototype.
8901
8902 * parse-scan.y (current_class, package_name, method_declarator,
8903 report_class_declaration, yyerror): Constify a char*.
8904
8905 * parse.h (java_report_errors): Prototype.
8906 (yyerror): Constify a char*.
8907
8908 * parse.y (classitf_redefinition_error, check_modifiers,
8909 parse_jdk1_1_error, lookup_package_type,
8910 lookup_package_type_and_set_next, get_printable_method_name,
8911 purify_type_name): Constify a char*.
8912 (build_super_invocation, maybe_generate_finit,
8913 verify_constructor_super, parser_add_interface,
8914 add_superinterfaces, jdep_resolve_class, note_possible_classname,
8915 java_complete_expand_methods, java_expand_finals,
8916 cut_identifier_in_qualified, java_stabilize_reference,
8917 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
8918 merge_string_cste): Prototype.
8919 (single_type_import_declaration, yyerror,
8920 variable_redefinition_error, build_array_from_name,
8921 build_unresolved_array_type, check_class_interface_creation,
8922 resolve_class, complete_class_report_errors,
8923 note_possible_classname, read_import_dir,
8924 find_in_imports_on_demand, resolve_package, fix_constructors,
8925 check_deprecation, lookup_method_invoke,
8926 maybe_build_primttype_type_ref, array_constructor_check_entry):
8927 Constify a char*.
8928 (java_complete_expand_methods, java_expand_finals): Make static.
8929 (convert_narrow): Remove static prototype.
8930
8931 1999-08-03 J"orn Rennecke <amylaar@cygnus.co.uk>
8932
8933 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
8934
8935 1999-08-02 Richard Henderson <rth@cygnus.com>
8936
8937 * decl.c: Include defaults.h instead of expr.h.
8938 * parse.y: Likewise.
8939
8940 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
8941
8942 * java/decl.c (start_java_method): Change all uses of
8943 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
8944 Ensure expr.h is included.
8945 * java/expr.c (pop_arguments): Ditto.
8946 * java/parse.y (expand_start_java_method): Ditto.
8947
8948 1999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8949
8950 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
8951
8952 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
8953
8954 * decl.c: Include "function.h".
8955 * except.c: Likewise.
8956 * parse.y: Likewise.
8957 * Makefile.in: Update dependencies.
8958
8959 1999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
8960
8961 * expr.c (build_java_soft_divmod): Provide a default case in switch.
8962 (java_lang_expand_expr): Mark parameters `target', `tmode' and
8963 `modifier' with ATTRIBUTE_UNUSED.
8964
8965 * gjavah.c (process_file): Add braces around ambiguous `else'.
8966
8967 * jcf-dump.c (print_access_flags, localvar_free): Change return
8968 type to void.
8969
8970 * parse.y (java_complete_expand_method): Initialize variable
8971 `exception_copy'.
8972 (resolve_qualified_expression_name): Likewise for `field_decl'.
8973 (patch_method_invocation): Likewise for `class_to_search'.
8974 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
8975 (patch_assignment): Likewise for `lhs_type'.
8976
8977 * verify.c (verify_jvm_instructions): Remove unused variable
8978 `caller'.
8979
8980 1999-07-25 Richard Henderson <rth@cygnus.com>
8981
8982 * decl.c (va_list_type_node): New.
8983
8984 1999-07-25 Anthony Green <green@cygnus.com>
8985
8986 * gjavah.c (print_stub): New function.
8987 (METHOD_IS_NATIVE): New macro.
8988 (print_mangled_classname): Make static.
8989 (HANDLE_END_FIELD): Don't emit fields during stub generation.
8990 (process_file): Perform stub generation.
8991 (HANDLE_METHOD): Don't emit class decls during stub
8992 generation.
8993 (HANDLE_END_METHOD): Take into account stub generation.
8994 (print_method_info): Handle stub generation.
8995 (print_stub): New function.
8996 (print_cxx_classname): Make signature consistant with others.
8997 (help): Describe -stubs option.
8998 (main): Create stub file.
8999 (version): Use version.c.
9000 (print_full_cxx_name): New function.
9001 (print_c_decl): Use print_full_cxx_name.
9002
9003 1999-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9004
9005 * check-init.c (check_init): Handle MAX_EXPR.
9006
9007 1999-07-15 Andrew Haley <aph@cygnus.com>
9008
9009 * lang.c (flag_use_divide_subroutine): New variable.
9010 * typeck.c: (convert_ieee_real_to_integer): Bounds check
9011 fp-to-integer conversion.
9012 (convert): Call convert_ieee_real_to_integer when flag_fast_math
9013 is not set.
9014
9015 * expr.c (build_java_soft_divmod): New function.
9016 (build_java_binop): Call build_java_soft_divmod if
9017 flag_use_divide_subroutine is set.
9018 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
9019 soft_lrem_node: new builtin functions.
9020 (init_decl_processing) Initialize the new builtins.
9021 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
9022 soft_lrem_node: new builtin functions.
9023 (build_java_soft_divmod): New function.
9024 * parse.y: Call build_java_soft_divmod if
9025 flag_use_divide_subroutine is set.
9026 * parse.c: Rebuilt.
9027
9028 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
9029 a --specs= arg) even if not linking.
9030 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
9031 -fuse-divide-subroutine
9032
9033 1999-07-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
9034
9035 * parse.y (resolve_and_layout): Check methods only once.
9036 (resolve_qualified_expression_name): Verify thrown exceptions
9037 compatibility.
9038 (check_thrown_exceptions): Reject exceptions thrown in
9039 initializer. Error message tuned.
9040
9041 1999-07-14 Andrew Haley <aph@cygnus.com>
9042
9043 * expr.c (expand_expr): Do not return the last statement in a
9044 block as the block's value.
9045
9046 1999-07-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
9047
9048 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
9049 CALL_EXPR, to avoid order of evaluation changes.
9050
9051 1999-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
9052
9053 * parse.y (qualify_ambiguous_name): Do not use
9054 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
9055
9056 1999-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
9057
9058 * check-init.c (check_init): Handle MAX_EXPR.
9059 * expr.c (force_evaluation_order): Force method call arguments to
9060 be evaluated in left-to-right order.
9061 * parse.y (qualify_ambiguous_name): Loop again to qualify
9062 NEW_ARRAY_EXPR properly.
9063
9064 1999-06-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
9065
9066 * parse.y (patch_invoke): Resolve unresolved invoked method
9067 returned type.
9068 (qualify_ambiguous_name): STRING_CST to qualify expression for
9069 type name resolution.
9070
9071 1999-06-24 Andrew Haley <aph@cygnus.com>
9072
9073 * class.c (finish_class): Whenever a deferred method is
9074 output, rescan the list of methods to see if a new candidate for
9075 output can be found.
9076
9077 1999-06-28 Tom Tromey <tromey@cygnus.com>
9078
9079 * jvspec.c (lang_specific_driver): Recognize --help.
9080
9081 1999-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9082
9083 * parse.y (resolve_package): Fixed bogus return statement.
9084 (patch_method_invocation): Resolve method invocation beginning with
9085 a package name qualifier.
9086
9087 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9088
9089 * Make-lang.in (java.stage1): Depend on stage1-start.
9090 (java.stage2): Likewise for stage2-start.
9091 (java.stage3): Likewise for stage3-start.
9092 (java.stage4): Likewise for stage4-start.
9093
9094 1999-06-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9095
9096 * parse.y (java_complete_lhs): When doing cross referencing, don't
9097 try to keep file location on a WFL expanded as a CALL_EXPR.
9098
9099 1999-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
9100
9101 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
9102 compiling to class file a void method with an empty method body.
9103 As a side effect, the bytecode backend will generate the
9104 appropriate `return' instruction.
9105
9106 1999-06-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9107
9108 * parse.y (lookup_package_type_and_set_next): New function prototype.
9109 (resolve_package): Search current and imported packages.
9110 (lookup_package_type_and_set_next): New function.
9111
9112 1999-06-22 Andrew Haley <aph@cygnus.com>
9113
9114 * verify.c (verify_jvm_instructions): Check for pending blocks
9115 before invalid PC test and opcode switch, not after.
9116
9117 1999-06-21 Andrew Haley <aph@cygnus.com>
9118
9119 * except.c (find_handler_in_range): The upper limit for exception
9120 ranges is exclusive, not inclusive: (start <= pc < end).
9121 (link_handler): find child pointer which points to outer by
9122 searching sibling list: previous code incorrectly assumed that
9123 outer->outer->first_child must point to outer.
9124 * verify.c (verify_jvm_instructions): FIXME added to code for
9125 `athrow'.
9126 (verify_jvm_instructions): Do not assume that the last block
9127 processed in a subroutine is a block which ends with a `ret'
9128 instruction. With some control flows it is possible that the last
9129 block ends with an `athrow'.
9130
9131 1999-06-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9132
9133 * parse.y (qualify_ambiguous_name): Reorganized the post
9134 evaluation of non WFL leading expression nodes.
9135
9136 1999-06-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
9137
9138 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
9139 CONVERT_EXPR.
9140
9141 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9142
9143 * parse.y (qualify_ambiguous_name): Handle qualified expression
9144 beginning with a STRING_CST.
9145
9146 1999-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
9147
9148 * parse.y (register_fields): Set DECL_INITIAL on both
9149 pre-initialized static and public fields.
9150 (resolve_field_access): Static field access expressions to always
9151 use pointer types.
9152 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
9153 qualification. CONVERT_EXPR to be resolved as an expression name.
9154 (java_complete_lhs): Identify and access qualified final
9155 initialized field in switch statement case expression.
9156 (fold_constant_for_init): Pre-initialized field decl constant to
9157 be folded.
9158
9159 1999-06-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
9160
9161 * parse.y (note_possible_classname): Mark returned node with
9162 QUALIFIED_P only if the original class name contained a '/'.
9163
9164 1999-06-05 Anthony Green <green@cygnus.com>
9165
9166 * Make-lang.in (gcjh): More parallel build fixes.
9167
9168 1999-06-03 Mike Stump <mrs@wrs.com>
9169
9170 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
9171
9172 1999-06-02 Anthony Green <green@cygnus.com>
9173
9174 * except.c (link_handler): Chain exception handlers in order.
9175
9176 1999-06-02 Anthony Green <green@cygnus.com>
9177
9178 * expr.c (expand_byte_code): Fill unreachable bytecode regions
9179 with nops and process as usual in order to always set correct EH
9180 ranges. Emit detailed warnings about unreachable bytecodes.
9181
9182 1999-06-02 Anthony Green <green@cygnus.com>
9183
9184 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
9185 constant.
9186
9187 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
9188
9189 * parse.y (lookup_field_wrapper): Unified returned value to NULL
9190 or the searched field decl.
9191
9192 1999-05-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
9193
9194 * parse.y (fold_constant_for_init): Convert numerical constant
9195 values to the type of the assigned field.
9196
9197 1999-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9198
9199 * expr.c (lookup_field): Relaxed the test on class loading error
9200 detection.
9201 * parse.y (fold_constant_for_init): Enabeled old code.
9202
9203 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
9204
9205 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
9206 decide the validity of the cast of a java.lang.Cloneable reference
9207 to an array.
9208 (patch_conditional_expr): Fixed first argument passed to
9209 binary_numeric_promotion.
9210
9211 1999-05-26 Alexandre Petit-Bianco <apbianco@cygnus.com>
9212
9213 * parse.y (qualify_ambiguous_name): Take into account that a
9214 CONVERT_EXPR might specify a type as a WFL.
9215
9216 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9217
9218 * parse.y (patch_assignment): Save the rhs before using it as an
9219 argument to _Jv_CheckArrayStore.
9220
9221 1999-05-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
9222
9223 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
9224
9225 1999-05-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9226
9227 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
9228 floating point litteral only when the exponent indicator has been
9229 parsed.
9230
9231 1999-05-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9232
9233 * parse.y (formal_parameter:): Construct argument tree list
9234 element even if a yet unsupported final parameter was encountered.
9235
9236 1999-05-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
9237
9238 * parse.y (finish_method_declaration): Issue errors for native or
9239 abstract methods declared with a method body, as well as for non
9240 native or non abstract methods with no method body.
9241
9242 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9243
9244 * class.c (build_utf8_ref): Initialize variable `field'.
9245
9246 * decl.c (init_decl_processing): Initialize variable `field'.
9247
9248 * expr.c (build_known_method_ref): Mark parameters `method_type',
9249 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
9250 (process_jvm_instruction): Likewise for parameter `length'.
9251
9252 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
9253 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
9254 ATTRIBUTE_UNUSED.
9255
9256 * parse.y (maybe_generate_clinit): Remove unused variable
9257 `has_non_primitive_fields'.
9258 (find_in_imports_on_demand): Initialize variables `node_to_use'
9259 and `cl'.
9260 (patch_binop): Likewise for variable `prom_type'.
9261 (patch_unaryop): Likewise for variable `prom_type'.
9262
9263 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
9264
9265 * xref.c (xref_table): Add missing initializer.
9266
9267 1999-05-14 Tom Tromey <tromey@cygnus.com>
9268
9269 * java-except.h (struct eh_range): Removed unused `next' member.
9270 * verify.c (verify_jvm_instructions): Call check_nested_ranges
9271 after adding all exception handlers. Sort exception ranges in
9272 order of start PC.
9273 (struct pc_index): New structure.
9274 (start_pc_cmp): New function.
9275 * except.c (add_handler): Return `void'. Don't call link_handler;
9276 instead construct an ordinary linked list and do range
9277 coalescing.
9278 (check_nested_ranges): New function.
9279 (link_handler): Changed interface to allow merging of eh_ranges.
9280 Split overlapping ranges. Return `void'.
9281
9282 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9283
9284 * parse.y (constructor_block_end:): New rule, tagged <node>.
9285 (constructor_body:): Use `constructor_block_end' instead of
9286 `block_end'.
9287
9288 1999-05-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
9289
9290 * parse.y (statement_nsi:): Pop `for' statement block.
9291 (java_complete_lhs): Labeled blocks containing no statement are
9292 marked as completing normally.
9293
9294 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9295
9296 * xref.c (xref_set_current_fp): New function, defined.
9297 * xref.h (xref_set_current_fp): New function, prototyped.
9298
9299 1999-05-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
9300
9301 * check-init.c (check_init): Take into account that
9302 LABELED_BLOCK_STMT can be empty.
9303
9304 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
9305
9306 * parse.y (java_check_regular_methods): Warning check on not
9307 overriding methods with default access in other packages does not
9308 apply to `<clinit>'.
9309 (java_complete_lhs): If block body is an empty_stmt_node, replace
9310 it by NULL_TREE. This prevents gcc from generating an irrelevant
9311 warning.
9312
9313 1999-05-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
9314
9315 * check-init.c (check_init): Removed code accepting to see things
9316 falling through default:, when doing xrefs.
9317 * java-tree.h (do_not_fold): New global variable, declared.
9318 * parse.y (do_not_fold): New global variable, defined.
9319 (java_complete_expand_method): Set `do_not_fold' to the value of
9320 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
9321 and reinstall them after them have been purged; do not check for
9322 initializations; do not issue missing return errors.
9323 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
9324 when doing xrefs.
9325 (patch_binop): Skip the fold part when doing xrefs.
9326 (build_string_concatenation): Skip the concatenation part when
9327 doing xrefs.
9328 (patch_synchronized_statement): Do not generate a try-finally when
9329 doing xrefs.
9330 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
9331 and keep the location where the throw was seen.
9332 * typeck.c (convert): When `do_not_fold' is set, do not attempt
9333 any treatment on the converted node an simply return a NOP_EXPR of
9334 the targeted type.
9335 * xref.c (xref_get_data): New function, defined.
9336 * xref.h (xref_get_data): New function, declared.
9337 (XREF_GET_DATA): Use xref_get_data.
9338
9339 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9340
9341 * gjavah.c (print_include): Cast the result of `strlen' to int
9342 when comparing against a signed value.
9343 (add_namelet): Likewise.
9344
9345 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9346
9347 * expr.c (expand_invoke): Mark parameter `nargs' with
9348 ATTRIBUTE_UNUSED.
9349 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
9350
9351 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
9352 ATTRIBUTE_UNUSED.
9353
9354 * jcf-reader.c (get_attribute): Cast a value to long
9355 when comparing against a signed expression. Likewise.
9356
9357 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
9358 HOST_BITS_PER_CHAR.
9359
9360 1999-05-11 Andrew Haley <aph@cygnus.com>
9361
9362 * parse.y (source_end_java_method): If the current method contains
9363 any exception handlers, force asynchronous_exceptions: this is
9364 necessary because signal handlers in libjava may throw exceptions.
9365 * decl.c (end_java_method): Ditto.
9366
9367 1999-05-11 Tom Tromey <tromey@cygnus.com>
9368
9369 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
9370 flags.
9371 * jvspec.c (THREAD_NAME): Removed.
9372 (GC_NAME): Likewise.
9373 (MATHLIB): Likewise.
9374 (WITHLIBC): Likewise.
9375 (GCLIB): Likewise.
9376 (THREADLIB): Likewise.
9377 (MATH_LIBRARY): Likewise.
9378 (lang_specific_driver): Don't add `-l' options to command line.
9379 Instead, add a single --specs option. Recognize `-L' options and
9380 use them to search for spec file.
9381 (find_spec_file): New function.
9382 (SPEC_FILE): New define.
9383
9384 1999-05-11 Dave Brolley <brolley@cygnus.com>
9385
9386 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
9387 cpplib-enabled build.
9388
9389 1999-05-05 Per Bothner <bothner@cygnus.com>
9390
9391 * class.c (make_field_value): DECL_INITIAL may be a string literal;
9392 temporarily zero it while calling rest_of_decl_compilation.
9393
9394 * java-tree.h (string_ptr_type_node): Add declaration.
9395 * decl.c: Define and initialize string_ptr_type_node.
9396 * parse.y (patch_string_cst): Use string_ptr_type_node.
9397
9398 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
9399 * parse.y (for_statement): Now unconditionally exit_block.
9400 (finish_labeled_statement): No longer exit_block if for-loop.
9401 (patch_loop_statement): Check harder if the loop is already labeled.
9402
9403 * parse.y (patch_initialized_static_field): Removed function.
9404 (maybe_generate_clinit): Removed special handling for interfaces.
9405 (java_complete_expand_methods): Do a preliminary java_complete_tree
9406 on <clinit> to determine if it can be removed.
9407 (java_complete_expand_method): Remove special handling for <clinit>.
9408 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
9409 optimize if we get back empty_stmt_node.
9410 For MODIFY_EXPR, re-do checking of static initializers.
9411 (fold_constant_for_init): Don't return immediate if VAR_DECL.
9412 For VAR_DECL, pass correct context.
9413
9414 * verify.c (verify_jvm_instructions): Better error messages.
9415
9416 1999-05-03 Tom Tromey <tromey@cygnus.com>
9417
9418 * parse-scan.y (interface_declaration): Call
9419 report_class_declaration for interfaces.
9420
9421 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
9422
9423 * Makefile.in: Remove -v from bison command lines.
9424
9425 1999-04-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
9426
9427 * check-init.c (check_init): Exclude a case of error when doing
9428 xrefs.
9429 * class.c (layout_class_method): Don't generate the error message
9430 twice when compiling from source.
9431 * lang-options.h: Added `-Wredundant-modifers' and
9432 `-Wunusupported-jdk11' flags and help text.
9433 * lang.c (lang_decode_option): Added support for
9434 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
9435 flag_static_local_jdk11 and flag_redundant set accordingly.
9436 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
9437 * parse.h (EXPR_WFL_ADD_COL): New macro.
9438 (DECL_END_SOURCE_LINE): Likewise.
9439 (DECL_INHERITED_SOURCE_LINE): Likewise.
9440 * parse.y (static_ref_err): New function, prototyped.
9441 (CCB_TK): Now tagged <operator>.
9442 (class_body:): Remember the location of the closing '}' of a class
9443 definition when doing xrefs.
9444 (block:): Likewise.
9445 (block_end:): Likewise.
9446 (create_class): Remember the location of the inherited class
9447 identifier when doing xrefs.
9448 (register_fields): Added test on first operand of `init' before
9449 testing it TREE_CODE.
9450 (method_header): Store the location of the class identifier in the
9451 class decl when doing xrefs.
9452 (finish_method_declaration): Don't combine first/last method line
9453 when doing xref.
9454 (java_check_regular_methods): Warning check on not overriding
9455 methods with default access on other packages move before check on
9456 static methods. Initialization of `aflags' also moved up.
9457 (resolve_expression_name): Call static_ref_err to report the error.
9458 (static_ref_err): New function, implemented.
9459 (resolve_field_access): Returned simplified static field access
9460 when doing xrefs.
9461 (resolve_qualified_expression_name): Check for illegal use of
9462 static fields in a non static context. Call static_ref_err to
9463 report error in various places.
9464 (java_complete_tree): Do not fold initialized static fields when
9465 doing xrefs.
9466 (java_complete_lhs): Likewise.
9467
9468 1999-04-29 Anthony Green <green@cygnus.com>
9469
9470 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
9471 create internal labels.
9472 (lookup_label): Ditto.
9473
9474 1999-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
9475
9476 * class.c (layout_class_method): Generate <clinit>'s rtl for
9477 interfaces.
9478 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
9479 for interfaces' <clinit>.
9480 * expr.c (lookup_field): Search for fields in interfaces.
9481 (expand_invoke): Fixed indentation.
9482 (expand_java_field_op): Likewise. Use IS_CLINIT.
9483 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
9484 (IS_CLINIT): New macro.
9485 * parse.y (type_declaration:): Call maybe_generate_clinit after an
9486 interface was parsed.
9487 (maybe_generate_clinit): Don't generate if the current class is an
9488 interface with only fields of primitive types.
9489 (reset_method_name): Use IS_CLINIT.
9490 (java_complete_expand_method): Expand <clinit> when it exists for
9491 interfaces. Use IS_CLINIT.
9492 (resolve_expression_name): Use DECL_CONTEXT instead of
9493 current_class to build static field references.
9494 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
9495 ARRAY_REF when doing xreferencing.
9496 (check_final_assignment): Fixed typo in leading comment. Use
9497 IS_CLINIT.
9498 (patch_array_ref): Don't fully expand array references when
9499 xreferencing.
9500 (patch_return): Use IS_CLINIT.
9501 (patch_throw_statement): Likewise.
9502
9503 1999-04-22 Tom Tromey <tromey@cygnus.com>
9504
9505 * Make-lang.in (JAVA_SRCS): Added check-init.c.
9506
9507 1999-04-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
9508
9509 * decl.c (predef_filenames, predef_filenames_size): New globals
9510 (init_decl_processing): predef_filenames and predef_filenames_size
9511 initialized.
9512 * java-tree.h (predef_filenames, predef_filenames_size): Declared
9513 extern.
9514 * jcf-parse.c (predefined_filename_p): New function.
9515 (yyparse): Check that files on the command line are specified only
9516 once and issue a warning otherwise.
9517 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
9518 * parse.y (source_end_java_method): Nullify NOP method bodies, to
9519 avoid a gcc warning with -W -Wall turned on.
9520 (java_expand_classes): Abort if errors were encountered.
9521 (java_complete_lhs): If the cross reference flag is set, wrap
9522 field DECL node around a WFL when resolving expression name.
9523
9524 1999-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
9525
9526 * lang.c (lang_decode_option): Fixed returned value when parsing
9527 `-fxref=...' and `-Wall'.
9528 * parse.y (source_end_java_method): Do not generate code when
9529 flag_emit_xref is set.
9530 (resolve_expression_name): Do not build static field access when
9531 flag_emit_xref is set.
9532 (resolve_field_access): No special treatment on `length' when
9533 flag_emit_xref is set. Do not build qualified static field access
9534 when flag_emit_xref is set.
9535 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
9536 when flag_emit_xref is set.
9537 (patch_assignment): Do not generate array store runtime check when
9538 flag_emit_xref is set.
9539 * xref.c (xref_flag_value): Fixed function declaration
9540 indentation.
9541 (xset_set_data): New function.
9542 * xref.h (xref_set_data): Added prototype for new function.
9543 (typedef struct xref_flag_table): New field data.
9544 (XREF_GET_DATA): New macro.
9545
9546 1999-04-19 Tom Tromey <tromey@cygnus.com>
9547
9548 * xref.h (enum): Removed trailing comma.
9549
9550 * parse.y (resolve_qualified_expression_name): Added missing
9551 `break'.
9552
9553 1999-04-15 Anthony Green <green@cygnus.com>
9554
9555 * gjavah.c: New prototypes for java_float_finite and
9556 java_double_finite.
9557
9558 1999-04-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
9559
9560 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
9561 references.
9562
9563 1999-04-06 Jeffrey A Law (law@cygnus.com)
9564
9565 * Makefile.in (TREE_H): Add tree-check.h.
9566 (RTL_H): Add genrtl.h.
9567
9568 1999-04-06 Alexandre Petit-Bianco <apbianco@cygnus.com>
9569
9570 * parse.y (patch_assignment): Added ArrayStoreException runtime
9571 check.
9572
9573 1999-04-06 Per Bothner <bothner@cygnus.com>
9574
9575 * expr.c (pop_type_0): New function.
9576 (pop_type): Use pop_type_0.
9577 * java-tree.h (pop_type_0): New declaration.
9578 * verify.c (verify_jvm_instructions): Check return instructions.
9579
9580 * parse.y (patch_binop): Don't fold if non-constant and emiting
9581 class files.
9582
9583 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9584
9585 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
9586
9587 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
9588 (main_jcf): Don't define.
9589 (process_file): Don't set `main_jcf'.
9590
9591 * java-tree.h (main_jcf): Don't declare.
9592
9593 * jcf-parse.c (main_jcf): Add static definition.
9594
9595 * lang.c (main_jcf): Don't define.
9596
9597 1999-04-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9598
9599 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
9600
9601 * decl.c (copy_lang_decl): Likewise for `bcopy'.
9602
9603 * jcf-depend.c: Include "config.h", not <config.h>.
9604
9605 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
9606 `bcopy' to PTR.
9607
9608 * jcf-path.c: Include "config.h", not <config.h>.
9609
9610 * lex.c: Don't include various system header files.
9611 (java_init_lex): Cast the argument of `bzero' to PTR
9612
9613 * parse-scan.y (java_push_parser_context): Likewise.
9614
9615 * parse.y (java_push_parser_context): Likewise.
9616 (patch_bc_statement): Match format specifier to variable argument.
9617
9618 * xref.c: Don't include <stdio.h>.
9619
9620 1999-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
9621
9622 * parse.y (struct parser_ctxt *ctxp): Now global.
9623 (declare_local_variables): Use WFL compound value for the
9624 declaration source line value, when doing cross-referencing.
9625
9626 1999-03-31 Tom Tromey <tromey@cygnus.com>
9627
9628 * gjavah.c (print_field_info): Allow constants of other types.
9629 (print_include): Generate include when new name is proper prefix
9630 of already printed name.
9631 (add_namelet): Likewise.
9632 (cxx_keyword_subst): New function.
9633 (print_method_info): Use it.
9634 (print_field_name): New function.
9635 (get_field_name): New function.
9636 (print_field_info): Use get_field_name and print_field_name.
9637
9638 1999-03-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9639
9640 * Makefile.in (keyword.h): Generate using gperf language 'C', not
9641 'KR-C', so gperf uses the `const' keyword on strings.
9642
9643 * keyword.gperf (java_keyword): Const-ify a char*.
9644
9645 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
9646
9647 * parse.y (patch_bc_statement): Fixed identation and a bogus
9648 `printf' format.
9649
9650 1999-03-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
9651
9652 * parse.y (patch_assignment): Allow static variables in other
9653 classes to be assigned.
9654
9655 1999-03-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9656
9657 * class.c (maybe_add_interface): Remove unused variable
9658 `interface_binfo'.
9659 (make_class_data): Use = for assignment, not ==. Likewise.
9660 (emit_register_classes): Remove unused variable `decl'.
9661
9662 * lex.c: Fix comment so as not to contain an embedded `/*'.
9663
9664 * verify.c (verify_jvm_instructions): Remove unused variable
9665 `self_type'.
9666
9667 1999-03-27 Per Bothner <bothner@cygnus.com>
9668
9669 * parse.y (complete_loop_body): Rename to finish_loop_body.
9670 (complete_labeled_statement): Rename to finish_labeled_statement.
9671 (complete_for_loop): Rename to finish_for_loop.
9672 (complete_method_declaration): Rename to finish_method_declaration.
9673
9674 * java-tree.h (continue_identifier_node): New global node.
9675 * decl.c: Define and initialize continue_identifier_node.
9676 * parse.y (generate_labeled_block): Remove - no longer needed.
9677 (build_loop_body): Use continue_identifier_node for continue block.
9678 (finish_labeled_statement): Also do pop_labeled_block actions.
9679 (java_complete_lhs): POP_LOOP even if error.
9680 (build_labeled_block): Special handling for continue_identifier_node.
9681 (patch_loop_statement): Re-organize.
9682 (patch_bc_statement): Re-write.
9683
9684 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9685
9686 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
9687 using a WFL compound value.
9688 * parse.y (xref.h): Include.
9689 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
9690 WFL compound value.
9691 (register_fields): Set WFL compound value to lineno if doing
9692 xrefs.
9693 (java_complete_expand_method): Call expand_xref if flag_emit_xref
9694 is set.
9695 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
9696 * xref.h (expand_xref): Prototype renamed from xref_generate.
9697
9698 1999-03-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
9699
9700 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
9701 (GET_CURRENT_BLOCK): New macro.
9702 * parse.y (current_static_block): New global variable.
9703 (method_body:): Define action.
9704 (complete_method_declaration): Set current_function_decl to NULL
9705 when work on the current method is done.
9706 (declare_local_variables): Use GET_CURRENT_BLOCK.
9707 (java_method_add_stmt): Likewise.
9708 (java_complete_expand_method): Disable the use of `this' when
9709 expanding <clinit>.
9710 (enter_a_block): If no current method exist, use
9711 current_static_block to link static initializer blocks.
9712 (exit_block): Rewritten to use current_static_block when no current
9713 method decl exists.
9714 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
9715 (patch_return): Forbid the use of `return' in static initializers.
9716 (patch_throw_statement): Fixed indentation. Issue specific error
9717 for uncaught thrown checked exception in static initializer
9718 blocks. Removed FIXME.
9719
9720 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
9721
9722 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
9723 Link gcj from gcc.o.
9724
9725 1999-03-23 Alexandre Petit-Bianco <apbianco@cygnus.com>
9726
9727 * parse.y (find_applicable_accessible_methods_list): When dealing
9728 with interface: ensure that a given interface or java.lang.Object
9729 are searched only once.
9730
9731 1999-03-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9732
9733 * gjavah.c (print_c_decl): Remove unused argument `flags'.
9734
9735 * jcf-dump.c (print_access_flags): Add braces around if-else.
9736
9737 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
9738 COMBINE_INPUTS.
9739
9740 * lex.c (build_wfl_node): Add static prototype.
9741
9742 * lex.h (build_wfl_node): Remove static prototype.
9743
9744 * parse.y: Include lex.c early enough to declare everything needed.
9745 Ensure calls to `build_wfl_node' pass the proper arguments.
9746 (create_class): Remove unused variable `super_decl'.
9747 (get_printable_method_name): Initialize variable `name'.
9748
9749 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9750
9751 * Changelog: Fixed 1999-03-22 typos.
9752 * lang.c (lang_decode_option): Fixed typo in error string in the
9753 XARG section.
9754
9755 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
9756
9757 * Makefile.in (JAVA_OBJS): Added entry xref.o.
9758 (xref.o): New rule.
9759 * java-tree.h (flag_emit_xref): Declared extern.
9760 * lang.c (xref.h): Included.
9761 (flag_emit_xref): New global variable.
9762 (lang_decode_option): Added support for -fxref.
9763 * xref.c: Created.
9764 * xref.h: Likewise.
9765
9766 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
9767
9768 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
9769 linked with.
9770
9771 1999-03-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9772
9773 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
9774 $(srcdir)/../system.h and $(JAVA_TREE_H).
9775 (jcf-io.o): Depend on $(JAVA_TREE_H).
9776 (mangle.o): Likewise.
9777
9778 * check-init.c (check_cond_init): Add static prototype.
9779
9780 * class.c (build_java_method_type, hashUtf8String,
9781 make_field_value, get_dispatch_vector, get_dispatch_table,
9782 append_gpp_mangled_type, mangle_static_field): Likewise.
9783 (strLengthUtf8): Hide unused definition.
9784 (hashUtf8String): Const-ify.
9785 (make_field_value): Un-ANSI-fy.
9786
9787 * constants.c: Move inclusion of jcf.h above java-tree.h.
9788 (set_constant_entry, find_class_or_string_constant,
9789 find_name_and_type_constant, get_tag_node,
9790 build_constant_data_ref): Add static prototype.
9791
9792 * decl.c (push_jvm_slot, builtin_function,
9793 lookup_name_current_level): Likewise.
9794 (builtin_function): Const-ify.
9795
9796 * except.c (expand_start_java_handler, expand_end_java_handler):
9797 Add static prototype.
9798
9799 * expr.c (flush_quick_stack, push_value, pop_value,
9800 java_stack_swap, java_stack_dup, build_java_athrow,
9801 build_java_jsr, build_java_ret, expand_java_multianewarray,
9802 expand_java_arraystore, expand_java_arrayload,
9803 expand_java_array_length, build_java_monitor, expand_java_pushc,
9804 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
9805 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
9806 expand_compare, expand_test, expand_cond, expand_java_goto,
9807 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
9808 expand_java_field_op, java_push_constant_from_pool): Likewise.
9809
9810 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
9811 (build_java_arraynull_check): Mark parameters `node' and `type'
9812 with ATTRIBUTE_UNUSED.
9813 (note_label): Likewise for parameter `current_pc'.
9814 (expand_java_call, expand_java_ret): Hide unused definition.
9815
9816 * java-tree.h (make_class, build_constants_constructor,
9817 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
9818 init_outgoing_cpool, register_class, emit_register_classes,
9819 java_layout_seen_class_methods): Prototype.
9820 (unicode_mangling_length): Const-ify.
9821 (append_gpp_mangled_name, append_gpp_mangled_classtype,
9822 emit_unicode_mangled_name, format_int, format_uint,
9823 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
9824 jcf_print_utf8_replace, open_class): Prototype.
9825
9826 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
9827 <stdio.h>. Include tree.h/java-tree.h.
9828 (utf8_equal_string usage, process_class): Add static prototype.
9829 (open_class): Don't prototype this here.
9830 (utf8_equal_string): Match arguments to format specifiers.
9831 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
9832 TABLE_SWITCH, disassemble_method): Likewise.
9833
9834 * jcf-io.c: Include tree.h/java-tree.h.
9835 (open_class, find_classfile, jcf_print_utf8,
9836 jcf_print_utf8_replace): Const-ify.
9837
9838 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
9839 parse_class_file): Add static prototype.
9840 (find_in_current_zip): Match definition to existing static
9841 prototype.
9842
9843 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
9844 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
9845 finish_jcf_block, define_jcf_label, get_jcf_label_here,
9846 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
9847 write_chunks, adjust_typed_op, generate_bytecode_conditional,
9848 generate_bytecode_return, perform_relocations, init_jcf_state,
9849 init_jcf_method, release_jcf_state, generate_classfile):
9850 Add static prototype.
9851 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
9852 (make_class_file_name): Const-ify.
9853
9854 * jcf.h (find_classfile): Const-ify.
9855
9856 * jv-scan.c (reset_report): Remove prototype.
9857
9858 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
9859 (error): Rewrite to allow varargs.
9860
9861 * lang.c (lang_f_options): Const-ify.
9862
9863 * lex.c (java_parse_escape_sequence): Add static prototype.
9864 (java_allocate_new_line): Match definition to existing static
9865 prototype.
9866
9867 * mangle.c Include tree.h/java-tree.h.
9868 (unicode_mangling_length, emit_unicode_mangled_name,
9869 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
9870
9871 * parse.h (jdep_code): Remove trailing comma in enumeration.
9872 (java_get_line_col): Move prototype outside of !JC1_LITE test.
9873 (reset_report): Add prototype.
9874
9875 * verify.c (push_pending_label, merge_types): Add static
9876 prototypes.
9877
9878 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
9879
9880 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
9881
9882 * parse.y (find_applicable_accessible_methods_list): Extend the
9883 search to superinterfaces when relevant.
9884 (search_applicable_methods_list): New function.
9885
9886 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
9887
9888 * class.c (unmangle_classname): Implemented stricter testing
9889 before setting the QUALIFIED_P flag on an identifier.
9890
9891 1999-03-16 Per Bothner <bothner@cygnus.com>
9892
9893 * parse.y (java_complete_lhs): Call force_evaluation_order
9894 after patch_newarray.
9895 (patch_binop): Don't call fold if there are side effects.
9896
9897 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
9898
9899 * parse.y (java_stabilize_reference): Use save_expr instead of
9900 building a SAVE_EXPR node.
9901 (java_complete_lhs): Patch the resulting string of the `+='
9902 operator (if necessary) and complete the RHS after having built
9903 the cast.
9904
9905 1999-03-15 Per Bothner <bothner@cygnus.com>
9906
9907 * class.c (make_class): Don't set CLASS_P here (because
9908 this function is also called by build_java_array_type).
9909 (push_class): Set CLASS_P here instead.
9910 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
9911
9912 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
9913 context. If the context is class, perfer "super" over "synchronized".
9914 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
9915
9916 * parse.y (create_class): Don't call parser_check_super here;
9917 it is not robust. Always wait until later.
9918
9919 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
9920 match what JDK 1.2 does), but don't set ACC_PUBLIC.
9921
9922 1999-03-13 Per Bothner <bothner@cygnus.com>
9923
9924 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
9925 * lex.h (UNGETC): Change misleading macro.
9926
9927 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
9928
9929 * parse.y (java_stabilize_reference): Return NODE when patching a
9930 COMPOUND_EXPR.
9931 (java_complete_lhs): Put parenthesis around truth values.
9932
9933 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
9934
9935 * class.c (layout_class_method): Don't make rtl for interface
9936 methods.
9937 * parse.h (GET_TYPE_NAME): New macro.
9938 * parse.y (if_then_statement:): Fixed indentation.
9939 (if_then_else_statement:): Likewise.
9940 (for_statement:): Fixed spacing.
9941 (try_statement:): Fixed indentation.
9942 (create_interface): Don't force interfaces to be abstract.
9943 (method_header): Abstract methods are OK in interfaces.
9944 (declare_local_variables): Fixed typo in comment.
9945 (java_complete_expand_method): Fixed indentation.
9946 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
9947 non accessible fields.
9948 (java_stabilize_reference): New function.
9949 (java_complete_lhs): Fixed indentation. Use
9950 java_stabilize_reference in compound assignement. Insert the
9951 cast. If not processing `+' fix string constants before processing
9952 binop.
9953
9954 1999-03-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
9955
9956 * constants.c (find_class_or_string_constant): Cast variable `j'
9957 to a `jword' when comparing against one.
9958
9959 * expr.c (java_lang_expand_expr): Remove unused variables
9960 `has_finally_p' and `op0'.
9961
9962 * gjavah.c (print_field_info): Cast a value to jint when comparing
9963 against one. Likewise for a jlong.
9964 (add_namelet): Likewise cast a `sizeof' to an int when comparing
9965 against a signed quantity.
9966
9967 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
9968 (print_signature): Don't needlessly dereference variable `str'
9969
9970 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
9971 `max_locals' with ATTRIBUTE_UNUSED.
9972 (jcf_parse_class): Likewise for variable `index'.
9973
9974 * parse.h (reverse_jdep_list): Remove static prototype.
9975
9976 * parse.y (build_jump_to_finally): Remove prototype and definition.
9977 (reverse_jdep_list): Add static prototype.
9978
9979 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
9980 `assignment' and `expr_decl'.
9981
9982 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
9983
9984 1999-03-12 Andrew Haley <aph@cygnus.com>
9985
9986 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
9987 we'll need a directory separator and a null character.
9988
9989 1999-03-10 Per Bothner <bothner@cygnus.com>
9990
9991 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
9992
9993 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
9994
9995 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
9996 interfaces.
9997
9998 1999-03-05 Per Bothner <bothner@cygnus.com>
9999
10000 * lex.c (java_parse_end_comment): Take extra parameter (next char).
10001
10002 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
10003
10004 * class.c (layout_class_method): A static method in a base class
10005 is never overridden, so treat it like it doesn't exist.
10006 However, do complain about private non-static method overriding
10007 public static method.
10008
10009 * parse.y: Don't set unused INITIALIZED_P flag.
10010 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
10011
10012 * parse.y (find_expr_with_wfl): Optimize tail-calls.
10013 (build_array_from_name): Re-order &index[string] to &string[index].
10014
10015 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
10016 error_mark (it might catch more errors, but it is more likely to lose).
10017
10018 1999-03-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10019
10020 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
10021 (parse-scan.o): Depend on toplev.h.
10022
10023 * class.c (make_method_value): Add prototype. Make it static.
10024 Remove unused second argument, caller changed.
10025
10026 * expr.c (java_lang_expand_expr): Remove unused variable
10027 `return_label'.
10028
10029 * java-tree.h: Don't prototype find_in_current_zip.
10030 Add prototypes for verify_constant_pool, start_java_method,
10031 end_java_method, give_name_to_locals, expand_byte_code,
10032 open_in_zip, set_constant_value, find_constant1, find_constant2,
10033 find_utf8_constant, find_string_constant, find_class_constant,
10034 find_fieldref_index, find_methodref_index, write_constant_pool,
10035 count_constant_pool_bytes and encode_newarray_type.
10036
10037 * jcf-dump.c: Remove unused variable `LONG_temp'.
10038
10039 * jcf-parse.c: Include parse.h.
10040 (jcf_parse_source): Remove unused parameter, all callers changed.
10041 (jcf_figure_file_type): Add static prototype.
10042 (find_in_current_zip): Likewise. Also remove unused parameter,
10043 all callers changed.
10044 (read_class): Initialize variable `saved_pos'.
10045
10046 * jcf-reader.c (jcf_parse_preamble): Mark variables
10047 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
10048
10049 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
10050 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
10051 (java_parse_doc_section): Initialize variable `seen_star'.
10052 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
10053 (java_lex_error): Mark parameters `msg' and `forward' with
10054 ATTRIBUTE_UNUSED.
10055 (java_get_line_col): Mark parameters `filename' and `line' with
10056 ATTRIBUTE_UNUSED.
10057
10058 * parse-scan.y: Include toplev.h.
10059 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
10060
10061 * parse.h: use `struct JCF', not plain `JCF'.
10062 (java_parser_context_save_global, java_expand_classes
10063 java_parser_context_restore_global, java_parse): Add prototypes.
10064
10065 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
10066 `node'.
10067
10068 1999-02-24 Per Bothner <bothner@deneb.cygnus.com>
10069
10070 * check-init.c (check_init): COPYN takes word count, not bit count.
10071
10072 1999-02-26 Per Bothner <bothner@cygnus.com>
10073
10074 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
10075 explicit build_decl. (Avoids crash in reload when optimizing.)
10076
10077 1999-02-25 Per Bothner <bothner@cygnus.com>
10078
10079 * decl.c (complete_start_java_method): Handle synchronized method
10080 even when compiling from bytecode.
10081
10082 1999-02-26 Tom Tromey <tromey@cygnus.com>
10083
10084 * gjavah.c (add_class_decl): Only generate `#include' if outer
10085 class is not the name of the class we are processing. Correctly
10086 append `.h' in #include.
10087 (process_file): Clean up newlines around generated `#include's.
10088 (decode_signature_piece): Correctly handle inner classes.
10089 (struct include): New structure.
10090 (all_includes): New global.
10091 (print_include): New function.
10092 (add_class_decl): Use it.
10093 (process_file): Likewise.
10094 (add_class_decl): Generate include for java-array.h if array
10095 seen.
10096 (process_file): Don't generate java-array.h include.
10097
10098 * gjavah.c (add_namelet): Check for standard package names here.
10099 (add_class_decl): Don't check for standard package names here.
10100
10101 1999-02-25 Tom Tromey <tromey@cygnus.com>
10102
10103 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
10104 When reading a zip file, only use strncmp if both strings are
10105 bigger than the buffer length. Initialize `k' when looping
10106 through zip file.
10107
10108 1999-02-24 Tom Tromey <tromey@cygnus.com>
10109
10110 * gjavah.c (struct namelet): New structure.
10111 (add_namelet): New function.
10112 (print_namelet): New function.
10113 (print_class_decls): Use add_namelet and print_namelet to generate
10114 namespaces and not classes.
10115 (method_printed): New global.
10116 (HANDLE_END_METHOD): Examine method_printed.
10117 (print_method_info): Set method_printed when required. Print
10118 error if function to be ignored is marked virtual. Handle $finit$
10119 method.
10120 (METHOD_IS_FINAL): New macro.
10121 (print_field_info): Use it.
10122 (HANDLE_METHOD): Clear method_printed.
10123 (method_pass): New global.
10124 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
10125 (process_file): Do two passes over both fields and methods.
10126 (HANDLE_METHOD): Examine method_pass.
10127 (root): New global.
10128 (add_class_decl): New function.
10129 (print_class_decls): Don't scan over entire constant pool.
10130
10131 1999-02-23 Tom Tromey <tromey@cygnus.com>
10132
10133 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
10134 disable linking in that case.
10135
10136 1999-02-20 Tom Tromey <tromey@cygnus.com>
10137
10138 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
10139 not 0x1f.
10140
10141 1999-02-21 Per Bothner <bothner@cygnus.com>
10142
10143 * decl.c (build_result_decl), java-tree.h: New method.
10144 (complete_start_java_method): Handle synchronized methods.
10145 Don't build DECL_RESULT here. (Ordering dependency problem.)
10146 (start_java_method): Call build_result_decl here instead ...
10147 * parse.y (java_complete_expand_method): ... and here.
10148 (expand_start_java_method): Don't call complete_start_java_method here.
10149 (java_complete_expand_method): Call it here instead.
10150 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
10151 * java-tree.h: ... here.
10152
10153 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
10154 * parse.y (java_complete_lhs): Don't call force_evaluation_order
10155 for ARRAY_REF - it doesn't work when array bounds are checked.
10156 (patch_array_ref): Handle it here instead.
10157
10158 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
10159
10160 1999-02-19 Per Bothner <bothner@cygnus.com>
10161
10162 Force left-to-right evaluation of binary operations etc.
10163 * expr.c (force_evaluation_order), java-tree.h: New function.
10164 * parse.y (java_complete_lhs): Pass binary operations, procedure
10165 calls, and ARRAY_REFs to force_evaluation_order.
10166 (various): Set TREE_SIDE_EFFECTS more carefully.
10167
10168 Tolerate random (non-UTF8) encoding in comments without complaining.
10169 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
10170 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
10171
10172 * parse.y (resolve_qualified_expression_name): Handle error_mark.
10173 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
10174
10175 * parse.y (java_complete_lhs): Ignore an empty statement in a
10176 COMPOUND_EXPR. Don't complain about empty statement after return.
10177
10178 1999-02-19 Per Bothner <bothner@cygnus.com>
10179
10180 * parse.y (obtain_incomplete_type): Don't wrap unknown types
10181 in TREE_LIST - just chain the POINTER_TYPEs together.
10182 (resolve_class): If type already resolved, return decl.
10183 After resolving, update TREE_TYPE(class_type), and name (if array).
10184 * parse.h (do_resolve_class), parse.y: Make non-static.
10185 * class.c (maybe_layout_super_class): Take this_class argument.
10186 Do do_resolve_class if necessary.
10187 (layout_class, layout_class_methods): Adjust calls appropriately.
10188 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
10189 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
10190 * typeck.c (build_java_array_type): Don't call layout_class.
10191
10192 1999-02-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10193
10194 * parse.y (check_pkg_class_access): Allow private class access
10195 within the same package.
10196 (strip_out_static_field_access_decl): New function.
10197 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
10198 operator argument before testing its nature.
10199
10200 1999-02-03 Per Bothner <bothner@cygnus.com>
10201
10202 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
10203 (TRY_EXPR): Simplify - it no longer has a finally clause.
10204 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
10205 Simpler handling of TRY_EXPR, which no longer has a finally clause.
10206 * expr.c (java_lang_expand_expr): Likewise.
10207 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
10208 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
10209 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
10210 (build_try_statement): Remove finally parameter and handling.
10211 (build_try_finally_statement): New function.
10212 (patch_try_statement): No longer need to support finally clause.
10213 (try_statement): Update grammar action rules.
10214 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
10215 Simpler handling of TRY_EXPR, which no longer has a finally clause.
10216
10217 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
10218
10219 * jcf-parse.c (get_constant): Add braces around computation of 'd'
10220 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
10221
10222 1999-02-17 Andrew Haley <aph@cygnus.com>
10223
10224 * class.c (build_utf8_ref): Back out broken patch which was
10225 intended to to output signatures using '.' as a separator.
10226
10227 * class.c (make_class_data): Output signatures using '.' as a
10228 separator, rather than '/'.
10229 (mangled_classname): Likewise.
10230 (make_field_value): Likewise.
10231 (make_method_value): Likewise.
10232 * constants.c (alloc_class_constant): Likewise.
10233 * expr.c (build_invokeinterface): Likewise.
10234
10235 1999-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
10236
10237 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
10238 of an ancient workaround.
10239
10240 1999-02-10 Jeffrey A Law (law@cygnus.com)
10241
10242 * jvspec.c (xmalloc): Kill the prototype. It does not belong
10243 here anymore.
10244
10245 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10246
10247 * lex.c (yylex): Encode \0 as UTF8.
10248
10249 1999-02-10 Tom Tromey <tromey@cygnus.com>
10250
10251 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
10252 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
10253 (libgcj_zip): Renamed.
10254 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
10255 LIBJAVA_ZIP_FILE.
10256 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
10257
10258 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
10259 (GC_NAME): Renamed -lgc to -lgcjgc.
10260
10261 1999-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10262
10263 * lex.c (java_lang_cloneable): Initialize.
10264 * parse.y (java_lang_cloneable): New static variable.
10265 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
10266 doing one more qualification round.
10267 (valid_ref_assignconv_cast_p): Reject null source or
10268 destination. Allow an array to be cast into java.lang.Cloneable.
10269 (patch_cast): Swapped two first arguments to first call to
10270 valid_ref_assignconv_cast_p.
10271
10272 1999-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
10273
10274 * parse.h: DECL_P renamed JDECL_P.
10275 * parse.y: DECL_P replaced by JDECL_P.
10276 (build_array_from_name): Always use pointer's type.
10277 (patch_bc_statement): Extra code to search continue target in a
10278 for loop. Fixed comments. Continue target is current loop when
10279 unlabeled.
10280
10281 1999-02-05 Andrew Haley <aph@cygnus.com>
10282
10283 * class.c (make_class_data): The superclass of an interface should
10284 be null, not class Object.
10285
10286 * lex.c (java_lex): Sign extend hex literals.
10287
10288 1999-02-04 Andrew Haley <aph@cygnus.com>
10289
10290 * class.c (build_utf8_ref): Output signatures using '.' as a
10291 separator, rather than '/'.
10292 (make_class_data): Likewise.
10293
10294 1999-02-03 Marc Espie <Marc.Espie@liafa.jussieu.fr>
10295
10296 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
10297 mkstemp.o. Get them from libiberty now.
10298
10299 1999-02-02 Jeffrey A Law (law@cygnus.com)
10300
10301 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
10302
10303 1999-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10304
10305 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
10306 from libiberty.h
10307
10308 1999-02-02 Per Bothner <bothner@cygnus.com>
10309
10310 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
10311 * jcf-write.c (generate_bytecode_return): New function.
10312 (generate_bytecode_insns): Use it, for RETURN_EXPR.
10313
10314 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
10315 generate special [fd]const_[01] instructions.
10316
10317 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
10318
10319 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
10320 handling OPCODE_lookupswitch or OPCODE_tableswitch.
10321
10322 1999-02-01 Per Bothner <bothner@cygnus.com>
10323
10324 * parse.y (patch_method_invocation): Handle calling static methods,
10325 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
10326
10327 * parse.y (java_complete_lhs): Don't complain about unreachable
10328 exit condition in a do-while statement.
10329
10330 1999-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
10331
10332 * lex.c (java_read_char): Fixed utf8 decoding.
10333 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
10334 range.
10335 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
10336 comments. Local variable `all_primitive' is gone. Broadened
10337 acceptance of `0' to floating point targets. `long' can now be
10338 widened to `double' or `float'.
10339 (valid_method_invocation_conversion_p): Added leading
10340 comment. Fixed tabulation.
10341 (build_string_concatenation): Optimize out left or right empty
10342 string constants.
10343
10344 1999-01-28 Per Bothner <bothner@cygnus.com>
10345
10346 * jcf-write.c (localvar_alloc): Only emit entry for
10347 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
10348 (generate_bytecode_insns): Only call put_linenumber if
10349 debug_info_level > DINFO_LEVEL_NONE.
10350 * jvspec.c (lang_specific_driver): If no -O* or -g* option
10351 is specified, add -g1 (for compatibility wih javac).
10352
10353 1999-01-28 Hans-Peter Nilsson <hp@axis.se>
10354
10355 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
10356 gjavah.o, check-init.o, jv-scan.o
10357
10358 1999-02-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10359
10360 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
10361
10362 * gjavah.c: Include config.h and system.h.
10363
10364 * javaop.h (inline): Don't define, its handled by system.h.
10365 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
10366 from `inline' to `static inline'.
10367
10368 * jcf.h (inline): Don't define, its handled by system.h.
10369
10370 * lex.c (inline): Likewise.
10371
10372 1999-01-31 Zack Weinberg <zack@rabi.columbia.edu>
10373
10374 * lang-specs.h: Map -Qn to -fno-ident.
10375
10376 1999-01-29 Richard Henderson <rth@cygnus.com>
10377
10378 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
10379
10380 1999-01-29 Tom Tromey <tromey@cygnus.com>
10381
10382 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
10383 then cast it to Object before calling `append' method.
10384
10385 1999-01-28 Per Bothner <bothner@cygnus.com>
10386
10387 * check-init.c (check_bool2_init, check_bool_init, check_init):
10388 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
10389 * jcf-write.c (generate_bytecode_insns): Likewise.
10390
10391 1999-01-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
10392
10393 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
10394 * parse.y (patch_cast): Allow a boolean to be cast into a
10395 boolean.
10396
10397 1999-01-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
10398
10399 * parse.y: (class_declaration:): Fixed indentation.
10400 (class_member_declaration:): Extra `;' after field declaration now
10401 accepted.
10402 (interface_declaration:): Removed debug messages in error reports.
10403 (patch_binop): Nodes created and returned inherit the orignal
10404 node's COMPOUND_ASSIGN_P flag value.
10405 (patch_cast): Fix cast from char to floating point.
10406
10407 1999-01-25 Andrew Haley <aph@cygnus.com>
10408
10409 * except.c, java-except.h (expand_resume_after_catch): new
10410 function.
10411 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
10412 to branch back to main flow of control after a catch block.
10413
10414 1999-01-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10415
10416 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
10417 $(srcdir)/../system.h.
10418 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
10419 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
10420 (jcf-write.o): Likewise.
10421 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
10422 (mangle.o): Depend on $(srcdir)/../toplev.h.
10423 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
10424 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
10425
10426 * class.c: Include output.h and parse.h.
10427 (mangled_classname): Add the `const' keyword to a char*.
10428 (find_named_method): Hide unused function definition.
10429 (build_utf8_ref): Change type of variable `c' to unsigned char.
10430 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
10431 (build_class_ref): Add the `const' keyword to a char*.
10432 (layout_class_method): Remove unused variable `buf'.
10433
10434 * decl.c (find_local_variable): Remove unused variable `rtl'.
10435 (pushdecl): Likewise for variables `different_binding_level' and
10436 `oldglobal'.
10437 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
10438 (maybe_build_cleanup): Likewise for parameter `decl'.
10439
10440 * except.c (expand_start_java_handler): Mark parameter `range'
10441 with ATTRIBUTE_UNUSED.
10442
10443 * expr.c: Include except.h.
10444 (pop_type): Remove unused variable `i'.
10445 (pop_value): Likewise for variables `n_words' and `i'.
10446 (expand_java_arrayload): Likewise for variable `convert'.
10447 (java_lang_expand_expr): Likewise for variables `op0', `type',
10448 `mode', `unsignedp', `node' and `elements'.
10449 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
10450 `eh_ranges'.
10451 (process_jvm_instruction): Add a `const' qualifier to a char*.
10452
10453 * gjavah.c (output_directory): Add the `const' keyword to a char*.
10454 (temp_directory): Likewise.
10455 (print_c_decl): Likewise.
10456 (print_method_info): Likewise.
10457 (decode_signature_piece): Likewise.
10458 (print_mangled_classname): Likewise.
10459
10460 * java-except.h: Provide prototypes for maybe_start_try,
10461 maybe_end_try and add_handler.
10462
10463 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
10464 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
10465 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
10466 init_expr_processing, push_super_field, init_class_processing,
10467 can_widen_reference_to, class_depth, verify_jvm_instructions,
10468 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
10469 set_local_type, merge_type_state, push_type, load_type_state,
10470 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
10471 emit_unicode_mangled_name): Add prototypes.
10472
10473 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
10474 (print_signature_type): Use ISDIGIT, not isdigit.
10475 (print_signature): Remove unused variable `j'.
10476
10477 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
10478 int when comparing against one.
10479
10480 * jcf-parse.c: Include toplev.h.
10481
10482 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
10483 (localvar_free): Remove unused variable `i'.
10484 (generate_bytecode_conditional): Likewise for variable `kind'.
10485
10486 * jv-scan.c: Include config.h and system.h. Remove redundant
10487 OS header and gansidecl.h includes.
10488 (warning): Add the `const' keyword to a char*. Also add
10489 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
10490 __STDC__, when determining whether to use ANSI-isms.
10491 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
10492 (xmalloc): Don't redundantly prototype here.
10493 (main): Remove unused parameter `envp'. Also fix the arguments
10494 passed to function `fatal' to match the format specifier.
10495
10496 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
10497
10498 * mangle.c: Include toplev.h.
10499 (emit_unicode_mangled_name): Declare parameter `len'.
10500
10501 * parse.y (parse_warning_context): Add the `const' keyword to a
10502 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
10503 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
10504 (issue_warning_error_from_context): Add the `const' keyword to
10505 a char*.
10506 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
10507 not `__STDC__' for whether to use ANSI-isms.
10508
10509 * typeck.c (incomplete_type_error): Mark parameters `value' and
10510 `type' with ATTRIBUTE_UNUSED.
10511 (parse_signature_type): Use ISDIGIT, not isdigit.
10512
10513 * verify.c (check_pending_block): Add the `const' keyword to a char*.
10514 (verify_jvm_instructions): Likewise. Remove unused variables
10515 `field_name' and `default_val'.
10516
10517 * zextract.c: Include config.h and system.h. Remove redundant
10518 OS header includes.
10519
10520 * zipfile.h: Prototype `read_zip_archive'.
10521
10522 1999-01-21 Andrew Haley <aph@cygnus.com>
10523
10524 * typeck.c (convert): Allow conversions to void type: some
10525 optimizations in gcc do this.
10526
10527 1999-01-21 Andrew Haley <aph@cygnus.com>
10528
10529 * typeck.c (convert_ieee_real_to_integer): New function.
10530 (convert): When not using fast-math and using hardware fp, convert
10531 an IEEE NaN to zero.
10532
10533 1999-01-18 Andrew Haley <aph@cygnus.com>
10534
10535 * parse.y (patch_binop): Do a type conversion from signed to
10536 unsigned and then back to signed when a ">>>" is found.
10537
10538 1999-01-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
10539
10540 * java-tree.h: (check_for_initialization): Added prototype.
10541 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
10542 * parse.y (do_resolve_class): Removed unused locals.
10543 (read_import_dir): Likewise.
10544 (resolve_qualified_expression_name): Array creation
10545 expressions are valid primary expressions.
10546 (qualify_ambiguous_name): Likewise.
10547 (patch_synchronized_statement): Removed unused local.
10548
10549 1999-01-17 Jeffrey A Law (law@cygnus.com)
10550
10551 * Makefile.in (zextract.o): Add dependencies.
10552
10553 * Makefile.in: Do not put ^Ls at the start of a line.
10554
10555 1999-01-15 Per Bothner <bothner@cygnus.com>
10556
10557 * expr.c (process_jvm_instruction): Coerce to correct Throwable
10558 sub-type the result of the call that gets the exception value.
10559
10560 * parse.y (java_complete_expand_methods): If flags_syntax_only,
10561 don't call finish_class.
10562
10563 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
10564 clear found before continuing.
10565
10566 * verify.c (verify_jvm_instructions): On an array load, allow
10567 and handle top of stack to be TYPE_NULL.
10568
10569 * gjavah.c (generate_access): Translate Java package private or
10570 protected access to C++ public, but with a comment.
10571
10572 1999-01-13 Andrew Haley <aph@cygnus.com>
10573
10574 * expr.c (generate_name): Name prefix changed to avoid clashes
10575 with assembler temp labels.
10576
10577 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
10578 MODIFY_EXPR. Without this, code for the assignement may not be
10579 generated at all and the synchronized statement will read an
10580 uninitialized variable.
10581
10582 1999-01-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
10583
10584 * class.c (maybe_layout_super_class): Fixed returned value.
10585 * lex.c: Added 1999 to the copyright.
10586 (java_init_lex): Initialize java_lang_imported.
10587 * lex.h: Added 1999 to the copyright.
10588 * parse.h: Added 1999 to the copyright.
10589 (REGISTER_IMPORT): Fixed typo in trailing macro.
10590 (CURRENT_OSB): New macro.
10591 (struct parser_ctxt): New fields osb_depth, osb_limit.
10592 * parse.y (java_lang_id): New global variable.
10593 (type_import_on_demand_declaration): Don't import java.lang.* twice.
10594 (array_creation_expression:): Use CURRENT_OSB.
10595 (dims:): Uses a stack to keep track of array dimensions.
10596 (cast_expression:): Use CURRENT_OSB.
10597 (find_expr_with_wfl): Return NULL if node found doesn't meet the
10598 conditions.
10599 (register_fields): Fixed typos in comment.
10600 (check_method_redefinition): Fixed comment indentation.
10601 (java_check_regular_methods): Set saved found wfl to NULL after
10602 having reinstalled it in the previously found DECL_NAME.
10603
10604 1999-01-10 Richard Henderson <rth@cygnus.com>
10605
10606 * gjavah.c (java_float_finite): Use a union to do type punning.
10607 (java_double_finite): Likewise.
10608
10609 1999-01-09 Per Bothner <bothner@cygnus.com>
10610
10611 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
10612 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
10613 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
10614 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
10615 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
10616 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
10617
10618 1999-01-08 Per Bothner <bothner@cygnus.com>
10619
10620 * check-init.c (check_init): If compiling to native, we don't
10621 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
10622
10623 1999-01-08 Tom Tromey <tromey@cygnus.com>
10624
10625 * parse-scan.y (variable_declarator_id): Set or increment
10626 bracket_count.
10627 (bracket_count): New global.
10628 (formal_parameter): Handle case where bracket pairs trail variable
10629 declarator id.
10630
10631 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
10632
10633 * jcf-parse.c (yyparse): variable len changed from a char to an
10634 int to prevent overflow.
10635
10636 1999-01-06 Per Bothner <bothner@cygnus.com>
10637
10638 * java-tree.h: Declare read_class.
10639 * jcf-parse.c (read_class): New function.
10640 (load_class): Now just call read_class.
10641
10642 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
10643 * jcf-parse.c (parse_source_file): Declare save_error_count,
10644 which is needed by java_parse_abort_on_error macro,
10645 * parse.y (java_layout_classes, java_expand_classes): Likewise.
10646
10647 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
10648 constructor, if initializing a static field.
10649 (patch_new_array_init): Set TREE_CONSTANT if it is.
10650 * expr.c (java_lang_expand_expr): For a static array constructor
10651 of primitive elements, allocate the array itself statically.
10652 Disabled until we can set the vtable field statically.
10653
10654 * check-init.c: New file. Checks for definite assignment.
10655 * Makefile.in (JAVA_OBJS): Add check-init.o.
10656 * parse.y (java_complete_expand_method): Call check_for_initialization.
10657 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
10658
10659 1999-01-06 Graham <grahams@rcp.co.uk>
10660
10661 * parse.y : include system.h instead of including
10662 standard headers directly with the exception of <dirent.h>.
10663
10664 1999-01-06 Per Bothner <bothner@cygnus.com>
10665
10666 * lex.h: Moved static function declarations to lex.c,
10667 to shut up some -Wall warnings.
10668 * lex.c: Static function declarations moved here.
10669 * jcf-dump.c: Small fixes to shut up -Wall warnings.
10670
10671 1999-01-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
10672
10673 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
10674
10675 1998-12-22 Per Bothner <bothner@cygnus.com>
10676
10677 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
10678 * verify.c (verify_jvm_instructions): Fix off-by-one error.
10679
10680 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
10681 (localvar_alloc): Change return type to void,
10682 (emit_unop): Remove unused variable size.
10683
10684 * jcf-write.c (struct jcf_block): Add new union.
10685 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
10686 (call_cleanups): New functions.
10687 (struct jcf_partial): New fields num_finalizers and return_value_decl.
10688 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
10689 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
10690 * lang.c (lang_init): Call using_eh_for_cleanups.
10691 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
10692 completing operands to patch_synchronized_statement.
10693 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
10694 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
10695 WITH_CLEANUP_EXPR instead of TRY_EXPR.
10696
10697 1998-12-20 John F. Carr <jfc@mit.edu>
10698
10699 * Make-lang.in: Comment out control-Ls; they upset some makes.
10700
10701 1998-12-18 Tom Tromey <tromey@cygnus.com>
10702
10703 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
10704 consistently.
10705
10706 1998-12-17 Tom Tromey <tromey@cygnus.com>
10707
10708 * parse.y (DIR_SEPARATOR): New define.
10709 (check_class_interface_creation): Use it.
10710
10711 * parse-scan.y (report_main_declaration): Recognize
10712 `java.lang.String' in argument to main.
10713
10714 1998-12-16 Per Bothner <bothner@cygnus.com>
10715
10716 * parse.y (create_interface): Remove bogus test.
10717
10718 1998-12-16 Per Bothner <bothner@cygnus.com>
10719
10720 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
10721 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
10722
10723 1998-12-16 Tom Tromey <tromey@cygnus.com>
10724
10725 * parse-scan.y (qualified_name): Use correct sprintf format.
10726
10727 1998-12-15 Tom Tromey <tromey@cygnus.com>
10728
10729 * gjavah.c (print_field_info): Changed how most negative number is
10730 printed.
10731
10732 1998-12-14 Per Bothner <bothner@cygnus.com>
10733
10734 * parse.y (fold_constant_for_init): New function.
10735 (resolve_expression_name): Don't replace static final
10736 constant-initialized fields by its value.
10737 (java_complete_lhs): New. Same as java_complete_tree, except does
10738 not replace static final constant-initialized fields by their values.
10739 (register_fields): If there is an initializer, set DECL_INITIAL and
10740 MODIFY_EXPR_FROM_INITIALIZATION_P.
10741 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
10742 Only call patch_initialized_static_field if
10743 MODIFY_EXPR_FROM_INITIALIZATION_P.
10744 (patch_initialized_static_field): If not valid constant, clear
10745 DECL_INITIAL.
10746
10747 * parse.y (lookup_field_wrapper): Fix thinko.
10748
10749 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
10750 set and restore global lineno.
10751
10752 1998-12-14 Tom Tromey <tromey@cygnus.com>
10753
10754 * gjavah.c (print_field_info): If value to print is the smallest
10755 value of its size, then print as hex to avoid later warnings from
10756 C++ compiler.
10757
10758 1998-12-14 Tom Tromey <tromey@cygnus.com>
10759
10760 * gjavah.c (decompile_method): Decompile `return null'.
10761 (process_file): Generate `#pragma interface'.
10762 (method_declared): New global.
10763 (print_method_info): Set it.
10764 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
10765 (print_method_info): Handle abstract methods.
10766
10767 1998-12-13 Per Bothner <bothner@cygnus.com>
10768
10769 * parse.y (patch_method_invocation): If class_decl is null
10770 (e.g. an array type), use original type.
10771
10772 * parse.y (check_thrown_exceptions): Temporary hack to suppress
10773 errors about uncaught exception from clone (of array, specifically).
10774
10775 1998-12-13 Tom Tromey <tromey@cygnus.com>
10776
10777 * gjavah.c (decompile_method): Handle all types of `return'
10778 opcode. Decompile `return this' and `return'.
10779 (method_access): New global.
10780 (print_method_info): Set it.
10781 (decompile_method): Don't decompile a synchronized method.
10782
10783 1998-12-13 Tom Tromey <tromey@cygnus.com>
10784
10785 * jcf-reader.c (jcf_parse_one_method): Recognize
10786 HANDLE_END_METHOD.
10787 * gjavah.c (HANDLE_END_METHOD): New macro.
10788 (HANDLE_CODE_ATTRIBUTE): New macro.
10789 (decompile_method): New function.
10790 (print_method_info): Don't print `;\n' at end of function decl.
10791 Include java-opcodes.h.
10792 (decompiled): New global.
10793
10794 1998-12-12 Per Bothner <bothner@cygnus.com>
10795
10796 * class.c (build_class_ref): Handle PRIMTYPE.class if
10797 flag_emit_class_files.
10798 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
10799 if flag_emit_class_files.
10800 * parse.y (java_complete_tree): Pre-liminary support for
10801 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
10802
10803 * parse.y (patch_synchronized_statement): Don't call monitorexit
10804 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
10805
10806 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
10807
10808 * zipfile.h (opendir_in_zip): New declaration.
10809 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
10810 (opendir_in_zip): New function, using code from open_in_zip.
10811 (open_in_zip): Call opendir_in_zip.
10812 (find_class): Remove no-longer-used do_class_file parameter,
10813 but add source_ok parameter. Change logic so if we find a .java file,
10814 we don't look for .class in later classpath emtries.
10815 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
10816 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
10817 * gjavah.c: Update call to find_class.
10818 * jcf-dump.c: Likewise.
10819
10820 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
10821 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
10822 nothing if body is empty_stmt_node.
10823 Various little fixes so SP gets correctly adjusted.
10824 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
10825 For CALL_EXPR, test if static first.
10826 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
10827 such as the ones we create for Object and Class.
10828 Set and restore current_function_decl.
10829 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
10830 (note_possible_classname): New function.
10831 (read_import_entry): Removed. Merged with read_import_dir.
10832 (read_import_dir): Don't call find_class - that only gives us
10833 the first classpath entry having the needed package.
10834 Use the struct buffer data structure from buffer.h.
10835 (read_import_dir, find_in_imports_on_demand): The remembered
10836 class names now use '.' (not '/') as package separator.
10837
10838 * parse.y (java_complete_expand_methods): Call write_classfile
10839 here, and not in java_expand_classes (which only gets first class).
10840
10841 1998-12-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
10842
10843 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
10844 (register_fields): If a static fields has an initializer, just
10845 chain it on ctxp->static_initialized, and handle later.
10846 (java_complete_expand_methods): Force <clinit> first.
10847 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
10848 - it's already been completed.
10849 (patch_initialized_static_field): New function.
10850 (java_complete_field): Call it.
10851
10852 1998-12-12 Per Bothner <bothner@cygnus.com>
10853
10854 * expr.c (encode_newarray_type, build_new_array): New functions.
10855 * java-tree.h: Declare build_new_array.
10856 * jcf-write.c (patch_newarray): Use build_new_array.
10857
10858 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
10859 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
10860
10861 * parse.y (patch_new_array_init): Re-organize.
10862 Now is passed the actual array (pointer) type of the value.
10863 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
10864 (patch_array_constructor): Removed - merged into patch_new_array_init.
10865 (java_complete_tree): Update patch_new_array_init.
10866
10867 * jcf-write.c (find_constant_index): New function.
10868 (generate_bytecode_insns): Use find_constant_index.
10869 (generate_classfile): Use find_constant_index for ConstantValue.
10870
10871 1998-12-11 Tom Tromey <tromey@cygnus.com>
10872
10873 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
10874 * decl.c (init_decl_processing): Renamed dtable -> vtable.
10875 * class.c (make_class_data): Renamed dtable -> vtable, and
10876 dtable_method_count -> vtable_method_count.
10877
10878 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10879
10880 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
10881 global variables, initialized.
10882 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
10883 Declared new global variables.
10884 * lex.c (java_lex): Return long_zero_node, float_zero_node,
10885 double_zero_node, integer_zero_node upon direct matching.
10886 * parse.y (purify_type_name): Added function prototype.
10887 (duplicate_declaration_error_p): Consider new_type as potentially
10888 being a incomplete type. Use purify_type_name on type string.
10889 (method_header): saved_type: unused variable removed. Don't figure
10890 return type if method name is invalid.
10891 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
10892 processed by patch_unaryop.
10893 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
10894 increment/decrement node into its original type after binary
10895 numeric promotion on its operands.
10896
10897 1998-12-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
10898
10899 * parse.y (array_initializer:): Array init operand is NULL_TREE
10900 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
10901 now an error. Fixed indentation problems.
10902 (patch_string): Handle error_mark_node as an argument.
10903 (patch_new_array_init): Fixed indentation problems.
10904 (array_constructor_check_entry): Removed check on null wfl_value.
10905 Return an error if wfl_value's walk returns an error.
10906
10907 1998-12-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
10908
10909 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
10910 * lex.c (java_lex): Remember column position before advancing one
10911 token. Retain location information on OCB_TK.
10912 * lex.h (typedef struct java_lc): Added new field.
10913 * parse.h (GET_SKIP_TYPE): New macro.
10914 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
10915 * parse.y (build_new_array_init, patch_new_array_init,
10916 patch_array_constructor, maybe_build_array_element_wfl,
10917 array_constructor_check_entry): New function prototypes.
10918 (switch_block:): Tagged <node>.
10919 (OCB_TK): Tagged <operator>.
10920 (array_initializer:): Installed actions.
10921 (variable_initializer): Build location information on element if
10922 necessary.
10923 (switch_statement:): Fixed indentation typo.
10924 (switch_block:): Redefined default action.
10925 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
10926 (patch_assignment): Removed duplicate code.
10927 (maybe_build_array_element_wfl, build_new_array_init,
10928 patch_new_array_init, patch_array_constructor,
10929 array_constructor_check_entry): New functions.
10930
10931 1998-12-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
10932
10933 * parse.y (array_initializer): Tagged <node>.
10934 (variable_initializer:): Use default rule.
10935 (array_initializer:): Defined actions.
10936 (variable_initializers:): Likewise.
10937 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
10938 non-static field accesses.
10939 (patch_invoke): Fixed indentation typo.
10940 (java_complete_tree): Likewise.
10941 (build_labeled_block): Changed leading comment. Generate an error
10942 in case of duplicate loop labels.
10943 (patch_conditional_expr): Patch results of string concatenation
10944 operations.
10945
10946 1998-12-06 Per Bothner <bothner@cygnus.com>
10947
10948 * constants.c (find_methodref_index): When the class is an interface,
10949 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
10950
10951 * decl.c (finit_identifier_node): Use "$finit$", rather than
10952 "<finit>" (which Sun's verifier rejects).
10953 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
10954 (generate_field_initialization_code): Removed.
10955 (fix_constructors) Don't add call to $finit$ here (wrong order).
10956 (patch_method_invocation): Add $finit$ call here.
10957
10958 * java-tree.h (CALL_USING_SUPER): New macro.
10959 * parse.y (patch_invoke): Remove im local variable.
10960 (patch_method_invocation, patch_invoke): Don't pass super parameter.
10961 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
10962 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
10963
10964 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
10965
10966 * parse.y (java_complete_tree): Don't complain about unreachable
10967 statement if it is empty_stmt_node.
10968
10969 * jcf-write.c (find_constant_wide): New function.
10970 (push_long_const): Use find_constant_wide.
10971
10972 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
10973 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
10974 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
10975 Emit invokeinterface when calling an interface method.
10976 Emit invokespecial also when calling super or private methods.
10977
10978 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
10979
10980 1998-12-06 Per Bothner <bothner@cygnus.com>
10981
10982 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
10983
10984 1998-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
10985
10986 * java-tree.h (java_layout_seen_class_methods): New function
10987 prototype.
10988 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
10989 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
10990 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
10991 * parse.y (method_declarator:): Defined action.
10992 (issue_warning_error_from_context): input_filename saved, set to
10993 the appropriate value and restored after java_error is called.
10994 (build_unresolved_array_type): Fixed comment.
10995 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
10996 (method_header): Deal with return type the same way type are
10997 handled for fields and method's parameters and local variables
10998 types are handled.
10999 (check_method_redefinition): Removed extra CR.
11000 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
11001 (java_layout_seen_class_methods): New function.
11002 (java_layout_classes): Call java_layout_seen_class_methods.
11003
11004 1998-12-03 Per Bothner <bothner@cygnus.com>
11005
11006 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
11007
11008 1998-12-03 Per Bothner <bothner@cygnus.com>
11009
11010 * jcf-dump.c (main): Fix error message.
11011 * jcf-path.c (add_entry): Style fix.
11012
11013 1998-12-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
11014
11015 * class.c (layout_class_method): Call build_java_argument_signature
11016 on constructors too.
11017 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
11018 (patch_method_invocation): Define a primary when resolving an
11019 expression name. Augmented comment on code checking illegal `this'
11020 usage. Loosened it test by accepting NEW_CLASS_EXPR.
11021
11022 1998-12-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
11023
11024 * class.c (layout_class_method): Don't report error on non-static
11025 overriding static if the method is private.
11026 * java-tree.h (finish_class): Prototype added.
11027 * lex.c (java_get_line_col): Handle col argument -2 value.
11028 * parse.h: All static method declarations moved to parse.y.
11029 * parse.y: Now contains all static method declarations previously
11030 found in parse.h.
11031 (find_expr_with_wfl, missing_return_error,
11032 unreachable_stmt_error): New functions.
11033 (java_get_real_method_name): Identify constructors bearing class
11034 names in source code compiled classes only.
11035 (java_complete_expand_methods): Call missing_return_error.
11036 (invocation_mode): Private methods invoked as static methods.
11037 (java_complete_tree): Call unreachable_stmt_error.
11038
11039 1998-12-01 Tom Tromey <tromey@cygnus.com>
11040
11041 * Makefile.in (+target): Removed.
11042 (+xmake_file): Likewise.
11043 (+tmake_file): Likewise.
11044 (.NOEXPORT): Removed duplicate.
11045
11046 1998-11-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
11047
11048 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
11049
11050 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
11051
11052 * jvgenmain.c: Remove the xmalloc prototype, we get it from
11053 libiberty.h. Provide an xmalloc definition.
11054
11055 * jvspec.c: Remove the xmalloc prototype.
11056
11057 * parse-scan.y: Include config.h and system.h. Don't include
11058 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
11059 Provide an xstrdup definition.
11060
11061 1998-11-26 Alexandre Oliva <oliva@dcc.unicamp.br>
11062
11063 * jcf-path.c (add_entry): Recognize ".jar" too.
11064 * lang-specs.h: Likewise.
11065
11066 1998-11-26 Per Bothner <bothner@cygnus.com>
11067
11068 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
11069 soft_monitorenter_node, soft_monitorexit_node, throw_node.
11070
11071 * jcf-write.c (generate_bytecode_insns):
11072 Handle pre/post-increment/decrement of long.
11073
11074 * jcf-write.c (generate_bytecode_insns):
11075 Handle missing exception handler (finally for synchronized).
11076
11077 1998-11-25 Per Bothner <bothner@cygnus.com>
11078
11079 * java-tree.h (end_params_node): Declare global.
11080 * decl.c (end_params_node): New global.
11081 (init_decl_processing, start_java_method): Use end_params_node for
11082 end of list of parameter types. Follows correct gcc conventions.
11083 * expr.c (pop_argument_types, pop_arguments): Likewise.
11084 * lang.c (put_decl_node): Likewise.
11085 * typeck.c (various places): Likewise.
11086 * class.y (various places): Likewise.
11087 * parse.y (various places): Likewise.
11088
11089 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
11090 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
11091
11092 * class.c: Add #include flags.h, remove no-longer needed declaration.
11093
11094 * class.c (layout_class_method): Remove commented-out code, re-format.
11095 Don't add vtable entry (or index) for private methods.
11096 * expr.c (expand_invoke): A private method is implicitly final.
11097 * class.c (make_class_data): If inlining or optimizing,
11098 skip private methods.
11099
11100 * class.c (finish_class): New function. Calls existing methods,
11101 but alls emits deferred inline functions.
11102 * jcf-parse.c (parse_class_file): Call finish_class.
11103 * parse.y (java_complete_expand_methods): Likewise.
11104
11105 * expr.c (build_java_binop): Explicit default, to silence -Wall.
11106
11107 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
11108
11109 1998-11-25 Marc Espie <espie@quatramaran.ens.fr>
11110
11111 * jcf-write.c (generate_bytecode_conditional): Fix typo.
11112
11113 1998-11-24 Per Bothner <bothner@cygnus.com>
11114
11115 * (generate_classfile): Always write class access flag with
11116 ACC_SUPER set.
11117
11118 1998-11-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
11119
11120 * class.c (maybe_layout_super_class): New function.
11121 (layout_class): Reorganized. Loop on class methods dispatched into
11122 a new function. Call maybe_layout_super_class.
11123 (layout_class_methods, layout_class_method): New functions.
11124 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
11125 class.
11126 (expand_invoke): Likewise.
11127 * java-tree.h (all_class_list): New global variable declared.
11128 (layout_class_methods, layout_class_method): New function
11129 prototypes.
11130 (LAYOUT_SEEN_CLASS_METHODS): New macro.
11131 * jcf-parse.c (all_class_list): New global variable.
11132 (load_class): Extended what class_or_name can be. Use parser
11133 context mechanism to save globals before calling jcf_parse.
11134 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
11135 is set on the file name.
11136 (jcf_parse): Layout class methods when Object is loaded, otherwise
11137 record class in all_class_list for delayed method layout.
11138 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
11139 * lang.c (put_decl_node): Decode <init> into the decl context
11140 class name.
11141 * lex.c (java_allocate_new_line): Use xmalloc.
11142 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
11143 pointers, not TREE_LIST elements.
11144 (struct parser_ctxt): Fixed comment indentations, added comments
11145 and reordered some fields.
11146 (java_check_methods): Function prototype removed.
11147 * parse.y (java_push_parser_context): Use xmalloc.
11148 (java_parser_context_restore_global): Pop extra pushed ctxp only
11149 when there's nothing next.
11150 (maybe_create_class_interface_decl): Fixed comment, add new
11151 created class decl to all_class_list.
11152 (method_header): Use GET_REAL_TYPE on argument's types.
11153 (method_declarator): Use GET_REAL_TYPE, change type to the real
11154 type in TREE_LIST dependency node. Build argument list with the
11155 real type.
11156 (create_jdep_list): Use xmalloc. Removed allocation error message.
11157 (obtain_incomplete_type): Fixed leading comment. Broadened
11158 incoming argument meaning.
11159 (register_incomplete_type): Use xmalloc. Removed allocation error
11160 message.
11161 (safe_layout_class): Fixed leading comment.
11162 (jdep_resolve_class): Reversed if statement condition and switch
11163 if and else bodies.
11164 (resolve_and_layout): Fixed leading comment. Broadened incoming
11165 argument meaning.
11166 (complete_class_report_errors): New local variable name, for
11167 clarity. purify_type_name used for all error cases.
11168 (java_get_real_method_name): Stricter check on constructors.
11169 (java_check_regular_methods): Reverse methods list only if not
11170 already laid out. Layout artificial constructor.
11171 (java_check_methods): Deleted.
11172 (source_start_java_method): Obtain incomplete type for patchable
11173 method arguments.
11174 (java_layout_classes): Fixed leading comment. Use
11175 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
11176 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
11177 before returning. Fixed comments.
11178 (java_expand_classes): Check for errors up front.
11179 (patch_method_invocation): Class to search is resolved and laid
11180 out.
11181
11182 1998-11-24 Per Bothner <bothner@cygnus.com>
11183
11184 * expr.c (java_lang_expand_expr): Add missing emit_queue.
11185
11186 * javaop.h (int8): Removed - not used.
11187 (jbyte): Redefine portably with correct signedness.
11188
11189 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
11190
11191 * jcf-write.c (generate_bytecode_insns): Fix typo
11192 OPCODE_getstatic to OPCODE_getfield.
11193
11194 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
11195 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
11196 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
11197
11198 1998-11-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
11199
11200 * jcf-parse.c (jcf_parse_source): Function returned type is
11201 void. Added prototype.
11202 (jcf_parse): Function returned type is void.
11203 (yyparse): Remove call to fclose on the last parsed file.
11204
11205 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
11206
11207 1998-11-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
11208
11209 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
11210 (layout_class): Cope with methods featuring WFL in decl names.
11211 * decl.c (unqualified_object_id_node): New global variable,
11212 initialized.
11213 (build_decl_no_layout): Removed.
11214 * expr.c (build_primtype_type_ref): Handle Double.
11215 (java_lang_expand_expr): Fixed indentations.
11216 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
11217 (flag_wall, flag_redundant, flag_not_overriding,
11218 flag_static_local_jdk1_1, unqualified_object_id_node): Global
11219 variable declarations.
11220 (build_decl_no_layout): Removed prototype.
11221 (java_get_real_method_name): Added prototype.
11222 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
11223 (java_parse_abort_on_error): Macro now just returns.
11224 * jcf-parse.c (jcf_parse_source): Check fclose returned
11225 value. Call emit_register_classes if java_report_errors returns
11226 zero.
11227 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
11228 flag_static_local_jdk1_1): New integer flags.
11229 (lang_decode_option): New flags set here.
11230 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
11231 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
11232 the flag_redundant variable.
11233 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
11234 when parsing java.lang.Object class.
11235 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
11236 NULL_TREE to build.
11237 (resolve_qualified_expression_name): Fixed indentation.
11238 (patch_array_ref): Changed prototype.
11239 (not_initialized_as_it_should_p): Prototype removed.
11240 (java_report_errors): Added function prototype.
11241 * parse.y (formal_parameter:): Changed error message for not yet
11242 supported final parameters.
11243 (class_type_list:): Set both PURPOSE and VALUE of created
11244 TREE_LIST to be class_type.
11245 (primary_no_new_array:): Handle class literals on primitive types.
11246 (parse_warning_context): Reinstalled correct force_error and
11247 do_warning flags setups.
11248 (java_report_errors): Changed prototype. Return java_error_count
11249 value.
11250 (variable_redefinition_error): Consider treating variable type as
11251 a fake pointer.
11252 (create_interface): Warn about redundant abstract modifier if
11253 flag_redundant is set. Changed error message.
11254 (lookup_field_wrapper): Save/restore globals before/after looking
11255 up field.
11256 (duplicate_declaration_error_p): Consider treating declaration
11257 type as a fake pointer.
11258 (register_fields): Extract real type from dependency node. Check
11259 for duplicate field declaration after type adjustment. Use
11260 DECL_INITIAL to store static final initialized values.
11261 (method_header): Extract real function type from dependency node.
11262 (check_abstract_method_header): Use GET_METHOD_NAME.
11263 (obtain_incomplete_type): Layout fake pointer type.
11264 (safe_layout_class): Don't try to check for methods before layout.
11265 (java_complete_class): Don't check for correct throws clause
11266 elements inheritance here.
11267 (resolve_and_layout): Broadened name parameter meaning.
11268 (reset_method_name): Use GET_METHOD_NAME.
11269 (java_get_real_method_name): New function.
11270 (java_check_regular_methods): Don't check methods in
11271 java.lang.Object. Verify lineage of throws clause elements. Use
11272 flag_no_overriding in warning report.
11273 (check_throws_clauses): Don't check if class was from
11274 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
11275 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
11276 (declare_local_variables): Use flag_static_local_jdk1_1 to report
11277 warning on unsupported final local variables. Use build_decl
11278 instead of build_decl_no_layout. Get real local variable type from
11279 dependency node.
11280 (source_start_java_method): Get real parameter type from
11281 dependency node. Call build_decl instead of build_decl_no_layout.
11282 (java_layout_classes): Reverse tree and layout type and class as
11283 required. Mark class as loaded when done.
11284 (resolve_field_access): Fixed indentation. Restricted condition
11285 leading to static field access code generation. Set field_type
11286 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
11287 (resolve_qualified_expression_name): Initialize type_found to
11288 null. Handle static field resolved during qualification. Fixed
11289 layout on non primitive field decl types.
11290 (not_accessible_p): Fixed typo in comment.
11291 (patch_method_invocation): Resolve and layout class to search from
11292 type.
11293 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
11294 layout non primitive type, if necessary. Make method node only to
11295 report errors.
11296 (find_applicable_accessible_methods_list): Consider WFL'ed method
11297 decl names. Fixed indentation.
11298 (argument_types_convertible): Resolve and layout target type if
11299 necessary.
11300 (java_complete_tree): Fixed indentation problems. Rewrote
11301 CALL_EXPR thrown exceptions check. Re-installed further processing
11302 of the assignment in certain cases.
11303 (patch_assignment): Call maybe_build_primttype_type_ref to perform
11304 inlining on class literals.
11305 (valid_builtin_assignconv_identity_widening_p): Cope with constant
11306 0 literal.
11307 (valid_method_invocation_conversion_p): Likewise.
11308 (patch_string): Temporary disable forbidden use of `this' in
11309 explicit constructor invocations when doing string concatenation
11310 within their scope.
11311 (patch_unaryop): Added comment. Reinstalled code to disable
11312 further check on assignment operation with cast expression RHS.
11313 (patch_switch_statement): Fixed indentation.
11314 (build_try_statement): Call build_decl instead of
11315 build_decl_no_layout.
11316 (patch_synchronized_statement): Likewise.
11317 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
11318 IS_UNCHECKED_EXPRESSION_P.
11319 (check_thrown_exceptions_do): Changed leading comment. Resolve and
11320 layout argument exception type.
11321 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
11322 of IS_UNCHECKED_EXPRESSION_P.
11323
11324 1998-11-18 Anthony Green <green@cygnus.com>
11325
11326 * jcf-parse.c (yyparse): Open class file in binary mode.
11327
11328 1998-11-15 Per Bothner <bothner@cygnus.com>
11329
11330 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
11331
11332 * jcf-write.c (perform_relocations): Move check out one loop.
11333
11334 1998-11-15 Anthony Green <green@hoser.cygnus.com>
11335
11336 * Make-lang.in: Fix reference to srcdir.
11337 * jv-scan.c: Add missing xmalloc prototype.
11338 * jvgenmain.c: Ditto.
11339
11340 1998-11-15 Per Bothner <bothner@cygnus.com>
11341
11342 * decl.c (error_mark_node), java-tree.h: New global.
11343 * parse.y: Use empty_stmt_node instead of size_zero_node.
11344 (build_if_else_statement): If missing else, use empty_stmt_node.
11345
11346 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
11347 (java_complete_expand_method): Complain if return is missing.
11348 (java_check_regular_methods): Comment out incorrect error check.
11349 (not_accessible_p): Fix incorrect handling of protected methods.
11350 (patch_method_invocation): Pass correct context to not_accessible_p.
11351 (find_applicable_accessible_methods_list): Likewise.
11352 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
11353 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
11354 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
11355 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
11356
11357 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
11358 (push_int_const): Remove reundant NOTE_PUSH.
11359 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
11360 (- case SWITCH_EXPR): Fix code generation bug.
11361 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
11362 (generate_classfile): More robust for abstract methods.
11363
11364 1998-11-15 Anthony Green <green@cygnus.com>
11365
11366 * Makefile.in: jv-scan and jvgenmain all require libiberty.
11367 * Make-lang.in: Ditto.
11368
11369 * jv-scan.c: Remove xmalloc and xstrdup definitions.
11370 * jvgenmain: Ditto.
11371
11372 1998-11-15 Per Bothner <bothner@cygnus.com>
11373
11374 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
11375
11376 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
11377
11378 1998-11-14 Per Bothner <bothner@cygnus.com>
11379
11380 Allow uses of interface types to verify. This is not really
11381 type-safe, but it matches what Sun does, and is OK as long as
11382 there are appropriate run-time checks.
11383 * verify.c (merge_types): If merging two interface types,
11384 just set the result to java.lang.Object.
11385 * expr.c (pop_type): Any interface is matches by java.lang.Object.
11386
11387 1998-11-13 Tom Tromey <tromey@cygnus.com>
11388
11389 * gjavah.c (main): Handle --output-class-directory argument.
11390 * jvspec.c (lang_specific_driver): Translate `-d' into
11391 -foutput-class-dir.
11392 * jcf.h (jcf_write_base_directory): Declare.
11393 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
11394 * lang-options.h: Mention -foutput-class-dir.
11395 * jcf-write.c (jcf_write_base_directory): New global.
11396 (make_class_file_name): Put generated .class file into `-d'
11397 directory, or into source directory if -d not given. Function now
11398 static.
11399 (write_classfile): Free class file name. Handle case where class
11400 file name is NULL.
11401 (DIR_SEPARATOR): New macro.
11402 Include <sys/stat.h>
11403
11404 * Makefile.in (prefix): New macro.
11405
11406 1998-11-12 Per Bothner <bothner@cygnus.com>
11407
11408 * parse.y (patch_invoke): Do less if flag_emit_class_files.
11409 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
11410 here (done in patch_invoke instead).
11411 (case_identity): Moved here from parse.y.
11412
11413 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
11414 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
11415 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
11416 so they can be efficiently scanned without recursion.
11417 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
11418 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
11419 in BLOCK iteratively, rather than recursively.
11420
11421 * parse.y (do_unary_numeric_promotion): New function.
11422 (patch_unaryop, patch_binop, patch_array_ref): Use it.
11423
11424 * parse.y (patch_newarray): Various fixes.
11425
11426 Re-do handling of switch statements (for proper block scoping).
11427 * parse.y: Add just a single block for the enture switch block,
11428 but don't create any "case blocks".
11429 (group_of_labels): Rmeoved unneeded non-terminal.
11430 CASE_EXPR and DEFAULT_EXPR are added to current block.
11431 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
11432 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
11433 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
11434 * parse.y (wfl_operator, print_int_node): Make non-static.
11435 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
11436 as part of recursive scan of block.
11437 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
11438 (patch_switch_statement): Most tests move dinto java_complete_tree.
11439
11440 * parse.y: Make various production be non-typed (void).
11441 * parse.y (parse_error): Merged into issue_warning_error_from_context.
11442 * parse.y (add_stmt_to_compound): Don't create/change extra node.
11443 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
11444
11445 * jcf-write.c (struct jcf_handler): New type.
11446 (struct jcf_switch_state): New type.
11447 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
11448 (alloc_handler, emit_unop, emit_reloc): New functions.
11449 (adjust_typed_op): Add extra parameter ("max type" offset).
11450 (emit_switch_reloc, emit_case-reloc): New function.
11451 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
11452 (generate_bytecode_insns): Support REAL_CST, switch statements,
11453 exception handling, method calls, object/array creation, and more.
11454
11455 * class.c: Remove some unused variables.
11456 * constants.c (find_string_constant): New function.
11457 (count_constant_pool_bytes): Fix to correctly handle wide constants.
11458 * decl.c (complete_start_java_method): Don't _Jv_InitClass
11459 if flag_emit_class_files.
11460
11461 1998-11-12 Tom Tromey <tromey@cygnus.com>
11462
11463 * jcf-io.c (find_class): Added explanatory comment.
11464
11465 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
11466 trailing slash to `.zip' entries.
11467
11468 * jvspec.c (lang_specific_driver): Correctly handle case where
11469 GC_NAME not defined.
11470
11471 1998-11-11 Tom Tromey <tromey@cygnus.com>
11472
11473 * jvspec.c (GC_NAME): New define.
11474 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
11475 if required.
11476 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
11477
11478 1998-11-11 Per Bothner <bothner@cygnus.com>
11479
11480 * jcf-dump.c (TABLE_SWITCH): Fix typos.
11481
11482 1998-11-11 Tom Tromey <tromey@cygnus.com>
11483
11484 * jcf-dump.c (main): Correctly recognize `--'-style long options.
11485
11486 1998-11-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
11487
11488 * class.c (is_compiled_class): Call safe_layout_class for class
11489 compiled from source.
11490 * conver.h (convert_to_integer, convert_to_real,
11491 convert_to_pointer): Added prototypes.
11492 * decl.c (init_decl_processing): Non longer push the decls of
11493 `methodtable', `constants', `Class', `Field', `dispatchTable'
11494 `jexception' and `Method'.
11495 * expr.c (build_invokeinterface): New function.
11496 (expand_invoke): static variable CLASS_IDENT now in
11497 build_invokeinterface. Use build_invokeinterface.
11498 (expand_java_field_op): Moved code to inline
11499 java.lang.PRIMTYPE.TYPE into a function.
11500 (build_primtype_type_ref): New function.
11501 * java-tree.def (INSTANCEOF_EXPR): New tree code.
11502 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
11503 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
11504 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
11505 (DECL_LOCAL_STATIC_VALUE): New macro.
11506 (build_invokeinterface, build_primtype_type_ref): New function
11507 prototypes.
11508 (java_parse_abort_on_error): Macro rewritten.
11509 * jcf-parse.c (current_method): Add comment to declaration.
11510 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
11511 Function prototypes fixed.
11512 (jcf_parse_source): push/pop parser context. save/restore global.
11513 (parse_source_file): Fixed leading comment. Now take a
11514 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
11515 classes and pop the parser context anymore.
11516 (yyparse): Push parser context, save globals, parse the source
11517 file, restore globals and pop the parser context when processing a
11518 source file.
11519 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
11520 * lex.c (java_parse_doc_section): New function.
11521 (java_lex): Call java_parse_doc_section when appropriate. Build an
11522 operator around INSTANCEOF_TK.
11523 * lex.h (java_lineterminator, java_sprint_unicode,
11524 java_unicode_2_utf8, java_lex_error, java_store_unicode):
11525 Prototypes rewritten.
11526 (java_parse_escape_sequence, java_letter_or_digit_p,
11527 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
11528 java_read_unicode, java_store_unicode, java_read_char,
11529 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
11530 Added function prototypes.
11531 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
11532 define.
11533 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
11534 New macros
11535 (struct parser_ctxt): New fields: deprecated,
11536 current_parsed_class_un, gclass_list.
11537 (fix_method_argument_names, issue_warning_error_from_context,
11538 resolve_package, lookup_package_type): New function prototypes.
11539 (resolve_expression_name): Fixed function prototype.
11540 (find_applicable_accessible_methods_list): Fixed indentation, added
11541 extra argument in prototype.
11542 (check_final_assignment, build_null_of_type, check_deprecation,
11543 check_method_redefinition, reset_method_name,
11544 java_check_regular_methods, java_check_abstract_methods,
11545 maybe_build_primttype_type_ref): New function prototype.
11546 * parse.y (conver.h): Include.
11547 (INSTANCEOF_TK): Tagged <operator>.
11548 (single_type_import_declaration): Use REGISTER_IMPORT macro.
11549 (relational_expression:): Build binop for instanceof.
11550 (java_push_parser_context): Remember ctxp->gclass_list across
11551 contexts.
11552 (java_pop_parser_context): Simply return if no context
11553 exists. Remember gclass_list across contexts.
11554 (issue_warning_error_from_context): New function.
11555 (parse_error_context): Don't setup ctxp->elc here. Call
11556 issue_warning_error_from_context instead.
11557 (parse_warning_context): Likewise.
11558 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
11559 setup. Link new class/interface to ctxp->gclass_list.
11560 (add_superinterfaces): Register interface as incomplete if not
11561 loaded.
11562 (create_class): Remember class unqualified name in
11563 ctxp->current_parsed_class_un. Check class deprecation.
11564 (register_fields): Check field deprecation. Remember static final
11565 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
11566 processing INIT.
11567 (method_header): New local variable ORIG_ARG. Use unqualified
11568 current class name for check on constructor errors. Promote return
11569 type if of record type. Argument list fix moved in
11570 fix_method_argument_names, called here. Check method deprecation.
11571 (fix_method_argument_names): New function.
11572 (method_declarator): Promote record typed arguments.
11573 (safe_layout_class): Check class methods before layout.
11574 (java_complete_class): Compute field layout when patched.
11575 (do_resolve_class): Try to load class after having it renamed
11576 after the package name.
11577 (get_printable_method_name): Use DECL_CONTEXT.
11578 (reset_method_name): New function.
11579 (check_method_redefinition): Use reset_method_name.
11580 (java_check_regular_methods): New local variable
11581 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
11582 names for error report. Check for compile-time error when method
11583 found has default (package) access.
11584 (java_check_abstract_methods): Now takes an interface DECL node as
11585 an argument. Also reinstall real name on unchecked
11586 overriding/hiding methods for error report.
11587 (java_check_methods): Fixed leading comment. Get classes to verify
11588 from ctxp->gclass_list. Use CHECK_METHODS macro and set
11589 CLASS_METHOD_CHECKED_P on class verification.
11590 (lookup_java_method2): Get real method name if necessary.
11591 (find_in_imports): Don't check package class access here.
11592 (resolve_package, lookup_package_type): New functions.
11593 (java_layout_classes): Fixed leading comment. Take classes to be
11594 laid out from ctxp->gclass_list.
11595 (java_complete_expand_methods): Don't expand native and abstract
11596 methods.
11597 (java_expand_classes): New function.
11598 (resolve_expression_name): Use additional argument ORIG. Retrieve
11599 values of static final field of primitive types.
11600 (resolve_field_access): Handles static final field of promotive
11601 type.
11602 (resolve_qualified_expression_name): Handle STRING_CST as
11603 primaries and package name resolution. Check deprecation on found
11604 decls. Set where_found and type_found on non static field resolved
11605 during qualification. Layout non primitive field decl types.
11606 (check_deprecation): New function.
11607 (maybe_access_field): Simplified.
11608 (patch_method_invocation_stmt): Local variable CLASS_TYPE
11609 removed. Reverse method's argument when primary is a type. Don't
11610 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
11611 instead. Include abstract class in the list of class searchable
11612 for constructors. Use DECL_CONTEXT of found method for access
11613 checks. Check method deprecation.
11614 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
11615 converting arguments. Handle INVOKE_INTERFACE.
11616 (lookup_method_invoke): Search constructor using existing
11617 infrastructure (don't rely on lookup_java_constructor anymore).
11618 (find_applicable_accessible_methods_list): Extra argument flag
11619 LC. Now include constructor in the search.
11620 (qualify_ambiguous_name): Conditional expression are primaries.
11621 (not_initialized_as_it_should_p): static final are always
11622 initialized.
11623 (java_complete_tree): Pass extra NULL argument to
11624 resolve_expression_name. Stricter test to carry on patching
11625 assignments. New case for INSTANCEOF_EXPR.
11626 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
11627 (check_final_assignment, maybe_build_primttype_type_ref): New
11628 functions.
11629 (patch_assignment): Detect resolved static finals and carry normal
11630 assignment error check on them. Inline PRIMTYPE.TYPE read access.
11631 (try_builtin_assignconv): Access constant 0 on all primitive
11632 types.
11633 (valid_builtin_assignconv_identity_widening_p): Accept identical
11634 types. Accept all promoted type on int type.
11635 (valid_ref_assignconv_cast_p): Accept a null pointer to be
11636 assigned to a reference.
11637 (valid_method_invocation_conversion_p): Accept to check null
11638 pointers.
11639 (build_binop): Merge declaration and initialization of local
11640 variable BINOP.
11641 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
11642 numeric types. Improved validity test for qualify operators on
11643 references.
11644 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
11645 and PREINCREMENT_EXPR. Also detect resolved static finals of a
11646 primitive type and issue the appropriate error message.
11647 (resolve_type_during_patch): Mark class loaded when resolved.
11648 (patch_cast): Allow null to be cased to reference types.
11649 (build_null_of_type): New function.
11650 (patch_array_ref): Handle array on references correctly.
11651 (patch_return): Removed unused local variable MODIFY. Force
11652 boolean to be returned as integers. Allows null to be returned by
11653 a function returning a reference.
11654 * typeck.c (convert_to_integer, convert_to_real,
11655 convert_to_pointer): Prototypes moved to convert.h
11656 (lookup_argument_method): Use method real name, if necessary.
11657
11658 1998-10-30 Tom Tromey <tromey@cygnus.com>
11659
11660 * class.c (build_class_ref): Changed name of primitive classes to
11661 start with `_Jv_'.
11662
11663 * class.c (make_class_data): Renamed fields: nmethods to
11664 method_count, method_count to dtable_method_count. Always set
11665 `state' field to 0.
11666 * decl.c (init_decl_processing): Likewise.
11667
11668 1998-10-28 Alexandre Petit-Bianco <apbianco@cygnus.com>
11669
11670 * class.c (layout_class): Don't mangle <finit>, produce
11671 __finit<class> instead. Don't verify artificial methods.
11672 * decl.c (finit_identifier_node): New declared global.
11673 (init_decl_processing): finit_identifier_node initialized.
11674 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
11675 * java-tree.h (finit_identifier_node): Declared as extern.
11676 (struct lang_decl): New field called_constructor.
11677 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
11678 (CLASS_HAS_FINIT_P): New macro.
11679 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
11680 explicit constructor invocation.
11681 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
11682 CALL_SUPER_CONSTRUCTOR_P): New macros.
11683 (write_classfile): Added prototype.
11684 * jcf-parse.c (jcf_parse_source): Parse and remember for
11685 generation if the file was seen on the command line.
11686 (parse_source_file): Don't write the class file here.
11687 (yyparse): Loop on files rewritten. Set current_jcf.
11688 (parse_zip_file_entries): Parse class file only if it was found.
11689 * lang.c (init_parse): Don't open command line provided filename
11690 here.
11691 (lang_parse): Don't set main_jcf anymore.
11692 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
11693 (JCONSTRUCTOR_CHECK): New macro.
11694 (JBSC_TYPE_P): New macro.
11695 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
11696 (COMPLETE_CHECK_OP_2): New macro.
11697 (struct parse_ctxt): New field explicit_constructor_p.
11698 (check_class_interface_creation): Fixed prototype indentation.
11699 (patch_method_invocation_stmt): Prototype reflects added argument.
11700 (patch_invoke): Likewise.
11701 (complete_method_declaration, build_super_invocation,
11702 verify_constructor_circularity,
11703 build_this_super_qualified_invocation, get_printable_method_name,
11704 patch_conditional_expr, maybe_generate_finit, fix_constructors,
11705 verify_constructor_super, create_artificial_method,
11706 start_artificial_method_body, end_artificial_method_body,
11707 generate_field_initialization_code): New function prototypes.
11708 * parse.y: Fixed leading comment
11709 (constructor_header:, constructor_body:, block_end:): Rules tagged
11710 <node>.
11711 (type_declaration:): Call maybe_generate_finit.
11712 (method_declaration:): Action for method_body: placed in new
11713 function complete_method_declaration, called here.
11714 (constructor_declaration:): Defined actions. Removed leading
11715 FIXME.
11716 (constructor_header:): New rule with action.
11717 (constructor_body:): Rule rewritten using block_begin: and
11718 block_end:. Defined actions.
11719 (constructor_declarator:, explicit_constructor_invocation:):
11720 Defined actions.
11721 (block:): Use new rules block_begin: block_end:.
11722 (block_begin:, block_end:): New rules and actions.
11723 (block_statements:): Fixed error message for explicit
11724 constructors.
11725 (method_invocation:): Call build_this_super_qualified_invocation
11726 if primary is `this' or `super' was seen.
11727 (conditional_expression:): Action defined.
11728 (extra_ctxp_pushed_p): New static global flag.
11729 (java_parser_context_save_global): Create parser context if
11730 necessary. Use extra_ctxp_pushed_p to remember it.
11731 (java_parser_context_restore_global): Pop extra parser context if
11732 one exists.
11733 (build_array_from_name): Array on primitive types are marked
11734 loaded.
11735 (register_fields): Restore new name in field initializer
11736 expression if type was altered. Non static fields initialized upon
11737 declaration marked initialized.
11738 (maybe_generate_finit): New function.
11739 (maybe_generate_clinit): Use create_artificial_method,
11740 start_artificial_method_body, end_artificial_method_body. Generate
11741 debug info for enclosed initialization statements.
11742 (method_header): Fixed leading comment. Check constructor
11743 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
11744 accordingly.
11745 (complete_method_declaration, constructor_circularity_msg,
11746 verify_constructor_circularity): New functions.
11747 (get_printable_method_name): New function.
11748 (check_method_redefinition): Don't rename <finit> methods. Fix
11749 declared constructor names. Error message for
11750 constructors modified.
11751 (java_check_regular_methods): Local variable seen_constructor
11752 renamed saw_constructor. Skip verification on constructors. Create
11753 default constructor with create_artificial_method.
11754 (java_check_methods): Removed unnecessary empty line.
11755 (create_artificial_method, start_artificial_method_body,
11756 end_artificial_method_body): New functions.
11757 (java_layout_classes): Changed leading comment. Reverse fields
11758 list if necessary. Always layout java.lang.Object if being
11759 defined.
11760 (java_complete_expand_methods): Verify constructor circularity.
11761 (java_complete_expand_method): Call fix_constructor on
11762 constructors. Local variable no_ac_found removed. Restore
11763 bindings if method body expansion failed.
11764 (fix_constructors, verify_constructor_super,
11765 generate_field_initialization_code): New function.
11766 (java_expand_classes): Fixed leading comment. Write class file
11767 here.
11768 (resolve_expression_name): Check for illegal instance variable
11769 usage within the argument scope of an explicit constructor
11770 invocation.
11771 (resolve_qualified_expression_name): Pass extra from_super flag
11772 when invoking patch_method_invocation_stmt. New case for
11773 conditional expression when used as a primary. Check for error
11774 when acquiring super.
11775 (patch_method_invocation_stmt): Added extra argument super. New
11776 local variable is_static_flag. Set class_to_search according to
11777 the nature of the constructor invocation. Don't add `this'
11778 argument when expanding NEW_CLASS_EXPR. Check for illegal method
11779 invocation within the argument scope of explicit constructor
11780 invocation. Set is_static according to is_static_flag. Provide
11781 extra `super' argument to patch_invoke invocation.
11782 (patch_invoke): New argument from_super. Loop on arguments
11783 indentation fixed. Pass from_super to invocation_mode. New switch
11784 case INVOKE_SUPER. Fixed error message in switch default case.
11785 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
11786 value.
11787 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
11788 (lookup_method_invoke): Fixed prototypes in candidates list. Error
11789 message takes constructors into account.
11790 (find_applicable_accessible_methods_list): Fixed indentation.
11791 (qualify_ambiguous_name): Take explicit constructor invocation
11792 into account. Deal with a conditional expression as a primary to
11793 a method call.
11794 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
11795 case. Added extra argument to patch_method_invocation_stmt.
11796 Register calls made to explicit constructor `this'. Don't call
11797 save_expr in ARRAY_REF case when emitting class files. Check for
11798 illegal use of this when expanding explicit constructor invocation
11799 arguments.
11800 (complete_function_arguments): Set and reset parser context
11801 explicit_constructor_p field value when appropriate.
11802 (build_super_invocation, build_this_super_qualified_invocation):
11803 New functions.
11804 (patch_assignment): Fixed typo.
11805 (patch_unaryop): Check on final fields occurs only when a decl
11806 exits.
11807 (patch_return): Take constructors into account.
11808 (patch_conditional_expr): New function.
11809 * typeck.c (build_java_signature): Removed unnecessary empty line.
11810
11811 1998-10-28 Jeffrey A Law (law@cygnus.com)
11812
11813 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
11814
11815 1998-10-28 Tom Tromey <tromey@cygnus.com>
11816
11817 * decl.c (init_decl_processing): Renamed fields.
11818 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
11819 interface_len, msize fields.
11820
11821 * class.c (make_class_data): Removed subclass_head and
11822 subclass_next fields.
11823 * decl.c (init_decl_processing): Removed subclass_head and
11824 subclass_next fields.
11825
11826 1998-10-28 Jeffrey A Law (law@cygnus.com)
11827
11828 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
11829 * mangle.c (emit_unicode_mangled_name): Similarly.
11830
11831 1998-10-26 Nick Clifton <nickc@cygnus.com>
11832
11833 * jcf-parse.c (get_constant): Place braces around code to compute
11834 'd' when REAL_ARITHMETIC is not defined.
11835
11836 1998-10-25 H.J. Lu (hjl@gnu.org)
11837
11838 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
11839 dependency.
11840
11841 1998-10-23 Tom Tromey <tromey@cygnus.com>
11842
11843 * lang-specs.h: `.zip' files are input to jc1.
11844
11845 1998-10-22 Per Bothner <bothner@cygnus.com>
11846
11847 * jvspecs.c: Add (but don't enable) support for combining multiple
11848 .class and .java input filenames to a single jc1 invocation.
11849 Add support for -C flag (copile to .class files).
11850 Translate -classpath and -CLASSPATH arguments.
11851 * lang-specs.h: Don't set %2 spec.
11852
11853 1998-10-22 Tom Tromey <tromey@cygnus.com>
11854
11855 * jcf-path.c (add_entry): Don't add trailing separator if entry is
11856 a .zip file.
11857 (add_path): Don't add trailing separator to non-empty path
11858 elements.
11859
11860 * lang.c (lang_decode_option): Check for -fclasspath and
11861 -fCLASSPATH before examining other `-f' options.
11862
11863 * java-tree.h (finalize_identifier_node): Don't declare.
11864 * class.c (make_class_data): Don't push "final" field.
11865 * decl.c (init_decl_processing): Don't push "final" field.
11866 (finalize_identifier_node): Removed.
11867 (init_decl_processing): Don't set finalize_identifier_node.
11868
11869 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
11870
11871 1998-10-11 Anthony Green <green@cygnus.com>
11872
11873 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
11874 (JV_SCAN_SOURCES): New macro.
11875 (JCF_DUMP_SOURCES): Likewise.
11876 (jcf-dump$(exeext)): New target.
11877 (jv-scan$(exeext)): New target.
11878
11879 1998-10-22 Tom Tromey <tromey@cygnus.com>
11880
11881 * Makefile.in (LEX): Removed.
11882 (LEXFLAGS): Likewise.
11883 (SET_BISON): New macro.
11884 (BISON): Removed.
11885 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
11886 spurious diffs in parse.c.
11887 ($(PARSE_SCAN_C)): Likewise.
11888 (PARSE_DIR): New macro.
11889 (PARSE_C): Use it.
11890 (PARSE_SCAN_C): Likewise.
11891 (PARSE_RELDIR): New macro.
11892
11893 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
11894
11895 * jcf-io.c (find_class): Use saw_java_source to determine when to
11896 look for `.java' file.
11897 * jcf-parse.c (saw_java_source): New global.
11898 (yyparse): Set it if `.java' file seen.
11899
11900 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
11901 (GCJH_SOURCES): Likewise.
11902 * Makefile.in (datadir): New macro.
11903 (libjava_zip): Likewise.
11904 (JAVA_OBJS): Added jcf-path.o.
11905 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
11906 (../gcjh$(exeext)): Likewise.
11907 (jcf-path.o): New target.
11908 * java-tree.h (fix_classpath): Removed decl.
11909 * jcf-parse.c (fix_classpath): Removed.
11910 (load_class): Don't call fix_classpath.
11911 * parse.y (read_import_dir): Don't call fix_classpath.
11912 * lex.h: Don't mention classpath.
11913 * lex.c (java_init_lex): Don't initialize classpath.
11914 * jcf-io.c (classpath): Removed global.
11915 (find_class): Use jcf_path iteration functions. Correctly search
11916 class path for .java file.
11917 (open_in_zip): New argument `is_system'.
11918 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
11919 classpath-related options.
11920 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
11921 and -I.
11922 (lang_init): Call jcf_path_init.
11923 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
11924 * lang-specs.h: Handle -I. Minor cleanup to -M options.
11925 Correctly put braces around second string in each entry.
11926 * gjavah.c (main): Call jcf_path_init. Recognize all the new
11927 classpath-related options.
11928 (help): Updated for new options.
11929 * jcf.h: Declare functions from jcf-path.c. Don't mention
11930 `classpath' global.
11931 * jcf-path.c: New file.
11932
11933 * jcf-depend.c: Include jcf.h.
11934
11935 * jcf-write.c (localvar_alloc): Returns `void'.
11936 (localvar_free): Removed unused variable.
11937
11938 * lang.c (OBJECT_SUFFIX): Define if not already defined.
11939 (init_parse): Use OBJECT_SUFFIX, not ".o".
11940
11941 1998-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
11942
11943 * class.c (emit_register_classes): Renamed from
11944 emit_register_class.
11945 * java-tree.h (emit_register_classes): Prototype renamed from
11946 emit_register_class.
11947 * jcf-parse.c (yyparse): Call emit_register_classes once before
11948 returning.
11949 * parse.y (java_expand_classes): No longer register classes.
11950
11951 1998-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
11952
11953 * class.c (is_compiled_class): New local variable
11954 seen_in_zip. Identify classes found in currently compiled source
11955 file(s).
11956 * decl.c (complete_start_java_method): Fixed typo.
11957 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
11958 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
11959 (CLASS_P): Moved around.
11960 (java_parse_abort_on_error): Macro moved from jcf-parse.c
11961 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
11962 java-parse.h
11963 (jcf_parse_source): Changed leading comment. Removed unnecessary
11964 fclose and CLASS_FROM_SOURCE_P marking.
11965 (parse_source_file): New local variables remember_for_generation
11966 and filename. Mark parsed file name identifier node. Removed block
11967 executed when parse_only was null. Set remember_for_generation.
11968 Use it as an argument to java_pop_parser_context.
11969 (yyparse): New local variables several_files, list, next node and
11970 current_file_list. Split ampersand separated file names into
11971 current_file_list. Iterate through the list and parse accordingly.
11972 * parse.h (java_pop_parser_context): New function prototype.
11973 * parse.y (ctxp_for_generation): New static global variable.
11974 (java_pop_parser_context): New argument generate. Link popped ctxp
11975 to ctxp_for_generation list accordingly.
11976 (java_complete_expand_methods): Fixed indentation.
11977 (java_expand_classes): New function.
11978
11979 1998-10-17 Per Bothner <bothner@cygnus.com>
11980
11981 * Makefile.in: Link with libiberty.a instead of memmove.o.
11982
11983 1998-10-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
11984
11985 * lex.c (setjmp.h): No longer included.
11986 * lex.h (setjmp.h): Included.
11987 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
11988 (duplicate_declaration_error_p): Renamed from
11989 duplicate_declaration_error.
11990 (build_array_from_name): New function prototype.
11991 * parse.y (setjmp.h): No longer included.
11992 (variable_declarator_id): Define action.
11993 (build_array_from_name): New function.
11994 (duplicate_declaration_error_p): Renamed from
11995 duplicate_declaration_error. Fixed leading comment.
11996 (register_fields): Main `for' loop reorganized. Uses
11997 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
11998 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
11999 build_array_from_name.
12000 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
12001 types.
12002 (read_import_dir): Don't try to skip `.' and `..'.
12003 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
12004 build_array_from_name. Main `for' loop reorganized.
12005 (resolve_qualified_expression_name): When building access to a
12006 field, use the type where the field was found, not its own type.
12007 (maybe_access_field): Use field DECL_CONTEXT if the type where the
12008 field was found is null.
12009 (qualify_ambiguous_name): Sweep through all successive array
12010 dimensions.
12011
12012 1998-10-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
12013
12014 * java-tree.h (pop_labeled_block, lang_printable_name,
12015 maybe_add_interface, set_super_info, get_access_flags_from_decl,
12016 interface_of_p, inherits_from_p, fix_classpath,
12017 complete_start_java_method, emit_handlers, init_outgoing_cpool,
12018 make_class_data, register_class, alloc_name_constant): New
12019 function prototypes.
12020 * lang.c (lang_decode_option): Set argc argument unused. Fixed
12021 indentation. Added cast to remove warning.
12022 (lang_printable_name): Set v argument unused.
12023 (lang_print_error): Added argument to lang_printable_name call.
12024 (java_dummy_print, print_lang_decl, print_lang_type,
12025 print_lang_identifier, lang_print_xnode): All argument marked
12026 unused.
12027 * lex.c (java_unget_unicode): Removed unnecessary argument.
12028 (java_allocate_new_line): Unused local variable is gone.
12029 (java_read_char): Added parenthesis in expressions to remove
12030 warnings. Added final return statement.
12031 (java_read_unicode): Added parenthesis in expression to remove
12032 warning.
12033 (java_parse_end_comment): Fixed java_unget_unicode invocation.
12034 (java_parse_escape_sequence): Likewise.
12035 (java_lex): Unused local variables are gone. Fixed
12036 java_unget_unicode invocation.
12037 * lex.h (set_float_handler): Prototype added when JC1_LITE not
12038 defined.
12039 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
12040 lang_printable_name invocation in macro.
12041 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
12042 Likewise.
12043 (duplicate_declaration_error): Suppressed unused argument in
12044 prototype.
12045 (identical_subpath_p): Function declaration is gone.
12046 (patch_invoke): Suppressed unused argument in prototype.
12047 (patch_cast, build_labeled_block, check_thrown_exceptions):
12048 Likewise.
12049 * parse.y (setjmp.h): Included
12050 (toplev.h): Likewise.
12051 (field_declaration:): Suppressed unused local
12052 (label_decl:): Fixed build_labeled_block invocation.
12053 (java_pop_parser_context): Put extra parenthesis around assignment
12054 in if.
12055 (yyerror): Suppressed unused local variables.
12056 (variable_redefinition_error): Fixed lang_printable_name
12057 invocation.
12058 (create_interface): Suppressed unused local variables.
12059 (create_class): Likewise.
12060 (duplicate_declaration_error): Suppressed unused argument. Fixed
12061 lang_printable_name invocation.
12062 (register_fields): Suppressed unused local variable. Fixed
12063 duplicate_declaration_error invocation.
12064 (method_header): Suppressed unused local variable.
12065 (method_declarator, parser_check_super): Likewise.
12066 (java_complete_class): Suppressed unused local variable. Fixed
12067 fatal error message.
12068 (complete_class_report_errors): Added default: in switch.
12069 (java_check_regular_methods): Fixed lang_printable_name
12070 invocations.
12071 (check_throws_clauses): Likewise.
12072 (java_check_abstract_methods): Suppressed unused local
12073 variable. Fixed lang_printable_name invocation.
12074 (read_import_entry): Added supplemental return statement.
12075 (read_import_dir): Suppressed unused local variables.
12076 (check_pkg_class_access, declare_local_variables): Likewise.
12077 (source_start_java_method): Suppressed unused extern variable
12078 declarations
12079 (expand_start_java_method): Suppressed unused extern and local
12080 variable declarations.
12081 (java_complete_expand_methods): Likewise.
12082 (java_complete_expand_method): Suppressed unused local variables.
12083 (make_qualified_name): Likewise.
12084 (resolve_qualified_expression_name): Added default: in
12085 switch. Fixed lang_printable_name invocation.
12086 (class_instance_creation_expression): Added parenthesis around
12087 expressions.
12088 (patch_method_invocation_stmt): Fixed lang_printable_name and
12089 patch_invoke invocations.
12090 (check_for_static_method_reference): Fixed lang_printable_name
12091 invocation.
12092 (patch_invoke): Suppressed unused arguments and local variables.
12093 (lookup_method_invoke): Suppressed unused local variables.
12094 (qualify_ambiguous_name): Added default: in switch.
12095 (identical_subpath_p): Function removed.
12096 (patch_assignment): Suppressed unused local variables. Suppressed
12097 unnecessary if statement. Fixed lang_printable_name invocations.
12098 (try_builtin_assignconv): Fixed lang_printable_name invocations.
12099 (valid_ref_assignconv_cast_p): Parenthesis around
12100 expression. Suppressed unused local variables.
12101 (build_binop): Suppressed unused local variables. fixed
12102 lang_printable_name invocations.
12103 (string_constant_concatenation): Suppressed unused local
12104 variables.
12105 (patch_unaryop): Fixed lang_printable_name invocation.
12106 (patch_cast): Suppressed unnecessary argument. Fixed
12107 lang_printable_name invocation.
12108 (patch_array_ref): Fixed lang_printable_name invocation.
12109 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
12110 (build_labeled_block): Suppressed unused argument.
12111 (generate_labeled_block): Fixed build_labeled_block invocation.
12112 (build_loop_body): Suppressed unused local variables.
12113 (patch_loop_statement): Likewise.
12114 (patch_exit): Fixed lang_printable_name invocation.
12115 (patch_switch_statement): Likewise.
12116 (case_identity): First argument marked unused.
12117 (patch_try_statement): Fixed lang_printable_name invocations.
12118 (patch_synchronized_statement, patch_throw_statement): Likewise.
12119 (check_thrown_exceptions): Fixed check_thrown_exceptions and
12120 lang_printable_name invocations.
12121 (check_thrown_exceptions_do): Suppressed unused argument.
12122
12123 1998-10-14 Tom Tromey <tromey@cygnus.com>
12124
12125 * jcf-write.c (write_classfile): Add output class file as target.
12126 * lang-options.h: Added -MD, -MMD, -M, and -MM.
12127 * jcf.h: Added declarations for dependency-tracking functions.
12128 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
12129 * lang.c (lang_decode_option): Recognize -MD and -MMD.
12130 (finish_parse): Call jcf_dependency_write.
12131 (dependency_tracking): New global.
12132 (DEPEND_SET_FILE): New define.
12133 (DEPEND_ENABLE): New define.
12134 (init_parse): Enable dependency tracking if required.
12135 Include "flags.h".
12136 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
12137 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
12138 (../gcjh$(exeext)): Likewise.
12139 (jcf-depend.o): New target.
12140 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
12141 (GCJH_SOURCES): Likewise.
12142 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
12143 dep_name argument.
12144 (find_classfile): Added dep_name argument.
12145 (find_class): Compute name of dependency.
12146 (open_in_zip): Call jcf_dependency_add_file.
12147 * gjavah.c (output_file): No longer global.
12148 (usage): Don't mention "gjavah".
12149 (help): Likewise.
12150 (java_no_argument): Likewise.
12151 (version): Likewise.
12152 (main): Recognize and handle -M family of options.
12153 (print_mangled_classname): Return is void.
12154 (process_file): Handle case where output is suppressed.
12155 (HANDLE_END_FIELD): Likewise.
12156 (HANDLE_METHOD): Likewise.
12157 * jcf-depend.c: New file.
12158
12159 1998-10-13 Jeffrey A Law (law@cygnus.com)
12160
12161 * java-tree.def: Add missing newline at EOF.
12162
12163 1998-10-13 Tom Tromey <tromey@cygnus.com>
12164
12165 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
12166 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
12167 function.
12168 Include <config.h> and "system.h".
12169 (disassemble_method): Undefine RET to avoid clash with
12170 config/i386/i386.h.
12171
12172 1998-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
12173
12174 * decl.c (runtime_exception_type_node, error_exception_type_node):
12175 New global variables.
12176 (init_decl_processing): Initialized.
12177 * expr.c (java_lang_expand_expr): Set caught exception type to
12178 null if catch handler argument doesn't exit.
12179 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
12180 tree codes.
12181 * java-tree.h (runtime_exception_type_node,
12182 error_exception_type_node): Global variables declared.
12183 (DECL_FUNCTION_THROWS): New macro.
12184 (DECL_FUNCTION_BODY): Modified comment.
12185 (DECL_SPECIFIC_COUNT): Likewise.
12186 (struct lang_decl): New field throws_list.
12187 (IS_UNCHECKED_EXPRESSION_P): New macro.
12188 * lex.c (java_lex): Generate location information for THROW_TK.
12189 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
12190 EXCEPTIONS_P): New macros.
12191 (enum jdep_code): New value JDEP_EXCEPTION.
12192 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
12193 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
12194 PATCH_METHOD_RETURN_ERROR): New macros.
12195 (patch_method_invocation_stmt): Added new argument to prototype.
12196 (patch_synchronized_statement, patch_throw_statement,
12197 check_thrown_exceptions, check_thrown_exceptions_do,
12198 purge_unchecked_exceptions, check_throws_clauses): New function
12199 prototypes.
12200 * parse.y Fixed typo in keyword section.
12201 (throw:): Rule tagged <node>.
12202 (THROW_TK): Keyword tagged <operator>.
12203 (method_header:): Last argument to call to method_header passed
12204 from throws: rule.
12205 (throws:, class_type_list:, throw_statement:,
12206 synchronized_statement:, synchronized:): Defined actions.
12207 (method_header): New local variable current. Register exceptions
12208 from throws clause.
12209 (java_complete_tree): Complete and verify exceptions from throws
12210 clause.
12211 (complete_class_report_errors): Error message on exceptions not
12212 found
12213 (java_check_regular_methods): Fixed typo. Shortcut on private
12214 overriding methods. Changed error message on method
12215 redefinition. Check for throws clause compatibility.
12216 (check_throws_clauses): New function.
12217 (java_check_abstract_methods): Use DECL_NAME for wfl or current
12218 method. Changed error message on method redefinition.
12219 (currently_caught_type_list): New static variable.
12220 (java_complete_expand_methods): Purge unchecked exceptions from
12221 throws clause list. Call PUSH_EXCEPTIONS before walk and
12222 POP_EXCEPTIONS after.
12223 (resolve_qualified_expression_name): Pass new argument as NULL to
12224 patch_method_invocation_stmt.
12225 (patch_method_invocation_stmt): New argument ref_decl. Invoke
12226 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
12227 argument list when appropriate. Use new argument if non null to
12228 store selected method decl.
12229 (patch_invoke): Convert if necessary args of builtin types before
12230 forming CALL_EXPR. Argument list no longer reversed here.
12231 (invocation_mode): Treat final methods as static methods.
12232 (java_complete_tree): New cases for THROW_EXPR: and
12233 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
12234 function call.
12235 (complete_function_arguments): No more RECORD_TYPE
12236 conversion. Function parameter nodes no longer saved.
12237 (valid_ref_assignconv_cast_p): Avoid handling null type.
12238 (patch_binop): Fixed null constant reference handling.
12239 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
12240 BUILD_THROW macros.
12241 (patch_try_statement): Fixed comments. Record caught types in
12242 list, push the list, expand try block and pop the list.
12243 (patch_synchronized_statement, patch_throw_statement,
12244 check_thrown_exceptions, check_thrown_exceptions_do,
12245 purge_unchecked_exceptions): New functions.
12246 * typeck.c (lookup_argument_method): Allow WFL in place of method
12247 DECL_NAME during method definition check
12248
12249 1998-10-09 Tom Tromey <tromey@cygnus.com>
12250
12251 * gjavah.c (decode_signature_piece): New function.
12252 (print_c_decl): Use it. Added `name_override' argument.
12253 (print_method_info): Use name_override argument to print_c_decl.
12254 (seen_fields): Removed.
12255 (print_field_info): Don't update seen_fields.
12256 (struct method_name): New structure.
12257 (method_name_list): New global.
12258 (print_method_info): Add new method to list of methods.
12259 (name_is_method_p): New function.
12260 (print_field_info): If field name has same name as method, then
12261 change field name.
12262 (process_file): Parse methods before fields.
12263 (field_pass): New global.
12264 (HANDLE_END_FIELD): Take field_pass into account.
12265
12266 1998-10-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
12267
12268 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
12269 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
12270
12271 1998-10-03 Anthony Green <green@cygnus.com>
12272
12273 * jvspec.c: Fix bug in jvgenmain_spec patch.
12274
12275 1998-10-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
12276
12277 * Makefile.in (lang.o:): Install dependency on java-tree.def.
12278 * decl.c (soft_exceptioninfo_call_node): New global variable.
12279 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
12280 takes extra integer argument. soft_exceptioninfo_call_node
12281 initialized.
12282 * except.c (java_set_exception_lang_code): New function
12283 (method_init_exceptions): Called here.
12284 (prepare_eh_table_type): New function.
12285 (expand_end_java_handler): Called here.
12286 * expr.c (build_java_throw_out_of_bounds_exception): Now features
12287 one argument. Modified generation of call to
12288 soft_badarrayindex_node to use new argument.
12289 (build_java_arrayaccess): Pass faulty index value to
12290 build_java_throw_out_of_bounds_exception.
12291 (generate_name): New function.
12292 (java_lang_expand_expr): New local variables node, current,
12293 has_finally_p. Expand TRY_EXPR node.
12294 (process_jvm_instruction): Replace top of the stack with thrown
12295 object reference when entering exception handler.
12296 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
12297 specific tree codes.
12298 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
12299 global.
12300 (DECL_SPECIFIC_COUNT): New macro.
12301 (prepare_eh_table_type, java_set_exception_lang_code,
12302 generate_name): New function declarations.
12303 (match_java_method): Declaration deleted.
12304 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
12305 macros.
12306 * lex.c (TRY_TK, CATCH_TK): Generate location information.
12307 * parse.h (redefinition_error, refine_accessible_methods_list,
12308 can_cast_to_p): Function declaration removed.
12309 (classitf_redefinition_error, variable_redefinition_error,
12310 parse_jdk1_1_error, find_applicable_accessible_methods_list,
12311 find_most_specific_methods_list, argument_types_convertible,
12312 enter_a_block, valid_builtin_assignconv_identity_widening_p,
12313 valid_cast_to_p, valid_method_invocation_conversion_p,
12314 try_reference_assignconv, add_stmt_to_compound,
12315 build_jump_to_finally, build_tree_list, patch_try_statement,
12316 java_get_catch_block): New function declarations.
12317 * parse.y (string_buffer_type): Global variable deleted.
12318 (group_of_labels, catches, catch_clause, catch_clause_parameter,
12319 finally): Rules tagged <node>.
12320 (TRY_TK, CATCH_TK): Token tagged <operator>.
12321 (class_body_declaration:, class_member_declaration:,
12322 formal_parameter:, explicit_constructor_invocation:,
12323 interface_member_declaration:, constant_declaration:,
12324 primary_no_new_array:, class_instance_creation_expression:,
12325 array_creation_expression:): Issue error on unsuported JDK1.1
12326 features.
12327 (try_statement:, catches:, finally:): Define actions.
12328 (catch_clause_parameter): New rule.
12329 (catch_clause:): Use new rule catch_clause_parameter.
12330 (parse_jdk1_1_error): New function.
12331 (redefinition_error): Renamed classitf_redefinition_error.
12332 (variable_redefinition_error): New function.
12333 (check_class_interface_creation): Call
12334 classitf_redefinition_error.
12335 (java_complete_tree): Added error message on JDEP_TYPE: case.
12336 (complete_class_report_errors): Fixed indentation.
12337 (declare_local_variables): Call variable_redefinition_error.
12338 (source_end_java_method): Call java_set_exception_lang_code and
12339 emit_handlers where appropriate.
12340 (java_method_add_stmt): Call add_stmt_to_block.
12341 (add_stmt_to_block): New function.
12342 (lookup_method_invoke): Fixed outside comment. new local variable
12343 candicates. Call find_applicable_accessible_methods_list and
12344 find_most_specific_methods_list when searching for a
12345 method. Modified error report to list possible candidates when
12346 applicable.
12347 (find_applicable_accessible_methods_list,
12348 find_most_specific_methods_list, argument_types_convertible): New
12349 function.
12350 (refine_accessible_methods_list): Function deleted.
12351 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
12352 expr (if applicable) before calling patch_array_ref.
12353 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
12354 (enter_block): Fixed comment.
12355 (enter_a_block): New function.
12356 (patch_assignment): Reorganized. Call try_reference_assignconv for
12357 references. Call valid_cast_to_p instead of can_cast_to_p.
12358 (try_reference_assignconv,
12359 valid_builtin_assignconv_identity_widening_p): New functions.
12360 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
12361 (valid_cast_to_p, valid_method_invocation_conversion_p): New
12362 functions.
12363 (build_string_concatenation): Don't resolve StringBuffer.
12364 (patch_cast): Fixed inverted arguments.
12365 (patch_array_ref): Code to save array expr deleted. Call
12366 valid_cast_to_p instead of can_cast_to_p.
12367 (generate_labeled_block): Call generate_name.
12368 (build_jump_to_finally, build_try_statement, java_get_catch_block,
12369 patch_try_statement): New functions.
12370 * typeck.c (match_java_method): Function deleted.
12371
12372 1998-10-02 Anthony Green <green@cygnus.com>
12373
12374 * jvspec.c: jvgenmain_spec uses different temporary file names.
12375
12376 1998-10-02 Anthony Green <green@cygnus.com>
12377
12378 * jvspec.c (lang_specific_driver): Fail if user specifies
12379 --main= when not linking.
12380
12381 1998-09-28 Tom Tromey <tromey@cygnus.com>
12382
12383 * class.c (make_class_data): Push value for `thread' field.
12384 * decl.c (init_decl_processing): Added `thread' field to class.
12385
12386 * class.c (add_field): Always make static fields externally
12387 visible.
12388
12389 1998-09-26 Anthony Green <green@cygnus.com>
12390
12391 * expr.c (build_java_athrow,
12392 build_java_throw_out_of_bounds_exception, expand_invoke,
12393 build_newarray, expand_java_multianewarray, build_java_monitor):
12394 Update comments to reflect _Jv_* function names.
12395
12396 1998-09-25 Per Bothner <bothner@cygnus.com>
12397
12398 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
12399 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
12400 * parse.y (expand_start_java_method): Likewise.
12401
12402 1998-09-24 Per Bothner <bothner@cygnus.com>
12403
12404 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
12405
12406 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
12407 (add_field): No longer need to convert from RECORD_TYPE to pointer,
12408 * expr.c: Remove no-longer-needed calls to promote_type.
12409 * decl.c (give_name_to_locals): Liekwise.
12410 * jcf-parse.c (get_class_constant): Compensate for new signatures.
12411 * parse.y: Add/remove promote_type calls as appropriate.
12412 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
12413 (parse_signature_string): Likewise.
12414 (build_java_array_type): Fix for now signature convenions.
12415
12416 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
12417
12418 1998-09-23 Tom Tromey <tromey@cygnus.com>
12419
12420 * class.c (init_class_processing): libjava function renamed to
12421 _Jv_RegisterClass.
12422
12423 1998-09-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
12424
12425 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
12426 * java-tree.def: Fixed DEFTREECODE third argument.
12427 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
12428 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
12429 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
12430 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
12431 JAVA_THIS_EXPR): Now replaced by tree code definitions.
12432 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
12433 * lang.c (java_tree_code_type, java_tree_code_length,
12434 java_tree_code_name): New arrays.
12435 (lang_init): Append Java tree node definitions to Gcc ones.
12436 * lex.c (expression_obstack): Declared as extern when JC1_LITE
12437 defined.
12438 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
12439 wfl_to_string.
12440 (java_lex): Allow declaration of empty string constants. Retain
12441 location information on CASE_TK and DEFAULT_TK.
12442 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
12443 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
12444 Modified to be more robust.
12445 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
12446 (build_new_invocation, try_builtin_assignconv,
12447 patch_switch_statement, string_constant_concatenation,
12448 build_string_concatenation, patch_string_cst, patch_string,
12449 java_expand_switch): New function declarations.
12450 * parse.y: Rules related to switch and EH tagged <node>.
12451 (label_id): Set to NULL_TREE
12452 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
12453 tree nodes.
12454 (this_or_super:): Fixed indentation.
12455 (statement:, statement_nsi:, statement_without_trailing_substatement:,
12456 statement_expression:): Removed call to RULE on all sub-rules.
12457 (switch_expression:, switch_labels:): New rules.
12458 (switch_statement:, switch_block:, switch_block_statement_groups:,
12459 switch_block_statement_group:, switch_labels:, switch_label:):
12460 Defined actions.
12461 (throw_statement:, synchronized_statement:, try_statement:):
12462 Defined temporary actions.
12463 (class_instance_creation_expression:): Call
12464 build_new_invocation. Fixed indentation.
12465 (field_access): Fixed indentation.
12466 (method_invocation): Likewise.
12467 (make_qualified_primary): Use THIS_EXPR.
12468 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
12469 resolving from SUPER, set *type_found.
12470 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
12471 (java_complete_tree): Removed unused local variable `location'. Case
12472 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
12473 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
12474 on MODIFY_EXPR: and all binary operator tree code cases. Removed
12475 STRING_CST: case. default: checks for patchable strings.
12476 (complete_function_arguments): Transform string constant or
12477 crafted StringBuffer if necessary.
12478 (build_method_invocation): Fixed comments.
12479 (build_new_invocation): New function.
12480 (patch_assignment): Call try_builtin_assignconv to figure a valid
12481 assignment conversion between builtin types.
12482 (try_builtin_assignconv): New function.
12483 (build_binop): Use URSHIFT_EXPR directly to call build.
12484 (operator_string): Use UNARY_PLUS_EXPR.
12485 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
12486 operator.
12487 (do_merge_string_cste, merge_string_cste,
12488 string_constant_concatenation, build_string_concatenation,
12489 patch_string, patch_string_cst): New function.
12490 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
12491 (patch_unaryop): Likewise. New test of valid ++/-- operands.
12492 (build_newarray_node): Use NEW_ARRAY_EXPR.
12493 (build_this): Use THIS_EXPR.
12494 (build_return): Enable debug information on return statement.
12495 (build_if_else_statement): Likewise.
12496 (complete_labeled_statement): Fixed related comment.
12497 (build_loop_body): Fixed comment.
12498 (build_bc_statement): Enable debug information on break/continue
12499 statements.
12500 (patch_bc_statement): Fixed typos. Handle SWITCH statement
12501 context.
12502 (patch_switch_statement, case_identity, java_expand_switch): New
12503 functions.
12504
12505 1998-09-21 Per Bothner <bothner@cygnus.com>
12506
12507 * buffer.h (BUFFER_INIT): New macro.
12508 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
12509 Pass (struct jcf_partial *state) to most functions.
12510 (jcf_block, jcf_relocation): New types.
12511 Support labels, branches, conditionals, loops.
12512
12513 1998-09-21 Tom Tromey <tromey@cygnus.com>
12514
12515 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
12516
12517 1998-09-21 Per Bothner <bothner@cygnus.com>
12518
12519 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
12520 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
12521 not integer_type_node (INT_TYPE_SIZ bits).
12522
12523 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
12524
12525 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
12526 * jcf-dump.c (print_exception_table): New function.
12527 (disassemble_method): Better handling of wide instructions.
12528 Make more robust for bad input.
12529
12530 1998-09-30 Jeffrey A Law (law@cygnus.com)
12531
12532 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
12533 FreeBSD.
12534
12535 1998-09-17 Jeffrey A Law (law@cygnus.com)
12536
12537 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
12538
12539 1998-09-17 Tom Tromey <tromey@cygnus.com>
12540
12541 * Makefile.in ($(PARSE_H)): Removed target.
12542
12543 1998-09-17 Jeffrey A Law (law@cygnus.com)
12544
12545 * Makefile.in (JAVA_OBJS): Add memmove.o
12546 (memmove.o): New target & rules.
12547
12548 1998-09-15 Tom Tromey <tromey@cygnus.com>
12549
12550 * expr.c (expand_invoke): Don't generate a call to the class init
12551 code.
12552
12553 1998-09-14 Jeffrey A Law (law@cygnus.com)
12554
12555 * Makefile.in: Add many missing dependencies.
12556 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
12557 as appropriate.
12558 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
12559 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
12560
12561 1998-09-11 Per Bothner <bothner@cygnus.com>
12562
12563 * decl.c (complete_start_java_method): If method is static (and
12564 not private) call _Jv_InitClass.
12565 * expr.c (expand_invoke): Don't call build_class_init.
12566
12567 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
12568
12569 1998-09-10 Jeffrey A Law (law@cygnus.com)
12570
12571 * Make-lang.in (GCJ): Define before using.
12572
12573 1998-09-09 Jeffrey A Law (law@cygnus.com)
12574
12575 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
12576 losing due to namespace pollution in GNU getopt.h
12577
12578 1998-09-09 Tom Tromey <tromey@cygnus.com>
12579
12580 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
12581 (java.all.cross): Likewise.
12582 (java.rest.encap): Likewise.
12583
12584 1998-09-08 Jeffrey A Law (law@cygnus.com)
12585
12586 * gjavah.c (print_class_decls): Fix thinko in arglist
12587 * jcv-io.c (find_classfile): Similarly.
12588
12589 1998-09-07 Jeffrey A Law (law@cygnus.com)
12590
12591 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
12592
12593 1998-09-05 Tom Tromey <tromey@cygnus.com>
12594
12595 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
12596 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
12597 * Makefile.in (PARSE_C): New macro.
12598 (PARSE_H): Likewise.
12599 (PARSE_SCAN_C): Likewise.
12600 ($(PARSE_C)): Target renamed from parse.c.
12601 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
12602 (clean): Remove parse-scan.c as well.
12603 (parse.o): Depend on $(PARSE_C).
12604
12605 1998-09-05 Anthony Green <green@cygnus.com>
12606
12607 * README, license.terms: Removed.
12608
12609 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
12610 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
12611 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
12612 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
12613 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
12614 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
12615 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
12616 and Java trademark attribution.
12617
12618 1998-09-04 Tom Tromey <tromey@cygnus.com>
12619
12620 * Makefile.in: Use gcjh, not gjavah.
12621 * config-lang.in (stagestuff): Use gcjh, not gjavah.
12622 * Make-lang.in: Changed gjavah to gcjh everywhere.
12623
12624 1998-09-03 Per Bothner <bothner@cygnus.com>
12625
12626 * gjavah.c: Support new -prepend -add -append flags.
12627 (print_method_info): Method is not virtual if class is final.
12628
12629 1998-09-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
12630
12631 * jv-scan.c: Fixed copyright assignment.
12632 * keyword.gperf: Likewise.
12633 * keyword.h: Likewise.
12634 * lex.c: Fixed copyright assignment.
12635 (java_lex): Push unicode back when parsing '<'.
12636 * lex.h: Fixed copyright assignment.
12637 * parse-scan.y: Likewise.
12638 * parse.h: Fixed copyright assignment.
12639 (build_debugable_stmt, complete_for_loop): New function prototypes.
12640 * parse.y: Fixed copyright assignment.
12641 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
12642 size_zero_node when completing a loop with no exit condition.
12643 (for_statement_nsi:): Define action.
12644 (for_init:, for_update:): Return size_zero_node when empty.
12645 (declare_local_variables): Call build_debugable_stmt.
12646 (build_debugable_stmt): New function.
12647 (build_loop_body): Build debugable statement around loop
12648 condition part.
12649 (complete_loop_body): Take into account the debugable statement
12650 around the EXIT_EXPR.
12651 (complete_loop_body): New function.
12652 (patch_exit_expr): Fixed condition inversion.
12653
12654 1998-09-02 Tom Tromey <tromey@cygnus.com>
12655
12656 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
12657 name of thread define.
12658 * jvspec.c (THREAD_NAME): New macro.
12659 (GCLIB): Likewise.
12660 (THREADLIB): Likewise.
12661 (lang_specific_driver): Recognize attempt to link with thread
12662 library or gc library. Recognize -ljava on command line so it
12663 isn't linked against more than once.
12664
12665 1998-09-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
12666
12667 * parse-scan.y (report_main_declaration): Name of the class
12668 containing `main' can be a qualified name.
12669
12670 1998-08-31 Tom Tromey <tromey@cygnus.com>
12671
12672 * config-lang.in: Changed gjavac to gjc everywhere.
12673 * Make-lang.in: Changed gjavac to gjc everywhere.
12674
12675 1998-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
12676
12677 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
12678 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
12679 and install the files.
12680 * Makefile.in (JAVA_OBJS_LITE): New variable.
12681 (compiler:): Now include jv-scan as a dependency.
12682 (../jv-scan$(exeext), parse-scan.c): New targets.
12683 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
12684 * config-lang.in (compilers): Removed gcj, gjavah from the list.
12685 * jcf-parse.c (parse_source_file): Call java_layout_classes and
12686 check for errors even if parse_only.
12687 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
12688 defined.
12689 (yylex): New function. Uses java_lex body.
12690 (java_lex): Removed commented out statement. Remove local variable
12691 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
12692 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
12693 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
12694 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
12695 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
12696 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
12697 where appropriate.
12698 (java_lex_error): Empty if JC1_LITE is defined.
12699 (java_get_line_col): Return 0 if JC1_LITE is defined.
12700 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
12701 SET_MODIFIER_CTX): Moved into the section containing the macros
12702 conditionally defined by JC1_LITE.
12703 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
12704 argument if JC1_LITE is defined.
12705 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
12706 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
12707 is defined.
12708 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
12709 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
12710 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
12711 to different values according to JC1_LITE.
12712 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
12713 declared if JC1_LITE set.
12714 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
12715 defined if JC1_LITE not set.
12716 (struct parser_ctx): Reorganized and skip the jc1 front end part
12717 if JC1_LITE set.
12718 (java_layout_classes): New function definition.
12719 (java_push_parser_context, java_init_lex, yyparse, yylex,
12720 yyerror): Prototype always declared. All other static function
12721 prototypes declared only if JC1_LITE is not set.
12722 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
12723 declared in parse.h.
12724 (java_layout_classes): New function.
12725 (java_complete_expand_methods): No longer layout the class here.
12726 * parse-scan.y: New file.
12727 * jv-scan.c: New file.
12728
12729 1998-08-25 Tom Tromey <tromey@cygnus.com>
12730
12731 * gjavah.c (main): Handle -friend option.
12732 (friend_specs): New global.
12733 (generate_access): Handle friend_specs.
12734 (process_file): Likewise.
12735 (MAX_FRIENDS): New macro.
12736 (friend_count): New global.
12737 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
12738 Changed all callers.
12739
12740 1998-08-24 Per Bothner <bothner@cygnus.com>
12741
12742 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
12743 (main): Handle processing all the entries of a named .zip archive.
12744 * jcf-io.c (jcf_trim_old_input): New function.
12745 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
12746
12747 1998-08-24 Per Bothner <bothner@cygnus.com>
12748
12749 * lang.c (flag_assume_compiled): Make default be on.
12750
12751 1998-08-21 Per Bothner <bothner@cygnus.com>
12752
12753 * jcf-dump.c: Add bunches of flags to control output more.
12754 (process_class): New function; support printing more than one class.
12755 (main): Support new --print-main and --javap flags.
12756 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
12757 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
12758
12759 1998-08-20 Per Bothner <bothner@cygnus.com>
12760
12761 Change mangling of dispatch table to match C++ vtable (w/thunks).
12762 * class.c (build_dtable_decl), java-tree.h: New function.
12763 (make_class_data): Call it.
12764 * decl.c (init_decl_processing): Likewise.
12765
12766 1998-08-19 Warren Levy <warrenl@cygnus.com>
12767
12768 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
12769 soft_anewarray; adjust args passed.
12770 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
12771 match _Jv_NewObjectArray.
12772
12773 1998-08-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
12774
12775 * decl.c (push_labeled_block, pop_labeled_block): New functions.
12776 * expr.c (loopup_label): Call create_label_decl.
12777 (create_label_decl): New function.
12778 (java_lang_expand_expr): Call expand_start_bindings with argument
12779 set to zero.
12780 * java-tree.h Added space after PROTO in function declarations
12781 when necessary.
12782 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
12783 (create_label_decl, push_labeled_block): New function
12784 declarations.
12785 * lex.c (label_id): Initialize.
12786 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
12787 switch.
12788 * parse.h Added space after PROTO in function declarations when
12789 necessary.
12790 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
12791 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
12792 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
12793 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
12794 macros.
12795 (struct parser_ctxt): New fields current_loop,
12796 current_labeled_block.
12797 (build_if_else_statement, patch_if_else_statement,
12798 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
12799 generate_labeled_block, complete_labeled_statement,
12800 build_bc_statement, patch_bc_statement, patch_loop_statement,
12801 build_new_loop, build_loop_body, complete_loop_body): New function
12802 declarations.
12803 * parse.y (java_warning_count): New global variable.
12804 (label_id): New static variable.
12805 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
12806 (block:): Return size_zero_node when block is empty.
12807 (empty_statement:): Return size_zero_node.
12808 (statement:): Implement supplemental action when for_statement: is
12809 reduced.
12810 (label_decl:): New rule.
12811 (labeled_statement:): Rewritten using label_decl. Actions
12812 implemented.
12813 (labeled_statement_nsi:): Likewise.
12814 (if_then_statement): Actions implemented.
12815 (while_expression): New rule.
12816 (while_statement:): Rewritten using while_expression. Actions
12817 implemented.
12818 (while_statement_nsi:): Likewise.
12819 (do_statement_begin:): New rule.
12820 (do_statement:): Rewritten using do_statement_begin. Actions
12821 implemented.
12822 (for_statement:): Rewritten using for_begin. Actions implemented.
12823 (for_statement_nsi:): Likewise.
12824 (for_header:, for_begin:): New rules.
12825 (for_init:): Actions implemented.
12826 (statement_expression_list:, break_statement:,
12827 continue_statement:): Likewise.
12828 (yyerror): Count number of issued warning(s).
12829 (java_report_errors): Report error(s) and/or warning(s).
12830 (java_complete_class): Use build_java_argument_signature to
12831 recompute completed method signature.
12832 (java_check_regular_methods): New locals method_wfl and aflags.
12833 Use method_wfl instead of lookup_cl during error reports. Fixed
12834 indentation and modified some error messages. Use
12835 lang_printable_name in method instead of the DECL_NAME. New code
12836 to issue warnings on methods not overriding corresponding methods
12837 private to a different package.
12838 (java_method_add_stmt): Call add_stmt_to_compound.
12839 (add_stmt_to_compound): New function.
12840 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
12841 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
12842 (build_if_else_statement, patch_if_else_statement,
12843 build_labeled_block, generate_labeled_block,
12844 complete_labeled_statement, build_new_loop, build_loop_body,
12845 complete_loop_body, patch_loop_statement, build_bc_statement,
12846 patch_bc_statement, patch_exit_expr): New functions.
12847 * typeck.c (build_java_signature): Build argument signature before
12848 enclosing it in between parenthesis.
12849
12850 1998-08-17 Warren Levy <warrenl@cygnus.com>
12851
12852 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
12853 (JAVA_OBJS): Added reminder comment
12854
12855 1998-08-13 Nick Clifton <nickc@cygnus.com>
12856
12857 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
12858 be interpreted as a long long.
12859
12860 1998-08-13 Warren Levy <warrenl@cygnus.com>
12861
12862 * decl.c (init_decl_processing): Use _Jv_InitClass, not
12863 soft_initialise_class. Use _Jv_NewMultiArray, not
12864 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
12865 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
12866 _Jv_CheckArrayStore, not soft_checkarraystore. Use
12867 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
12868
12869 1998-08-12 Per Bothner <bothner@cygnus.com>
12870
12871 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
12872 length_identifier_node): New global tree node constants.
12873 * parse.y (kw_super, kw_this, kw_length): Removed globals.
12874 Replace uses by super_identifier_node etc.
12875 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
12876
12877 * parse.y (resolve_field_access): Don't special-case ".length" if
12878 flag_emit_class_files.
12879 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
12880 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
12881 and ARRAY.length.
12882
12883 1998-08-11 Per Bothner <bothner@cygnus.com>
12884
12885 * decl.c (init_decl_processing): Remove unused method_type_node fields.
12886 * class.c (make_method_value): Remove init for removed fields.
12887
12888 * class.c (layout_class): Use build_java_argument_signature.
12889 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
12890
12891 * typeck.c (push_java_argument_signature): Removed. Merged into ...
12892 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
12893 (build_java_signature): Don't use push_java_argument_signature.
12894
12895 * typeck.c (lookup_argument_method): New function.
12896 * parse.y (java_check_regular_methods): Use lookup_argument_method
12897 instead of lookup_java_method2 followed by lookup_java_method.
12898
12899 * parse.y (check_method_redefinition): Minor optimization.
12900
12901 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
12902 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
12903
12904 1998-08-10 Tom Tromey <tromey@cygnus.com>
12905
12906 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
12907 c-pragma.o.
12908
12909 * gjavah.c (java_float_finite): Use K&R-style definition.
12910 (java_double_finite): Likewise.
12911 (generate_access): Now returns void. Changed all callers.
12912 (last_access_generated): Removed.
12913 (process_file): Only make a single pass over the .class file.
12914
12915 1998-07-29 Per Bothner <bothner@cygnus.com>
12916
12917 * class.c (get_dispatch_table): Add extra dummy vtable entry,
12918 for compatibility for G++ (with -fvtable-thunks).
12919 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
12920
12921 * gjavah.c (process_file): Use public inheritance for super-class.
12922
12923 1998-07-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
12924
12925 * lex.c (java_init_lex): Initialize ctxp->package.
12926 * parse.h (struct parser_ctxt): package and package_len replaced
12927 by tree package, an identifier node. Field method_decl_list is
12928 gone. Fixed comments.
12929 (lookup_field_wrapper, merge_qualified_name, not_accessible,
12930 class_in_current_package): New function prototypes.
12931 * parse.y (array_type:): Set class loaded flag on primitive type
12932 arrays.
12933 (package_declaration:): Assign ctxp->package to the
12934 identifier node.
12935 (method_invocation:): Handle invocation of method qualified by
12936 `super'.
12937 (single_type_import_declaration:): Removed ambiguity check.
12938 (java_pop_parser_context): New local variable `next'. Reset and
12939 set IMPORT_CLASSFILE_NAME flags on current and previous import
12940 list.
12941 (java_accstring_lookup): Use new local macro COPY_RETURN.
12942 (lookup_field_wrapper): New function.
12943 (parser_qualified_classname): Use merge_qualified_name.
12944 (parser_check_super_interface): Broaden error message.
12945 (do_resolve_class): Check for qualified class name in the current
12946 compilation unit if appropriate.
12947 (process_imports): Check for already defined classes.
12948 (check_pkg_class_access): Got rid of call to
12949 get_access_flags_from_decl.
12950 (java_complete_expand_methods): Call safe_layout_class based on
12951 the current class size.
12952 (make_qualified_primary): Build a WFL qualification on primary if
12953 none exists.
12954 (merge_qualified_name): New function.
12955 (make_qualified_name): Use merge_qualified_name.
12956 (resolve_expression_name): Use safe_lookup_field.
12957 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
12958 (resolve_qualified_expression_name): Likewise. Check on resolved
12959 element accessibility.
12960 (not_accessible_p, class_in_current_package): New functions.
12961 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
12962 (patch_method_invocation_stmt): Merged common pieces. Check
12963 accessibility of invoked method.
12964 (check_for_static_method_reference): Add returned type in error
12965 message.
12966 (invocation_mode): Get rid of bogus check on PRIVATE methods.
12967 (refine_accessible_methods_list): Merged two conditions in test.
12968 (java_complete_class): Sanity check on stabilize_ref gone.
12969 * zextract.c (read_zip_archive): Cast lseek second argument to long.
12970
12971 1998-07-28 Per Bothner <bothner@cygnus.com>
12972
12973 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
12974
12975 1998-07-24 Tom Tromey <tromey@cygnus.com>
12976
12977 * gjavah.c (F_NAN): Removed.
12978 (F_NAN_MASK): New macro.
12979 (F_POSITIVE_INFINITY): Removed.
12980 (F_NEGATIVE_INFINITY): Likewise.
12981 (java_float_finite): Rewrote.
12982 (D_NAN_MASK): Renamed.
12983 (java_double_finite): Rewrote.
12984 (D_POSITIVE_INFINITY): Removed.
12985 (D_NEGATIVE_INFINITY): Likewise.
12986
12987 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
12988 If verbose, print underlying representation of value in hex.
12989
12990 1998-07-24 Per Bothner <bothner@cygnus.com>
12991
12992 * buffer.h, buffer.c: New files.
12993 * Makefile.in (JAVA_OBJS): Add buffer.o.
12994
12995 Support locals variables and writing their debug entries to .class.
12996 * jcf-write.c: Simplify some by user new buffer type.
12997 (vode_buffer_grow): Removed.
12998 (struct localvar_info): New type.
12999 (localsvars, localvartable): New buffers.
13000 (localvar_alloc, localvar_free): New functions.
13001 (generate_bytecode_insns): Handle local variables.
13002 (generate_classfile): Write LocalVariableTable attribute.
13003
13004 1998-07-24 Alexandre Petit-Bianco <apbianco@cygnus.com>
13005
13006 * jcf-io.c (open_in_zip): Check the zipfile magic number.
13007 * zipfile.h (ZIPMAGIC): New macro.
13008
13009 1998-07-24 Tom Tromey <tromey@cygnus.com>
13010
13011 * Makefile.in (gjavah.o): Updated dependencies.
13012 (jcf-dump.o): Likewise.
13013 (all.indirect): Use ../gjavah.
13014 (../gjavah$(exeext)): Likewise.
13015 (clean): Don't remove gjavah.
13016 (clean): Remove parse.c, not java/parse.c.
13017 * Make-lang.in (java): Added gjavah.
13018 (gjavah$(exeext)): New target.
13019 (GJAVAH_SOURCES): New macro.
13020 (java.all.build): Added gjavah.
13021 (java.all.cross): Likewise.
13022 (java.rest.encap): Likewise.
13023 * config-lang.in (compilers, stagestuff): Added gjavah.
13024
13025 1998-07-23 Tom Tromey <tromey@cygnus.com>
13026
13027 * gjavah.c (java_float_finite): New function.
13028 (java_double_finite): Likewise.
13029 (F_POSITIVE_INFINITY): New macro.
13030 (F_NEGATIVE_INFINITY): Likewise.
13031 (F_NAN): Likewise.
13032 (D_POSITIVE_INFINITY): Likewise.
13033 (D_NEGATIVE_INFINITY): Likewise.
13034 (D_NAN): Likewise.
13035 (print_field_info): Use java_float_finite and java_double_finite.
13036
13037 1998-07-23 Per Bothner <bothner@cygnus.com>
13038
13039 * parse.y (method_header): Name "this" implicit argument.
13040
13041 1998-07-22 Per Bothner <bothner@cygnus.com>
13042
13043 * jcf-write.c: Write out LineNumberTable attribute in .class file.
13044 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
13045 (put_linenumber): New function.
13046 (generate_bytecode_insns, generate_classfile): Write line numbers.
13047
13048 1998-07-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
13049
13050 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
13051 (lookup_name, build_known_method_ref, build_class_init,
13052 build_invokevirtual, invoke_build_dtable, match_java_method,
13053 build_field_ref, pushdecl_force_head, build_java_binop,
13054 binary_numeric_promotion, build_decl_no_layout,
13055 build_java_arrayaccess, build_newarray, build_anewarray,
13056 build_java_array_length_access, build_java_arraynull_check): New
13057 extern function prototypes.
13058 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
13059 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
13060 java-tree.h.
13061 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
13062 to NULL
13063 * jcf.h (jcf_out_of_synch): New extern function prototype.
13064 * parse.h: Static/global function implemented in parse.y
13065 prototyped and declarations moved at the end of the file.
13066 (DECL_P): Check that the argument isn't null.
13067 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
13068 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
13069 (QUAL_DECL_TYPE): New macro.
13070 (PARAMS): Macro definition removed.
13071 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
13072 (return_statement:): Call build_return.
13073 (field_access:): Call make_qualified_primary in sub rule.
13074 (method_invocation:): Build method invocation and call
13075 make_qualified_primary when processing primaries.
13076 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
13077 get_type_from_signature.
13078 (java_check_regular_method): Extra integer 0 argument when calling
13079 lookup_java_method2.
13080 (lookup_java_interface_method2): Extra method DECL argument when
13081 calling lookup_java_interface_method2.
13082 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
13083 COMPOUND_EXPR node.
13084 (java_complete_expand_method): Layout current class iff not
13085 already done. Don't process interface's methods.
13086 (java_complete_expand_method): Use super class only if it
13087 exists. Use current class otherwise.
13088 (make_qualified_primary): New function.
13089 (resolve_expression_name): Process qualified expression or
13090 expression from primary the same way.
13091 (resolve_expression_name): Two last arguments to
13092 resolve_field_access are now NULL_TREEs.
13093 (resolve_field_access): New variable is_static. Local field must
13094 be DECLs. is_static computed on field DECLs only. Append code in
13095 where_found to the field access if necessary. Use QUAL_DECL_TYPE
13096 to initialize field_type.
13097 (resolve_qualified_expression_name): New local variable,
13098 previous_call_static and is_static. Handle primaries with function
13099 calls, casts, array references and `this'. `super' now handled as
13100 `(super_class)this'. Use is_static to clarify boolean expressions.
13101 Added code to handle case where a proper handle is required to
13102 access a field. Use QUAL_DECL_TYPE where applicable.
13103 (maybe_access_field): New function.
13104 (patch_method_invocation_stmt): New arguments primary, where,
13105 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
13106 deleted. Use `where' as a type to search from if specified. Check
13107 for static method reference where forbidden. Append primary or
13108 current_this to the argument list if not calling constructor nor
13109 static methods.
13110 (check_for_static_method_reference): New function.
13111 (patch_invoke): Layout the class on which new is done if
13112 necessary.
13113 (lookup_method_invoke): Changed format to report errors on
13114 methods.
13115 (qualify_ambiguous_name): New local variable this_found. Now
13116 handle things from primaries. Method call are considered
13117 expression names.
13118 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
13119 changed into NULLs.
13120 (not_initialized_as_it_should_p): Comply with the new DECL_P.
13121 (java_complete_tree): New case fo RETURN_EXPR. Process function
13122 call arguments in separate function.
13123 (complete_function_arguments): New function.
13124 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
13125 anymore.
13126 (patch_assignment): Take the return function slot into account as
13127 a RHS. Distinguish assignment from a return.
13128 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
13129 when checking methods in interfaces.
13130 (resolve_type_during_patch): NULL argument to unresolve_type_p
13131 instead of NULL_TREE.
13132 (patch_newarray): Fixed typo in comment.
13133 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
13134 (build_return, patch_return): New functions.
13135 * typeck.c (lookup_java_constructor): Fixed typo in comment.
13136
13137 1998-07-21 Per Bothner <bothner@cygnus.com>
13138
13139 * constants.c (find_name_and_type_constant, find_fieldref_index,
13140 find_methodref_index): New methods.
13141 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
13142 just return given method. Also, rename to build_known_method_ref.
13143 (expand_invoke): Rename call to build_invoke_non_interface.
13144 * java-tree.h, parse.h: Update prototype.
13145 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
13146 (such as expand_expr_stmt) if flag_emit_class_files.
13147 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
13148 STACK_TARGET, IGNORE_TARGET): New macros.
13149 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
13150 (generate_bytecode_insn): New function to generate method's bytecode.
13151 (generate_classfile): Node generate Code attribute for a method.
13152 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
13153 push_long_const, field_op, adjust_typed_op, maybe_wide):
13154 New functions used by generate_bytecode_insn.
13155
13156 * typeck.c (signature_include_return): Remove variable.
13157 (push_java_argument_signature, build_java_argument_signature): New.
13158 (build_java_signature): Use push_java_argument_signature.
13159 * parse.y: Use build_java_argument_signature instead of fiddling
13160 with signature_include_return.
13161
13162 1998-07-17 Tom Tromey <tromey@cygnus.com>
13163
13164 * gjavah.c (print_c_decl): Always generate JArray<>* for array
13165 types.
13166
13167 * Makefile.in (all.indirect): Added gjavah$(exeext).
13168 (gjavah$(exeext)): Added $(exeext).
13169 (clean): Likewise.
13170
13171 1998-07-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
13172
13173 * class.c (layout_class): Call to java_layout_parsed_class replace
13174 by safe_layout_class.
13175 * expr.c (build_java_array_length_access): Removed static storage
13176 class in the function definition.
13177 (build_java_arraynull_check): Likewise.
13178 Also fixed typos in two comments.
13179 * lex.c (java_init_lex): Initialize static global kw_length.
13180 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
13181 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
13182 java_lex_error.
13183 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
13184 * parse.h (resolve_no_layout): New static function declaration.
13185 (get_identifier_in_static): Declaration removed.
13186 (java_layout_parsed_class): Function name declaration changed to
13187 safe_layout_class.
13188 (build_newarray_node, patch_newarray, resolve_type_during_patch,
13189 not_initialized_as_it_should_p, build_this): New static function
13190 declarations.
13191 (pushdecl_force_head, build_java_binop, int_fits_type_p,
13192 binary_numeric_promotion, stabilize_reference,
13193 build_decl_no_layout, build_java_arrayaccess): Extern function
13194 declarations moved into their own section.
13195 (build_newarray, build_anewarray, build_java_array_length_access,
13196 build_java_arraynull_check): New extern function declarations.
13197 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
13198 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
13199 fake tree codes.
13200 (CALL_CONSTRUCTOR_P): New macro.
13201 * parse.y (kw_length): New static global tree node.
13202 (return_statement): Tagged <node>.
13203 (RETURN_TK): Tagged <operator>.
13204 (variable_declarator_id:): Build variable declaration with an
13205 empty initialization value if a syntax error was found in the
13206 initialization part of the variable declaration.
13207 (statement_without_trailing_substatement:): return_statement: now
13208 uses the default rule.
13209 (return_statement:): Temporarily fixed to return NULL_TREE.
13210 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
13211 (class_instance_creation_expression:): Class creation rules now
13212 call build_method_invocation upon reduction.
13213 (array_creation_expression:): Rules call build_newarray_node upon
13214 reduction.
13215 (dim_exprs:): Build a list of dimension expressions.
13216 (dim_expr:): Store location of the OSB_TK in the dimension
13217 expression node.
13218 (method_invocation:): Added a new error rule.
13219 (build_unresolved_array_type): WFL argument may also be an array
13220 on a primitive type. Name of the argument changed to reflect this.
13221 (method_declarator): Insert argument type at the beginning of the
13222 argument type list and later reverse the list.
13223 (unresolved_type_p): Argument 'returned' may be optionally
13224 NULL_TREE.
13225 (java_layout_class_from_source): Function renamed
13226 safe_layout_class.
13227 (resolve_and_layout): Now call resolve_no_layout and
13228 safe_layout_class.
13229 (resolve_no_layout): New function.
13230 (purify_type_name): New function.
13231 (complete_class_report_errors): Call purify_type_name during error
13232 report on a type not found.
13233 (process_imports): error_found local variable doesn't need to be
13234 initialized to zero.
13235 (declare_local_variables): New local type_wfl. Fixed typo in error
13236 message. type_wfl assigned to unresolved type and used to register
13237 incomplete type. Build a WFL around the variable initialization
13238 statement so that debug info can be generated on it.
13239 (source_start_java_method): Reverse argument list after they've
13240 been processed.
13241 (current_this): New static global variable.
13242 (java_complete_expand_methods): Set current_this when appropriate.
13243 (resolve_expression_name): Build correct static and non static
13244 field access bearing a simple name.
13245 (resolve_field_access): Resolve the length field of arrays. Handle
13246 f.m() cases.
13247 (patch_method_invocation_stmt): Set the type of the method
13248 invocation to error_mark_node. This value is later overridden by a
13249 valid type, if any. Don't handle qualified constructor invocation
13250 as qualified method invocation. Call lookup_method_invoke with its
13251 new flag. It's no longer necessary to access the selected method
13252 as the value of a tree list. Handle constructor invocation.
13253 (patch_invoke): Reverse argument list when invoking non interface
13254 methods. Insert call to new as the first argument of the
13255 constructor.
13256 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
13257 defined within a final class. Return INVOKE_STATIC if the invoked
13258 method is a constructor.
13259 (lookup_method_invoke): New lc argument is a flag to indicate a
13260 constructor lookup. Now handle constructor lookup. Choose the most
13261 specific method in case several were matching the invocation
13262 requirements. Return a method decl instead of a tree list featuring
13263 one single method decl element.
13264 (refine_accessible_methods_list): New lc flag argument to
13265 indicate that a constructor is being looked up.
13266 (not_initialized_as_it_should_p): New function.
13267 (java_complete_tree): Now process fake tree codes
13268 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
13269 save_expr on resolved function call arguments. Case on
13270 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
13271 (patch_assignment): LHS can be a field access expression. When
13272 dealing with reference, lhs_type is the promoted type of the
13273 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
13274 applicable.
13275 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
13276 (patch_binop): Use not_initialized_as_it_should_p where
13277 applicable.
13278 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
13279 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
13280 where applicable.
13281 (resolve_type_during_patch): New function.
13282 (patch_cast): Call resolve_type_during_patch to resolve type and
13283 report error accordingly.
13284 (patch_array_ref): Use not_initialized_as_it_should_p where
13285 applicable. Array base expression is saved before being
13286 used. Promote the type of an array elements if it contains non
13287 builtin types.
13288 (build_newarray_node, patch_newarray, build_this): New functions.
13289
13290 1998-07-16 Tom Tromey <tromey@cygnus.com>
13291
13292 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
13293 increment it in `for' statement.
13294 (print_field_info): If number is inf or nan, don't print it.
13295 (print_method_info): If method name is `delete', just ignore it.
13296 (print_c_decl): Special-case jstringArray.
13297
13298 * gjavah.c (help): New function.
13299 (no_argument): New function.
13300 (usage): Changed text.
13301 (main): Rewrote argument handling. Now handles -v, --help,
13302 --version.
13303 (version): New function.
13304 (found_error): New global.
13305 (main): Return found_error.
13306 (generate_access): Set found_error.
13307 (print_c_decl): Likewise.
13308
13309 1998-07-15 Tom Tromey <tromey@cygnus.com>
13310
13311 * gjavah.c (print_c_decl): Don't print "," when examining field.
13312 Skip type name when looking at "[L" types.
13313 (process_file): Now static.
13314 (generate_access): Now returns int.
13315 (last_access_generated): New global.
13316 (process_file): Clear last_access_generated; make multiple passes
13317 over the class.
13318 (print_field_info): Just return if generate_access returns true.
13319 (print_method_info): Likewise. Also, allow <init> functions to
13320 pass through.
13321 (print_c_decl): Added is_init argument. Print constructors
13322 properly.
13323 (print_cxx_classname): Use UTF8_GET to extract characters from
13324 string.
13325 (print_base_classname): New function.
13326 (print_class_decls): New function.
13327 (process_file): Use it.
13328 (utf8_cmp): New function.
13329
13330 1998-07-13 Nick Clifton <nickc@cygnus.com>
13331
13332 * lang-options.h: Format changed to match changes in gcc/toplev.c
13333 to implement a --help option.
13334
13335 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
13336
13337 * decl.c (init_decl_processing): Revert change to dtable_type.
13338
13339 1998-07-09 Per Bothner <bothner@cygnus.com>
13340
13341 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
13342
13343 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
13344
13345 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
13346
13347 * lang.c (lang_init): Default flag_exceptions to 1, without
13348 checking to see if it's 2 first.
13349
13350 1998-07-08 Jeffrey A Law (law@cygnus.com)
13351
13352 * constants.c: Include "system.h".
13353 * decl.c: Likewise.
13354 * lang.c (flag_new_exceptions): Get via extern now.
13355 (lang_init_options): New functions. Turn on flag_new_exceptions.
13356
13357 1998-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
13358
13359 * lex.c (java_lex): Return 0 when we see an invalid character in
13360 the input.
13361
13362 * lex.c (java_read_char): Specify extra argument when calling
13363 java_lex_error.
13364 (java_read_unicode, java_parse_end_comment,
13365 java_parse_escape_sequence): Likewise,
13366 (java_lex): Specify extra argument when calling
13367 java_lex_error. Test that IDs are beginning with a legal character
13368 for IDs. Handle invalid characters with an error message and a
13369 call to java_lex_error.
13370 (java_lex_error): Adjust column position by new argument
13371 `forward'. Issue an error even if in the middle of reporting an
13372 other error.
13373
13374 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
13375
13376 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
13377 we don't explicitly put a null pointer when we're copying it.
13378
13379 1998-07-07 Tom Tromey <tromey@cygnus.com>
13380
13381 * gjavah.c (print_cxx_classname): New function.
13382 (super_class_name): Likewise.
13383 (print_super_fields): Removed.
13384 (in_super): Removed.
13385 (print_field_info): Never generate #defines.
13386 (print_c_decl): Changed generated types to match JNI. No longer
13387 print class name before method name.
13388 (print_method_info): Print "static" before static methods.
13389 Print "virtual" before non-final methods.
13390 (usage): Use exit(1), not exit(-1).
13391 (main): Likewise.
13392 (print_field_info): Use %.17g to print a double.
13393 (last_access): New globals.
13394 (process_file): Initialize last_access.
13395 (usage): Now static.
13396 (ACC_VISIBILITY): New define.
13397 (generate_access): New function.
13398 (print_field_info): Call it.
13399 (print_method_info): Likewise. Also, generate information for all
13400 methods, not just native methods. Return void.
13401 (print_c_decl): Return void.
13402 (print_field_info): Return void.
13403
13404 1998-07-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
13405
13406 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
13407 processing the jc1 grammar file. Prefix bison functions and
13408 variables with java_.
13409 (parse.c): Dependencies on parse.h and lex.h
13410 * expr.c (build_java_arrayaccess): Function now global.
13411 * java-tree.h: Comment reorganized to carry on previous
13412 classification effort.
13413 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
13414 RESOLVE_TYPE_NAME_P): New flags on WFLs.
13415 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
13416 java_parse (new prefix java_ generated by bison).
13417 (java_layout_parsed_class, java_register_parsed_class): Function
13418 call removed.
13419 (yyparse): Removed unnecessary call to init_outgoing_cpool.
13420 * lex.c (static tree wfl_op): Variable deleted.
13421 (java_init_lex): Initialize kw_super and kw_this. Initialize more
13422 ctxp fields to NULL_TREE.
13423 (java_lex): No longer create WFL for operators. Filename caching
13424 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
13425 created as STRING_CST and later expanded. Removed extra argument
13426 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
13427 and SUPER.
13428 (build_wfl_node): Removed code in comments.
13429 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
13430 store token and location data in the current bison token.
13431 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
13432 static/extern function declaration at the beginning of the file.
13433 (struct qualification): Data structure definition deleted.
13434 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
13435 (qualify_ambiguous_name): Function declaration modified. Function
13436 now returns nothing.
13437 (build_array_ref, patch_array_ref, make_qualified_name,
13438 resolve_qualified_expression_name, maybe_generate_clinit,
13439 resolve_field_access): New static function declarations.
13440 (build_java_arrayaccess): New extern function declaration.
13441 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
13442 (CALL_EXPR_PRIMARY): Macro deleted.
13443 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
13444 (struct parser_ctxt): Field initialized_final
13445 removed. non_static_initialized, static_initialized: New fields.
13446 * parse.y (static tree kw_super, static tree kw_this): New global
13447 static.
13448 (%union): tree wfl field of operator member replaced by int
13449 location. WFLs are non longer created for operators.
13450 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
13451 (qualified_name:): Now calls make_qualified_name to build the
13452 identifier.
13453 (type_declaration:): Consider generating <clinit> when class
13454 parsing completed.
13455 (variable_declarator:): Directly build an assignment node when the
13456 variable is initialized when declared.
13457 (this_or_super:): Build a WFL and set current location when THIS
13458 or SUPER are parsed.
13459 (expression_statement:): Wrap statement around a WFL.
13460 (primary_no_new_array:): Fixed typo. Changed value returned by
13461 THIS_TK because of its new type (temporary).
13462 (dim_exprs:): Temporary fix because of OSB_TK's new type.
13463 (field_access:): Build qualified name with SUPER.
13464 (method_invocation:): Fixed returned value because of SUPER's new
13465 type.
13466 (array_access:): Use OSB_TK location information.
13467 (post_increment_expression:, post_decrement_expression:,
13468 unary_expression:, pre_increment_expression:,
13469 pre_decrement_expression:, unary_expression_not_plus_minus:,
13470 cast_expression:, multiplicative_expression:,
13471 additive_expression:, shift_expression:, relational_expression:,
13472 equality_expression:, and_expression:, exclusive_or_expression:,
13473 inclusive_or_expression:, conditional_and_expression:,
13474 conditional_or_expression:, assignment:): Use new location/token
13475 information available on operators.
13476 (create_class): Set super_decl_type to NULL_TREE when processing
13477 java.lang.Object.
13478 (register_fields): Field initialization is now a MODIFY_EXPR
13479 node. Chain initialization code to the matching lists (according
13480 the the field declaration modifiers).
13481 (maybe_generate_clinit): New function.
13482 (method_header): Don't set method's DECL_NAME to a WFL when adding
13483 methods to java.lang.Object.
13484 (resolve_and_layout): Now can return NULL_TREE if the type
13485 resolution fails. Otherwise, return the class DECL instead of its
13486 TYPE.
13487 (check_method_redefinition): Don't patch method DECL_NAME if it
13488 belongs to java.lang.Object.
13489 (process_imports): Simply assign error_found to the value returned
13490 by check_pkg_class_access.
13491 (declare_local_variables): Don't use their init statements (if
13492 any) when parsing error were previously found. Reuse MODIFY_EXPR
13493 build during parsing as an init statement.
13494 (java_method_add_stmt): Now return the current method body.
13495 (java_layout_parsed_class, java_register_parsed_class): Functions
13496 removed.
13497 (java_complete_expand_methods): Initialize the constant pool on a
13498 per class basis. Layout the classes before expanding their method
13499 bodies. Don't try expand artificial constructor code if error were
13500 found. Make the classes data and register them if no error were
13501 found.
13502 (java_complete_expand_method): Retrieve an artificial constructor
13503 argument list before entering its body. Assign the top block to
13504 the artificial constructor function body and set types of declared
13505 blocks and compound statements to void. Walk method body if not an
13506 artificial constructor.
13507 (make_qualified_name, cut_identifier_in_qualified): New functions.
13508 (resolve_expression_name): Fixed comments. Save/restore the
13509 current class CLASS_LOADED_P flag value. Build non qualified
13510 static field access and handle qualified expression names.
13511 (resolve_field_access, resolve_qualified_expression_name): New
13512 functions.
13513 (patch_method_invocation_stmt): Use the new expression resolution
13514 scheme, calling resolve_field_access when the function call is
13515 resolved as an expression.
13516 (qualify_ambiguous_name): Function rewritten to work on qualified
13517 expression produced by make_qualified_name.
13518 (java_complete_tree): Promote type when function's argument are
13519 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
13520 the assignment to discover further errors if RHS is a expression
13521 name that fails to evaluate. Declare LHS initialized even though
13522 the assignment failed. Don't use the location variable and removed
13523 extra argument in patch function calls. Now handle the ARRAY_REF
13524 case and build internal string representation when STRING_CSTs are
13525 walked.
13526 (build_method_invocation): Don't wrap function call around a WFL.
13527 (build_assignment): Likewise. Use the operator location
13528 information.
13529 (patch_assignment): Handle array access LHSs. Handle error
13530 provenance, resulting in a better error report.
13531 (build_binop): Use op_location from operator as binop location
13532 information.
13533 (build_unaryop, build_incdec, build_cast): Likewise.
13534 (patch_binop): Extract location information from the node. Fixed
13535 typo in error message.
13536 (patch_unary_op): Extract location information from the node.
13537 (build_array_ref, patch_array_ref): New functions.
13538
13539 1998-07-01 Tom Tromey <tromey@cygnus.com>
13540
13541 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
13542 match _Jv_IsInstanceOf.
13543 * decl.c (init_decl_processing): Use _Jv_NewArray, not
13544 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
13545
13546 1998-06-30 Tom Tromey <tromey@cygnus.com>
13547
13548 * decl.c (init_decl_processing): Functions are now named
13549 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
13550
13551 1998-06-29 Per Bothner <bothner@cygnus.com>
13552
13553 * java-tree.h (load_class): Add prototype.
13554 * class.c (is_compiled_class): Add missing arg to load_class.
13555 * expr.c (expand_java_NEW): Call load_class.
13556 * parse.y (process_import): Removed bogus use of void return value.
13557
13558 1998-06-25 Per Bothner <bothner@cygnus.com>
13559
13560 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
13561 Function name is "_Jv_Throw" instead of "soft_athrow".
13562 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
13563 Function name is "_Jv_AllocObject" instead of "soft_new".
13564 Takes an extra parameter (object size).
13565 * expr.c: Update calls.
13566
13567 1998-06-24 Per Bothner <bothner@cygnus.com>
13568
13569 * lex.c (java_get_line_col): Handle end-of-file.
13570 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
13571
13572 1998-06-24 Andrew MacLeod <amacleod@cygnus.com>
13573
13574 * lang.c (lang_init): Make -fexceptions the default.
13575 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
13576 exception handling is not turned on.
13577
13578 1998-06-23 Andrew MacLeod <amacleod@cygnus.com>
13579
13580 * lang.c (flag_new_exceptions): Make this this default.
13581 * decl.c (end_java_method): Call emit_handlers.
13582 * except.c (method_init_exceptions): Set language code and version.
13583 (expand_start_java_handler): Enable exception, and call
13584 expand_eh_region_start.
13585 (expand_end_java_handler): Enable exception, and set up catch blocks.
13586 (emit_handlers): New routine to generate the saved handlers.
13587 * java-except.h (emit_handlers): Add prototype.
13588
13589 1998-06-12 Per Bothner <bothner@cygnus.com>
13590
13591 We used to have three different representations of the constant pool:
13592 the CPool structure, the tree_constant_pool, and the constructures
13593 used to build the Class object (which may need class and string
13594 constants) in compiled code. None were appropriate for compiling
13595 to .class files, so I did a major overhaul.
13596
13597 First, the tree_constant_pool array was removed. Things were
13598 modified to the CPool structure in the JCF could be used.
13599 Second, a "capacity" field was added to the CPool, and functions
13600 written to search for a matching constant, adding one if not found.
13601 The code that generated the Class object was changed to use a CPool.
13602 The actual TREE_LISTs used to build the CONSTRUCTORs used for
13603 the static Class object are now only in build_constants_constructor.
13604 Finally, I wrote code which can generate a .class file (including its
13605 constant pool) from the RECORD_TYPE of a class. This is a big step
13606 on the way to compiling Java source into .class files.
13607
13608 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
13609 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
13610
13611 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
13612 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
13613 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
13614 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
13615 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
13616 (lang_type): Removed constant_pool field.
13617 * jcf.h (CPool): Renamed size to count. Added field capacity.
13618 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
13619 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
13620 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
13621
13622 * constants.c (current_constant_pool_tags, current_constant_pool_data,
13623 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
13624 * constants.c (build_constants_constructor): Use new outgoing_cpool.
13625 (set_constant_entry, find_constant1, find_constant2,
13626 find_class_constant, count_constant_pool_bytes, write_constant_pool,
13627 find_utf8_constant, find_class_or_string_constant): New functions.
13628
13629 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
13630 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
13631 (give_name_to_class, get_class_constant): Likewise.
13632 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
13633 (get_name_and_type_constant, get_ref_constant): Removed.
13634 * parse.h (parser_ctxt): Remove field tree_constant_pool.
13635 * parse.y: Don't save/restore tree_constant_pool.
13636 * verify.c (verify_jvm_instructions): Update for new approach.
13637 * expr.c (expand_invoke, expand_java_field_op): Likewise.
13638
13639 * lang-options.h: Added -femit-class-file, -femit-class-files.
13640 * lang.c (flag_emit_class_files), java-tree.h: New flag.
13641 (lang_f_options): Added "emit-class-file(s)".
13642
13643 * expr.c (build_java_arrayaccess): Generate more efficient array
13644 bounds checking, by using unsigned compare.
13645
13646 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
13647
13648 1998-06-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
13649
13650 * parse.h: New comment on the handling of unresolved type
13651 identifiers. JDEPs are now part of the jdep_code enum.
13652 (typedef struct jdep): Now use enum jdep_code or int, depending on
13653 availability. Both are narrowed down to an 8 bits bitfield.
13654 (CALL_EXPR_PRIMARY): Fixed comment.
13655
13656 1998-06-10 Tom Tromey <tromey@cygnus.com>
13657
13658 * Make-lang.in (java): Added gjavac and jvgenmain.
13659 (java.start.encap): Depend on gjavac.
13660 (java.rest.encap): Depend on jvgenmain.
13661
13662 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
13663 (JAVA_CROSS_NAME): Likewise.
13664 (java.all.build): Depend on jvgenmain and gjavac.
13665 (java.all.cross): Depend on jvgenmain and gjavac-cross.
13666 (jvgenmain$(exeext)): New target.
13667 (java.install-common): Wrote.
13668 * config-lang.in (compilers, stagestuff): Added gjavac and
13669 jvgenmain.
13670
13671 1998-06-10 Dave Brolley <brolley@cygnus.com>
13672
13673 * lang.c (lang_decode_option): New argc/argv interface.
13674
13675 1998-06-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
13676
13677 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
13678 * decl.c (build_decl_no_layout): New function.
13679 * expr.c (java_lang_expand_expr): Layout declarations found in
13680 blocks before they're pushed.
13681 * jcf-parse.c (load_class): Save current line when parsing class
13682 file.
13683 (parse_source_file): Register class before expanding their
13684 methods.
13685 * lang.c (put_decl_node): Produce `null' when `void *' is
13686 processed.
13687 * lex.c (static tree wfl_op): New static global, for error report
13688 on casts.
13689 (java_init_lex): wfl_operator and wfl_op initialized
13690 here. Filename caching added for wfl_op. Return wfl_op when `(' is
13691 parsed.
13692 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
13693 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
13694 build_unresolved_array_type): New static function definitions.
13695 (build_decl_no_layout): New extern function declared.
13696 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
13697 faulty modifier exists.
13698 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
13699 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
13700 (UNARY_PLUS_EXPR): New fake operator.
13701 (struct parser_ctxt): New field osb_number.
13702 * parse.y (static tree wfl_operator): New static WFL for operator
13703 bound error messages.
13704 (DECR_TK, INCR_TK): Moved.
13705 (OP_TK): Tagged <operator>.
13706 (array_type:): Now call build_unresolved_array_type.
13707 (dim_expr:): Count the number of '[' seen.
13708 (post_increment_expression, post_decrement_expression,
13709 pre_increment_expression, pre_decrement_expression,
13710 unary_expression_not_plus_minus, unary_expression:): Actions are
13711 now building the corresponding unary expressions.
13712 (cast_expression:): Actions are now building cast expressions.
13713 (build_unresolved_array_type): New function.
13714 (create_interface): Reset the number of declared interfaces.
13715 (create_class): Likewise.
13716 (method_header): Methods declared within the scope of an interface
13717 are now implicitly set public and abstract.
13718 (java_complete_class): Variable's and parameter's type are patched
13719 with a promoted type.
13720 (declare_local_variables): Resolved non builtin types are promoted
13721 before being used to build a variable decl. Removed type patch
13722 posted on variable initialization statement.
13723 (source_start_java_method): Use build_decl_no_layout to build the
13724 decl of a parameter of incomplete type.
13725 (java_register_parsed_class): Process interfaces too. Call
13726 rest_of_decl_compilation on each processed class declarations.
13727 (java_complete_expand_methods): Don't attempt to expand things in
13728 interfaces.
13729 (java_complete_tree): Process CONVERT_EXPR, even though it always
13730 has a type. Propagate error_mark_node to node's type too. Promote
13731 method's call argument type and return error_mark_node if
13732 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
13733 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
13734 handle unary operator nodes.
13735 (build_assignment): Added comment.
13736 (print_int_node): New function.
13737 (patch_assignment): New second argument. New error handling. Use
13738 print_int_node. Handle references. Use can_cast_to_p to issue
13739 different error message according to the context and check upon
13740 the initialization of the RHS.
13741 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
13742 (operator_string): Handle more operators.
13743 (patch_binop): No longer use a function static
13744 wfl_operator. Improved error message on shift distance.
13745 (build_unaryop, build_incdec, build_cast, patch_unaryop,
13746 patch_cast): New functions.
13747
13748 1998-06-05 Per Bothner <bothner@cygnus.com>
13749
13750 * jvspec.c: New file.
13751 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
13752
13753 * java-tree.h (identifier_subst): Add declaration.
13754
13755 1998-06-04 Tom Tromey <tromey@cygnus.com>
13756
13757 * jvgenmain.c (main): Generate call to JvRunMain.
13758
13759 * class.c (make_class_data): Push value for "sync_info" field.
13760 * decl.c (init_decl_processing): Push "sync_info" field.
13761
13762 1998-06-03 Per Bothner <bothner@cygnus.com>
13763
13764 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
13765 Java (source) name, not signature.
13766 Set TYPE_ALIGN to (at least) that of element_type.
13767
13768 1998-06-02 Per Bothner <bothner@cygnus.com>
13769
13770 * class.c: Moved classname-mangling-rekated code to ...
13771 * mangle.c: ... this new file.
13772 * jvgenmain.c: New program (needs mangle.c) to generate main program.
13773 * Makefile.in: Update for above changes.
13774
13775 1998-06-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
13776
13777 * expr.c (truthvalue_conversion): Convert integer and floating
13778 point value to their truth value.
13779 * lex.c (java_lex): Handle the `null' literal.
13780 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
13781 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
13782 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
13783 New macros.
13784
13785 * parse.y: Reorganization/documentation on token declaration.
13786 (binop_lookup[]): New added new tree codes.
13787 (relational_expression): Build corresponding binary operators.
13788 (equality_expression, conditional_and_expression,
13789 conditional_or_expression): Likewise.
13790 (java_complete_class): Fix crash in debug message.
13791 (java_complete_tree): Check initialization of method call
13792 arguments. Further bogus node evaluation to detect more error
13793 during assignments. Handles more binary operators.
13794 (patch_assignment): Use DECL_P.
13795 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
13796 code.
13797 (operator_string): Handle more case. Compacted source.
13798 (patch_binop): Changed function comment. Checking for
13799 uninitialized first operand takes the compound assignment into
13800 account and uses DECL_P. Checking for uninitialized second operand
13801 delayed to routine's end. Use macros to issue type bound error
13802 messages and issue messages on both operands if their types are
13803 different. Force fixed type into node. Handle all binary
13804 operators.
13805
13806 1998-05-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
13807
13808 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
13809 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
13810 build operator node and return tokens.
13811 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
13812 * parse.h (java_complete_tree): Changed returned type in prototype.
13813 (build_method_invocation, build_assignment, patch_assignment,
13814 patch_binop): New static function declarations.
13815 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
13816 BUILD_EXPR_WFL): New macros.
13817 * parse.y (enum tree_code binop_lookup[]): New static for token to
13818 TREE_CODE lookup.
13819 (%union): Parser union has new sub-structure `operator'.
13820 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
13821 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
13822 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
13823 ASSIGN_ANY_TK): Tokens tagged `operator'.
13824 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
13825 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
13826 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
13827 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
13828 (assignment_operator:): Rule tagged `operator'.
13829 (expression_statement:): Re-installed default rule.
13830 (method_invocation:): Sub rules call build_method_invocation.
13831 (postfix_expression:): Don't attempt to resolve name here. Just
13832 return an ID.
13833 (multiplicative_expression:): Sub-rules build corresponding binop
13834 expression node.
13835 (additive_expression:, shift_expression:, and_expression:,
13836 exclusive_or_expression:, inclusive_or_expression:): Likewise.
13837 (assignment:): Sub rule invoke build_assignment.
13838 (assignment_operator:): Default rules on sub rules.
13839 (force_error): Added documentation on this variable.
13840 (declare_local_variables): Build initialization calling
13841 build_assignment.
13842 (expand_start_java_method): Removed unused rtx declaration. Mark
13843 arguments as already initialized.
13844 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
13845 (java_complete_expand_methods): Don't process next method if
13846 completion of the previous one triggered errors.
13847 (java_complete_expand_method): Call source_end_java_method if no
13848 error were found during completion.
13849 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
13850 locals declaratilon. Handle names found within a class. Return
13851 error_mark_node when things aren't found.
13852 (patch_method_invocation_stmt): Return error_mark_node on failures.
13853 (patch_invoke): Removed unused local. Return the correct node.
13854 (java_complete_tree): Now returns a value. The BLOCK section binds
13855 local identifiers and the type of a BLOCK is now void. Assign the
13856 result of operand completion on COMPOUND_EXPR. Assign the
13857 encapsulated node of a WFL to the result of its completion, except
13858 when the node is an identifier. Now handle MODIFY_EXPR and several
13859 binary operators. Return error_mark_node on errors.
13860 (build_method_invocation, build_assignment, patch_assignment,
13861 build_binop, operator_string, patch_binop): New functions.
13862 * typeck.c (binary_numeric_promotion): New function.
13863
13864 1998-05-21 Per Bothner <bothner@cygnus.com>
13865
13866 * class.c (identifier_subst): New convenience wrapper for ident_subst.
13867 Replace most uses of ident_subst by identifier_subst.
13868
13869 * class.c (push_class_static_dummy_field): Removed function.
13870 (build_class_ref): Find Class object decl by looking up "CNAME.class",
13871 instead of looking got "class" static field. Create that decl here.
13872 (class_identifier_node): Removed; no longer needed.
13873 (init_class_processing): Don't init class_identifier_node.
13874 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
13875 Do nreverse 0 times (instead of twice) for Object and Class.
13876 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
13877
13878 1998-05-20 Per Bothner <bothner@cygnus.com>
13879
13880 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
13881 while initializing linenumber_count and linenumber_table.
13882 Do it before init_function_start (which calls emit_line_note).
13883 * expr.c (expand_byte_code): Don't need to clear lineno here.
13884
13885 1998-05-18 Tom Tromey <tromey@cygnus.com>
13886
13887 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
13888 then mangle number as _N_.
13889
13890 * class.c (mangle_class_field): New function.
13891 (build_class_ref): Set assembler name of class reference using
13892 mangle_class_field.
13893 (push_class_static_dummy_field): Likewise.
13894
13895 1998-05-17 Michael Tiemann <tiemann@cygnus.com>
13896
13897 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
13898 of assigning to TREE_CODE. The latter method exploits a feature
13899 of GCC that is not ANSI compliant.
13900
13901 1998-05-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
13902
13903 * decl.c (pushdecl_force_head): New function.
13904 (pushlevel): Removed conditional printf.
13905 (complete_start_java_method): Don't enter local variable scope if
13906 function is compiled from source code.
13907 * expr.c: parse.h now included
13908 (java_lang_expand_expr): New function.
13909 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
13910 printf. Terminate buffer when doing directories.
13911 * jcf-parse.c (parse_source_file): Call lang_init_source before
13912 parsing and before code generation.
13913 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
13914 use printf if the macro is defined.
13915 * lang.c (lang_init): Install lang_expand_expr hook on
13916 java_lang_expand_expr.
13917 (java_dummy_print): New function.
13918 (lang_init_source): New function.
13919 * lex.c (java_lex): Remember location of an opening brace at the
13920 second nesting level.
13921 (java_is_eol): Unget character seen after a CR if it is EOF.
13922 * parse.h: Now includes lex.h
13923 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
13924 printf if the macro is defined.
13925 (expand_start_java_method, build_expr_block, enter_block,
13926 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
13927 New static function declarations.
13928 (pushdecl_force_head): New extern function declaration.
13929 (INCOMPLETE_TYPE_P): New macro.
13930 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
13931 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
13932 BLOCK_EXPR_ORIGIN): New macros.
13933 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
13934 DECL_SOURCE_LINE_LAST): New macros.
13935 (struct parser_ctxt): Removed field current_method_decl, redundant
13936 with the field current_function_decl. Added fields
13937 first_ccb_indent1 and pending_block.
13938 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
13939 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
13940 tagged <node>
13941 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
13942 (compilation_unit:): Cosmetic on sub rule.
13943 (type_declaration:): Cosmetic on sub rules. Added an error rule.
13944 (variable_initializer:): Installed default rule on expression:.
13945 (method_declaration:): method_header: starts a new
13946 method. method_body: installs the function body, absorbs blocks
13947 emitted for temporary variable scopings, pops function's body block
13948 and merges function's last statement lineno in DECL_SOURCE_LINE.
13949 (method_body:): Installed default rules.
13950 (block:): Call enter_block when an opening brace is seen. Absorb
13951 scoping blocks and call exit_block when a closing brace is seen.
13952 (block_statement:): Cosmetic changes.
13953 (method_invocation:): Create WFL around CALL_EXPR node.
13954 (patch_stage): Added comment around definition.
13955 (method_header): Try to use first_ccb_indent1 as the first line of
13956 the method, so BP debug info are emitted at the first opening
13957 brace of the function. If the function has no body, use the
13958 location of the function's name. Override currently defined method
13959 name with the matching WFL so we can point redefinition errors
13960 using the location where the function's name was declared.
13961 (check_abstract_method_header): Interprets DECL_NAME as an
13962 identifier or as a WFL, accordingly.
13963 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
13964 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
13965 location and name information out of it and reinstall DECL_NAME to
13966 its original identifier node value.
13967 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
13968 function's source code).
13969 (read_import_dir): Test the value returned by find_class and issue
13970 a fatal accordingly.
13971 (declare_local_variables): Push a new block for the scope of the
13972 new variable(s) if code has been already generated at that nesting
13973 level. Pinpoint redefinition errors using the variable id
13974 WFLs. Generate initialization code if necessary. If the variable
13975 type is incomplete, register a patch on its decl.
13976 (source_start_java_method): Rewritten. Define a new block for the
13977 function's parameters. Build parameter decl out of function's
13978 arguments and register them for a patch if their types are
13979 incomplete.
13980 (expand_start_java_method): Includes the part of
13981 source_start_java_method that was pushing the parameter decls and
13982 completing the method start code.
13983 (source_end_java_method): Removed call the expand_end_bindings and
13984 poplevel (already taken care of). Reinstall function's arguments
13985 and get function's last line of code before calling
13986 expand_function_end.
13987 (java_method_add_stmt): New comment before the function's
13988 code. Complement the second operand of the current COMPOUND_EXPR
13989 if necessary.
13990 (java_complete_expand_methods): Don't generate debug info on line
13991 zero when expanding a generated constructor.
13992 (java_complete_expand_method): Set start and end line numbers for
13993 a artificially generated constructor to one and manually call
13994 enter_block and exit_block when defining it. For all methods:
13995 expand function's start calling the new expand_start_java_method
13996 and invoke java_complete_tree on the effective method's body, if
13997 any.
13998 (resolve_expression_name): Now use lookup_name_in_blocks to search
13999 local variable decls and print out an error when variables are
14000 undefined.
14001 (patch_method_invocation_stmt): Inserted comment before the
14002 function's code.
14003 (lookup_method_invoke): Chain method's arguments using chainon
14004 with the current arg list as a second argument. Inserted missing
14005 IDENTIFIER_POINTER when reporting an error on methods not found.
14006 (refine_accessible_methods_list): Don't retain constructors.
14007 (patch_arguments): Function removed.
14008 (java_complete_tree): Inserted comment before the function's
14009 code. New case for BLOCKs. Moved the WFL case a bit
14010 further. Complete function's arguments.
14011 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
14012 maybe_absorb_scoping_blocks): New functions.
14013
14014 1998-04-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
14015
14016 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
14017 previously set.
14018 * jcf-parse.c (parse_source_file, java_error_count): New forward
14019 and extern declarations.
14020 (java_parse_abort_on_error): Macro moved.
14021 (jcf_parse_source): fatal called if fopen fails. Now calls
14022 parse_source_file.
14023 (parse_source_file): New parse_only parameter. Reflects the
14024 elimination of the second pass.
14025 (yyparse): parse_source_file called with argument set to 0.
14026 * jcf.h (JCF_ZERO): Sets java_source to zero.
14027 * lex.c (java_init_lex): pass argument is gone. Function modified
14028 to be called once during the analysis of a file.
14029 (java_unget_unicode): Fixed typo in fatal message.
14030 (java_get_line_col): Likewise.
14031 (java_lval): Likewise. String literals no longer built during
14032 second pass.
14033 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
14034 account.
14035 * parse.h (MODIFIER_WFL): New macro.
14036 (parse_check_super, parser_check_super_interface): Now return int.
14037 (parser_chain_incomplete_item, not_builtin_p,
14038 complete_method_decl): Declarations removed.
14039 (build_method_invocation_stmt, build_invoke): Renamed using the
14040 `patch' instead of `build'
14041 (register-incomplete_type, obtain_incomplete_type,
14042 java_complete_tree, java_complete_expand_method,
14043 unresolved_type_p, create_jdep_list): New function declarations.
14044 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
14045 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
14046 (jdep): New typedef on new struct _jdep.
14047 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
14048 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
14049 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
14050 JDEP_RESOLVED_P): New macros.
14051 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
14052 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
14053 JDEP_VARIABLE): New enum values and jdep kinds.
14054 (jdeplist): New typedef on struct _jdeplist.
14055 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
14056 macros.
14057 (CALL_EXPR_PRIMARY): New macro.
14058 (struct parser_ctxt): Fields java_pass, current_method_decl,
14059 method_decl_list deleted. New field jdeplist.
14060 (INCOMPLETE_P): Macro deleted.
14061 * parse.y (single_type_import_declaration:): Removed pass switch.
14062 (type_import_on_demand_declaration): Likewise.
14063 (field_declaration:): Removed pass switch on all sub rules.
14064 (class_declaration:): Call the complete_class_decl removed on
14065 class_body rules.
14066 (method_declaration:): Removed second pass switch. No longer chain
14067 methods decl when method_header reduced.
14068 (method_header:): Sub rules no longer depend on pass switch.
14069 (method_declarator:): Likewise.
14070 (method_body:): Likewise.
14071 (abstract_method_declaration:): Likewise.
14072 (block_statement:): Likewise.
14073 (local_variable_declaration:): Likewise.
14074 (argument_list:): Likewise.
14075 (method_invocation:): Likewise. Call to build_method_invocation_stmt
14076 removed. Partial CLASS_EXPR tree node built instead.
14077 (postfix_expression:): Removed pass switch on all sub rules.
14078 (java_pop_parser_context): Free classd_list content.
14079 (yyerror): Call obstrack_grow0 to finalize error message.
14080 (check_class_interface_creation): Comment modified to reflect new
14081 returned value meaning. Removed second pass switch. Return 1 if an
14082 error was found, 0 otherwise. Adjust pointer on filename if a
14083 leading path separator was found.
14084 (maybe_create_class_interface_decl): Removed first pass switch
14085 when linking the class decl to the class_list. Install a new
14086 jdep_list for the class.
14087 (add_superinterfaces): List of unresolved interfaces is
14088 gone. Unresolved interfaces are directly added to the current
14089 dependencies list.
14090 (create_interface): Second pass shortcut removed.
14091 ctpx->modifier_ctx access through MODIFIER_WFL.
14092 (create_class): Second pass shortcut removed. Call to
14093 register_incomplete_type replaces the call to
14094 parser_chain_incomplete_item.
14095 (complete_class_decl): Function removed.
14096 (duplicate_declaration_error): New way of retrieving redeclared
14097 item type.
14098 (register_fields): Call to lookup_modifier_cl replaced by
14099 MODIFIER_WFL. New way of handling unresolved type, using
14100 unresolved_type_p and obtain_incomplete_type.
14101 register_incomplete_type replaces call to parser_chain_incomplete_item.
14102 (patch_stage): New static global variable.
14103 (method_header): New way of handling unresolved type, using
14104 unresolved_type_p and obtain_incomplete_type. patch_stage used to
14105 indicates that the method decl needs to be patched.
14106 (check_abstract_method_header): Call to lookup_modifier_cl
14107 replaced by MODIFIER_WFL.
14108 (method_declarator): Incomplete argument type are registered
14109 calling register_incomplete_type. Patch on the declared method is
14110 issued in that case.
14111 (unresolved_type_p): New function.
14112 (parser_check_super_interface): New comment to reflect function's
14113 modified returned type (int). Function and has a new argument
14114 this_wfl. Call to parse_error_context uses this_wfl instead of
14115 relying on lookup_cl.
14116 (parser_check_super): Comment reflects function's new returned
14117 type (int). Function returns nonzero value on error.
14118 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
14119 register_incomplete_type, jdep_resolve_class): New functions to
14120 handle incomplete types in declarations.
14121 (java_complete_class): Rewritten to work with the new incomplete
14122 type handling scheme.
14123 (complete_class_report_errors): Likewise.
14124 (complete_method_decl): Removed: it jobs is now handled by
14125 java_complete_class.
14126 (do_resolve_class): Class loaded in not already loaded and not
14127 found in Java source code.
14128 (java_check_regular_methods, java_check_abstract_methods): Don't
14129 call complete_method_decl anymore.
14130 (lookup_modifier_cl, not_builtin_p): Functions deleted.
14131 (read_import_dir): Got rid of the pass number dependency.
14132 (declare_local_variables): New handling of unresolved types (patch
14133 issued).
14134 (source_start_java_method): New parameter level. Function called
14135 with level set to 1 when argument types are potentially
14136 unresolved. Called to complete the job with level set to 2 once
14137 types are complete.
14138 (source_end_java_method): Call to permanent_allocation
14139 removed. Waiting to be replaced by a more suitable obstack
14140 management.
14141 (java_complete_expand_methods, java_complete_expand_method,
14142 java_expand_finals): New functions.
14143 (build_method_invocation_stmt): Renamed
14144 patch_method_invocation_stmt. Extracts function call expression
14145 (wfl) and arguments (args) from CALL_EXPR tree operands.
14146 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
14147 call. Patch the function and argument operand of the CALL_EXPR
14148 tree argument.
14149 (patch_argument, java_complete_tree): New functions.
14150
14151 1998-04-20 Per Bothner <bothner@cygnus.com>
14152
14153 Recover from missing fields and methods (i.e. error instead of fatal).
14154 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
14155 * expr.c (expand_invoke): Recover from missing method.
14156 (expand_java_field_op): Recover from missing field.
14157 Inline references to java.lang.{Integer,Char,...}.TYPE.
14158 * typeck.c (get_type_from_signature), java-tree.h: New function.
14159 * class.c (add_method): Use get_type_from_signature.
14160 (build_class_ref): Handle a class that was not found.
14161 * typeck.c (convert): Handle conversion to pointers (for convenience).
14162 * verify.c (verify_jvm_instructions): Use get_type_from_signature
14163 instead of lookup_field to handle missing fields.
14164
14165 * jcf-parse.c (process_zip_dir): Set java_source.
14166
14167 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
14168
14169 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
14170
14171 1998-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
14172
14173 * jcf-parse.c (load_class): Don't change input_filename before
14174 calling jcf_parse_source (but still do it before calling
14175 jcf_parse).
14176 (jcf_parse_source): Assign input_filename after having saved the
14177 parser context.
14178 * lex.c (java_init_lex): Chain a WFL node to the import on demand
14179 list. ctxp->modifier_ctx zeroed according to its new
14180 definition. ctxp->filename initialized. Removed
14181 JAVA_MODIFIER_CTX_UNMARK.
14182 (java_unget_unicode): Update the character based column position.
14183 (java_allocate_new_line): ref_count not used anymore. Always free
14184 ctxp->p_line. Initialize c_line->char_col to 0.
14185 (java_get_unicode): Update the character based column position.
14186 (java_lex): Use ctxp->elc to store current position in source
14187 file, at the beginning of the parsed token. Set modifier_ctx entry
14188 corresponding to the parse modifier to a WFL node. Return a WFL
14189 node when an identifier is parsed.
14190 (java_lex_error): Now uses ctxp->elc to store current position in
14191 source.
14192 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
14193 * lex.h (build_wfl_node): New function definitions.
14194 (struct java_line): ref_count and next fields are gone. New field
14195 char_col.
14196 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
14197 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
14198 (JAVA_COLUMN_DELTA): New macro.
14199 (java_lc): New typedef on new struct _java_lc.
14200 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
14201 (parse_error_context, parse_warning_context): Changed prototypes.
14202 (java_get_line_col): Added as an available global function.
14203 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
14204 (IC_DECL): Replaced by macro IC_TYPE
14205 (DEPEND_WFL): New macro.
14206 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
14207 wrong modifier.
14208 (exit_java_complete_class): Removed a commented out statement.
14209 (struct parser_ctxt): Added comments on fields. modifier_ctx is
14210 now an array of tree nodes. Deleted fields line_list and
14211 e_line. New field elc, to replace e_line.
14212 * parse.y (array_type:): Build WFL node.
14213 (qualified_name:): Build a single WFL node out of two. Retain
14214 the location information of the first node in the resulting node.
14215 (package_declaration:): Use package name as a WFL node
14216 (single_type_import_declaration:): Use imported name as a WFL node.
14217 (type_import_on_demand_declaration:): Use root of the imported
14218 packages as a WFL node.
14219 (field_declaration:): Removed unused local variable cl.
14220 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
14221 (yyerror): New static elc. Removed static error_line, error_pos.
14222 New local code_from_source. Save ctxp->elc into elc at the first
14223 pass. Call java_get_line_col to get a string of the line where
14224 the error occurred.
14225 (debug_line): Removed static function.
14226 (parse_error_context, parse_warning_context): Parameter cl is now
14227 a WFL node. Use its value to initialize ctxp->elc.
14228 (redefinition_error): Parameter cl is now a WFL node.
14229 (parse_add_interface): New parameter wfl. No longer call
14230 lookup_cl, use wfl instead.
14231 (check_class_interface_creation): Parameter cl is now a WFL node.
14232 (maybe_create_class_interface_decl): Likewise.
14233 (add_superinterfaces): New function.
14234 (create_interface): Removed local cl, node, super_decl,
14235 super_decl_type. Function now uses id as a WFL node. Better
14236 warning/error report on obsolete or forbidden mix of
14237 modifiers. Now calls add_superinterfaces to register interfaces.
14238 (create_class): Removed local cl, node. Local variable id is used
14239 as a WFL node. Better error report on forbidden modifier
14240 mix. Uses add_superinterfaces to register interfaces.
14241 (find_field): Argument cl is now a WFL node. Now store the WFL
14242 node of a fields that needs to be checked for their
14243 initialization.
14244 (method_header): Local variable node non longer used. Local
14245 variable id replaces cl.
14246 (check_modifiers_consistency): Local variable cl is now a WFL
14247 node.
14248 (method_declarator): Local variable cl replaced by parameter id.
14249 (parser_qualified_name): Now uses parameter name as a WFL node.
14250 (parser_check_super_interface): New parameter wfl, for achieve
14251 greater accuracy during error reports.
14252 (parser_chain_incomplete_item): New parameter named location. Used,
14253 along the decl, to construct the incomplete item node.
14254 (java_complete_class): resolve_class now uses WFL node extracted
14255 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
14256 where appropriate.
14257 (complete_method_decl): Unresolved function's argument types are WFL.
14258 (resolve_class): Parameter cl is now a WFL node.
14259 (resolve_and_layout): Likewise.
14260 (do_resolve_class): Likewise. Try first to use cl and then do the
14261 lookup on the decl when calling check_pkg_class_access.
14262 (complete_class_report_errors): Use IC_TYPE in place of
14263 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
14264 instead of doing a lookup over the decl.
14265 (java_check_final): Use WFL info from field tree list.
14266 (lookup_cl): Rewritten and returns a statically defined WFL node.
14267 (lookup_modifier_cl): Now uses information from WFL nodes.
14268 (process_imports): Likewise.
14269 (read_import_dir): name and cl arguments replaced by a single WFL
14270 node. Function modified accordingly.
14271 (find_in_imports_on_demand): Now uses WFL node.
14272 (check_pkg_class_access): cl argument is now a WFL node.
14273 (declare_local_variables): Fixed to use WFL nodes.
14274 (resolve_expression_name): Likewise.
14275 (build_method_invocation_stmt): name_combo argument renamed
14276 wfl. Function modified to use WFL nodes.
14277 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
14278 (lookup_method_invoke): cl is now a WFL node. Added missing
14279 IDENTIFIER_POINTER to class type decl name.
14280
14281 1998-04-14 Dave Brolley <brolley@cygnus.com>
14282
14283 * lang.c (init_parse): Now returns char* containing the filename.
14284
14285 1998-04-10 Per Bothner <bothner@cygnus.com>
14286
14287 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
14288
14289 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
14290 * class.c (make_class_data): If flag_assume_compiled, initial class
14291 state is CSTATE_PREPARED; make superclass and interfaces direct
14292 references, rather than constant pool indexes.
14293
14294 1998-04-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
14295
14296 * parser.y: Include flags.h. Removed debug variable pl.
14297 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
14298 (block:): Likewise.
14299 (labeled_statement_nsi:): Generate debug info when reducing
14300 expression_statement:.
14301 (check_pkg_class_access): get_access_flags_from_decl invokation
14302 fixed for new CLASS_* flags location.
14303 (source_end_java_method): Save/restore parser context when
14304 entering/leaving this routine. Restore lineno to its right value
14305 before calling expand_end_bindings.
14306 (build_method_invocation_stmt): build_invoke called with the
14307 current line information.
14308 (build_invoke): New argument cl. Wrap the function call around a
14309 wfl node.
14310 (refine_accessible_methods_list): Changed comment, removed
14311 unnecessary code.
14312 * parse.h: Fixed typo in comments.
14313 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
14314 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
14315 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
14316 parser_ccb_indent.
14317 * lex.c (java_lex): Record the last closing curly bracket of a
14318 function.
14319 * jcf-parse.c (jcf_parse_source): Now calls
14320 java_check_methods. Clarified comment, fixed typo.
14321
14322 1998-04-09 Dave Brolley <brolley@cygnus.com>
14323
14324 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
14325 (finish_parse): Expose for non USE_CPPLIB builds.
14326
14327 1998-04-08 Jeffrey A Law (law@cygnus.com)
14328
14329 * lang.c (lang_print_xnode): New function.
14330
14331 1998-04-03 Per Bothner <bothner@cygnus.com>
14332
14333 * decl.c (class_dtable_decl), java-tree.h: New tree node.
14334 * class.c (get_dispatch_vector, get_dispatch_table): New functions
14335 used to build a class's dispatch table.
14336 (make_class_data): Generate dispatch table if flag_assume_compiled.
14337 Set dtable of class object to address of class_dtable_decl.
14338
14339 * decl.c (int_decl_processing): Make soft_badarrayindex_node
14340 be volatile and have side effects - generates better code.
14341
14342 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
14343 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
14344
14345 * expr.c (expand_invoke): If class is final, method is
14346 effectively final, so can call it directly.
14347
14348 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
14349
14350 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
14351
14352 1998-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
14353
14354 * parse.y (build_method_invocation_stmt): Removed extra argument
14355 to build_invoke.
14356
14357 1998-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
14358
14359 * expr.c (dtable_indent): Now static global.
14360 (expand_invoke): Now call invoke_build_dtable and
14361 build_invokevirtual.
14362 (invoke_build_dtable, build_invokevirtual): New functions.
14363 * jcf-io.c (find_class): Defer issuing a warning by setting
14364 jcf->outofsynch to 1.
14365 * jcf-parse.c (jcf_out_of_synch): New function.
14366 (load_class): Test this_jcf.outofsynch flag and call
14367 jcf_out_of_synch accordingly.
14368 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
14369 comment indentation.
14370 * lex.c (java_get_unicode): Fixed code indentation.
14371 (java_lex): Create string literal. Fixed typo. Removed several
14372 premature obstack_free.
14373 * parse.h: New enums for name resolution and invocation mode.
14374 (struct qualification): New data structure.
14375 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
14376 (do_resolve_class, build_method_invocation_stmt,
14377 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
14378 debug_line, identical_subpath_p, invocation_mode,
14379 refine_accessible_methods_list, build_invoke,
14380 lookup_method_invoke): New functions declared.
14381 (build_invokevirtual, invoke_build_dtable, match_java_method,
14382 build_field_ref, jcf_out_of_synch): New references to external
14383 functions.
14384 (struct parse_ctxt): Removed artificial_constructor field.
14385 * parse.y: (array_type:): Type defined for this rule.
14386 (class_type:): Installed default rule for interface_type:.
14387 (array_type:): Now build Java array type.
14388 (qualified_name:): Now use obstack_grow0.
14389 (method_declaration:): Skip the artificial constructor added to
14390 the list, if any.
14391 (abstract_method_declaration:): Execute the code only during pass 1.
14392 (block:): Installed default rule in block_statements:.
14393 (block_statement:): Add the statement to the method during pass 2.
14394 (statement_expression): Installed default rule for
14395 method_invocation:.
14396 (argument_list:): Added code to build the argument list.
14397 (method_invocation:): Added call to create the method invocation
14398 node.
14399 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
14400 (debug_line): New function for debug.
14401 (complete_class_decl): No longer do something during pass 1.
14402 (method_header): Use BUILD_PTR_FROM_NAME.
14403 (parser_qualified_classname): Use obstack_grow0. Removed bogus
14404 obstack_free.
14405 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
14406 function's main comment.
14407 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
14408 classes.
14409 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
14410 (resolve_class): Now works with arrays.
14411 (do_resolve_class, resolve_and_layout): New functions.
14412 (java_check_regular_methods): Reverse method list before and after
14413 having processed it. No longer set ctxp->artificial_constructor.
14414 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
14415 accordingly. Fixed typo in issued error message. Now use
14416 obstack_grow0.
14417 (find_in_imports_on_demand): Now use obstack_grow0.
14418 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
14419 (source_end_java_method): Call expand_expr_stmt instead of
14420 expand_expr. Calls it before calling expand_function_end.
14421 (java_method_add_stmt): Do nothing if errors were found during
14422 parsing.
14423 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
14424 (build_method_invocation_stmt, build_invoke, invocation_mode,
14425 lookup_method_invoke, refine_accessible_methods_list,
14426 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
14427 New functions.
14428 * typeck.c (build_java_signature): Properly end method signature
14429 if return type skipped.
14430 (match_java_method): New function.
14431
14432 1998-03-16 Per Bothner <bothner@cygnus.com>
14433
14434 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
14435
14436 1998-02-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
14437
14438 * expr.c (build_invoke_non_interface): New function.
14439 (methods_ident, ncode_ident): Now static globals.
14440 (expand_invoke): Use build_invoke_non_interface.
14441 * java-tree.h (struct lang_decl): New field function_decl_body.
14442 (DECL_FUNCTION_BODY): New macro.
14443 * jcf-parse.c (jcf_parse_source): Deeper check before setting
14444 CLASS_FROM_SOURCE_P.
14445 (parse_source_file): Fixed typos. Call java_layout_parsed_class
14446 before starting pass 2. Call to java_generate_parsed_class replaced
14447 by java_register_parsed_class.
14448 * lex.c: Fixed typo in header. Some line width related formating.
14449 * lex.h: Some line width related formating.
14450 * parse.h (source_end_java_method, resolve_expression_name,
14451 complete_class_decl, maybe_create_class_interface_decl,
14452 check_class_interface_creation): New static function declarations.
14453 (java_layout_parsed_class, java_method_add_stmt): New function
14454 declarations.
14455 (struct parser_ctxt): Field mark_class_generate removed. New
14456 fields class_list and artificial_constructor.
14457 * parse.y: Fixed typo in header.
14458 (class_declaration:): Call complete_class_decl when class body
14459 parsed.
14460 (method_declaration:): Call source_end_java_method in pass 2 when
14461 the method body is defined.
14462 (postfix_expression:): Do expression name resolution on sub-rule
14463 name during pass 2.
14464 (create_class, create_interface): Merged common pieces.
14465 (check_class_interface_creation, maybe_create_class_interface_decl):
14466 New functions.
14467 (complete_class_decl): New function.
14468 (register_fields): Fixed line width related typo.
14469 (method_header): Correctly skip first argument when fixing
14470 argument line. Changed the loop.
14471 (java_check_circular_reference): Now use ctxp->class_list.
14472 (java_complete_class): Removed start/stop marking.
14473 (java_check_regular_methods): Now takes a class decl as an
14474 argument. Add default constructor if none were encountered.
14475 (java_check_methods): Now use ctxp->class_list. Changed call to
14476 java_check_regular_methods.
14477 (source_start_java_method): Set DECL_ARG_TYPE for each function
14478 arguments.
14479 (source_end_java_method, java_method_add_stmt): New functions.
14480 (java_generate_parsed_class): No longer exists.
14481 (java_layout_parsed_class, java_register_parsed_class): New functions.
14482 (resolve_expression_name): New function.
14483
14484 1998-02-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
14485
14486 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
14487 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
14488 until pass initializations are done. Call read_import_dir with
14489 pass set to 0.
14490 * parse.h: (lookup_modifier_cl): New function declared.
14491 (INTERFACE_FIELD_MODIFIERS): New macro.
14492 (OBSOLETE_MODIFIER_WARNING): New macro.
14493 * parse.y: (register_fields): Class type and current field name in
14494 local variables. Check modifier(s) if adding field(s) to an interface.
14495 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
14496 and report errors using the faulty modifier line context.
14497 (lookup_modifier_cl): New function.
14498 (read_import_dir): Detect and report default import processing
14499 failure.
14500
14501 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
14502
14503 Add a pair of -fassume-compiled/-fno-assume-compiled options.
14504 * class.c (is_compiled_class): Return 1 after making sure it
14505 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
14506 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
14507 * java-tree.h (flag_assume_compiled): Add decl.
14508 * lang.c (lang_f_options): Add the flag.
14509 (flag_assume_compiled): Add decl, default to 0.
14510
14511 1998-02-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
14512
14513 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
14514 (is_compiled_class): Likewise.
14515 (layout_class): Likewise.
14516 (layout_class): Detect and lay out classes defined in source code.
14517 (interface_of_p, add_interface_do, may_add_interface): New
14518 function.
14519 (add_interface): Now use add_interface_do.
14520 (add_method_1): New function.
14521 (add_method): Now use add_method_1.
14522 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
14523 (complete_start_java_method): New function.
14524 (start_java_mehod): Now call complete_start_java_method.
14525 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
14526 (expand_invoke): Likewise and fixed typo.
14527 *gjava.c: (print_super_field): Use new argument to find_class
14528 DO_CLASS_FILE.
14529 (main): Likewise.
14530 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
14531 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
14532 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
14533 IDENTIFIER_NODE.
14534 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
14535 (add_method_1, push_class): New prototypes.
14536 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
14537 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
14538 directory where the class was found.
14539 (find_class): New argument DO_CLASS_FILE. Function find_class
14540 modified accordingly.
14541 *jcf-parse.c: (fix_class_path): New function.
14542 (load_class): Use new VERBOSE argument. load_class now finds and
14543 loads/parses .class/.java files. Save read_state of current_jcf
14544 if necessary.
14545 (java_parser_abort_on_error): New macro.
14546 (jcf_parse_source, parse_source_file): New function.
14547 (jcf_parse): Fixed typo.
14548 (yyparse): Call parse_source_file () only.
14549 (process_zip_dir): Fixed typo, fix zdir->filename_length when
14550 writing the real class name back in the zip directory entry.
14551 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
14552 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
14553 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
14554 (find_class): Prototype fixed.
14555 *lex.c: Added 1998 time stamp.
14556 Removed all static global variables, moved into the parser
14557 context data structure.. Now include unistd.h if SEEK_SET not
14558 defined.
14559 (java_init_lex): Rewritten.
14560 (java_sneak_unicode): Modified current unicode access in current line.
14561 (java_unget_unicode): Likewise.
14562 (java_allocate_new_line): New allocation management.
14563 (java_read_char): Modified access and storage of unget_utf8_value.
14564 New way of processing current unicode.
14565 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
14566 (java_get_unicode): Now use the parser context.
14567 (java_lineterminator): Likewise.
14568 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
14569 of the reentrant parser implementation. Function now use the
14570 parser context data structure and java_lval. Fixed production of
14571 the float and double constant "out of range" error message. Fixed
14572 obstack use. Return integer value when hitting a modifier. Now
14573 return type for TRUE, FALSE and other predefined types. Return
14574 identifier as a TREE_LIST list containing the current line context
14575 as the TREE_VALUE sub-node.
14576 (java_unicode_2_utf8): Fixed typo in declaration.
14577 (java_lex_error): Now use the parser context data structure.
14578 *lex.h: Added 1998 time stamp.
14579 (struct java_line): New fields ref_count and next.
14580 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
14581 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
14582 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
14583 *parse.h: Added 1998 time stamp.
14584 (java_parse_source_file): Renamed from parse_source_file.
14585 (YYERROR_NOW, YYNOT_TWICE): Fixed.
14586 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
14587 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
14588 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
14589 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
14590 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
14591 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
14592 (struct parser_ctxt): New data structure to keep the parser context.
14593 *parse.y: Added 1998 time stamp, got rid of static global variables.
14594 (java_error_count, ctxp): New global variables.
14595 (%union): New value field.
14596 (numeric_type, integral_type): Rules removed.
14597 (primitive_type): Rule defined to handle integral, float, double and
14598 boolean types.
14599 (qualified_name, package_declaration,
14600 single_type_import_declaration, type_import_on_demand_declaration,
14601 modifiers, class_declaration, super, interfaces,
14602 interface_type_list, class_body, field_declaration,
14603 field_declaration, variable_declarators, variable_declarator,
14604 variable_declarator_id, method_declaration, method_header,
14605 formal_parameter_list, formal_parameter, method_body, block,
14606 static, interface_declaration, extends_interfaces,
14607 abstract_method_declaration, local_variable_declarators): Rules now
14608 define actions.
14609 (force_error, do_warning): New global statics.
14610 (push_parser_context, parser_context_save_global,
14611 parser_context_restore_global, pop_parser_context): New functions.
14612 (yyerror): Now uses the global parser context. Fixed use of obstack.
14613 (parse_error, parse_error_context, parse_warning_context,
14614 java_accstring_lookup, redefinition_error, check_modifiers,
14615 parser_add_interface, create_interface, create_class, find_field,
14616 duplicate_declaration_error, register_fields, method_header,
14617 check_modifiers_consistency, check_abstract_method_header,
14618 method_declarator, parser_qualified_classname,
14619 parser_check_super_interface, parser_check_super,
14620 parser_chain_incomplete_item, java_check_circular_reference,
14621 layout_class_from_source, java_complete_class,
14622 complete_method_decl, resolve_class, complete_class_report_errors,
14623 java_check_final, check_method_redefinition,
14624 java_check_regular_methods, java_check_abstract_methods,
14625 java_check_methods, lookup_java_interface_method2,
14626 lookup_java_method2, lookup_cl, find_name_in_single_imports,
14627 process_imports, find_in_imports, read_import_entry,
14628 read_import_dir, find_in_imports_on_demand,
14629 check_pkg_class_access, not_builtin_p, declare_local_variables,
14630 source_start_java_method, java_generate_parsed_class): New
14631 functions.
14632 *typeck.c: (signature_include_return): New global variable.
14633 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
14634 to add the function returned type in the signature.
14635
14636 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
14637
14638 * jcf-io.c (open_in_zip): Use strncmp and LEN.
14639
14640 1998-01-29 Dave Brolley <brolley@cygnus.com>
14641
14642 * Make-lang.in (java.info): Added.
14643 (java.install-info): Added
14644
14645 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
14646
14647 * Makefile.in (clean): Also remove java/parse.c.
14648
14649 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
14650
14651 Add a pair of -fbounds-check/-fno-bounds-check options.
14652 * lang.c (lang_decode_option): Add code to grok arguments.
14653 (flag_bounds_check): Add decl.
14654 (lang_f_options): New array w/ the option in it.
14655 * java-tree.h (flag_bounds_check): Add decl.
14656 * lang-options.h: New file.
14657 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
14658 of a static macro value.
14659 (JAVA_ARRAY_EXCEPTION): Delete macro.
14660
14661 1998-01-23 Per Bothner <bothner@cygnus.com>
14662
14663 * typeck.c (build_java_array_type): Fix two bugs in previous change.
14664 * expr.c (build_anewarray): Add missing promote_type.
14665
14666 1998-01-22 Per Bothner <bothner@cygnus.com>
14667
14668 Add array types with known length to optimize bounds checking.
14669 * typeck.c (build_java_array_type): Take length parameter.
14670 (java_array_type_length, build_prim_array_type): New functions.
14671 * java-tree.h: Update for new functions.
14672 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
14673 * class.c: Use build_prim_array_type.
14674 * expr.c (can_widen_reference_to): Handle known-length array types.
14675 (verify_jvm_instructions): Keep track of integer push instructions
14676 followed by newarray/anewarray, so we can build known-length arrays.
14677 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
14678 (java_array_data_offset): New function.
14679 (build_java_array_length_access): New function. Optimize if constant.
14680 (build_java_arrayaccess): Constant fold bounds check.
14681 (expand_java_newarray, expand_java_anewarray): Replaced by ...
14682 (build_newarray, build_anewarray): New functions.
14683 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
14684 * verify.c (merge_types): Handle known-lengh array types.
14685
14686 1998-01-19 Per Bothner <bothner@cygnus.com>
14687
14688 * expr.c (expand_byte_code): Fix performace bug, which caused
14689 searching linenumber_table to be linear rather than constant.
14690
14691 1997-12-12 Per Bothner <bothner@cygnus.com>
14692
14693 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
14694
14695 * decl.c, java-tree.h (soft_fmod_node): New global.
14696 * decl.c (init_decl_processing): Define __builtin_fmod.
14697 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
14698 using __builtin_fmod.
14699
14700 1997-12-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
14701
14702 * keyword.h: New file, output of keyword.gperf as processed by
14703 gperf.
14704 * lex.c (java_lex_init): Initialize java_error_flag.
14705 * parse.c (YYERROR_NOW): Uses java_error_flag.
14706 * parse.y: New static java_error_flag. Useless definition of
14707 buffer_error gone.
14708 * parse.y (java_error): Portable error recovery using
14709 java_error_flag (not yet completely tuned).
14710
14711 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
14712
14713 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
14714
14715 1997-12-03 Alexandre Petit-Bianco <apbianco@cygnus.com>
14716
14717 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
14718 (parse.c, lex.c, keyword.h): New rules for Java source code
14719 front-end.
14720 * parse.c: Renamed into jcf-parse.c.
14721 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
14722 * keyword.gperf: New file, Java keywords.
14723 * parse.y: New file, Java language grammar.
14724 * parse.h: New file, Java language grammar definitions.
14725 * lex.c: New file, Java language lexer.
14726 * lex.h: New file, Java language lexer definitions.
14727
14728 1997-12-03 Per Bothner <bothner@cygnus.com>
14729
14730 * decl.c (clinit_identifier_node), java-tree.h: New global.
14731 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
14732 * verify.c (verify_jvm_instructions): Inline use of removed macros.
14733 * expr.c (expand_java_field_op): Check for invalid assignment
14734 to final field.
14735
14736 * jcf-reader.c (get_attribute): Test for wrong attribute length.
14737
14738 1997-10-27 Per Bothner <bothner@cygnus.com>
14739
14740 * verify.c (verify_jvm_instructions): When processing a handler,
14741 attempt to set the current_subr to the right value.
14742 (More complicated code combines Sep 17 and Oct 22 versions.)
14743
14744 1997-10-24 Per Bothner <bothner@cygnus.com>
14745
14746 * class.c (push_class): Figure out (guess) name of source file.
14747 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
14748 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
14749 (parse_class_file): Change return type from int to void.
14750 Call debug_start_source_file/debug_end_source_file.
14751
14752 * expr.c (build_java_binop): Fix masking 2nd operand.
14753 * decl.c (init_decl_processing): Set sizetype first.
14754
14755 1997-10-22 Per Bothner <bothner@cygnus.com>
14756
14757 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
14758 (Revert Sep 17 change.)
14759
14760 1997-10-21 Alexandre Petit-Bianco <apbianco@cygnus.com>
14761
14762 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
14763 .class extension in their name and fix thing so we don't process
14764 them parse_zip_file_entries().
14765 (parse_zip_file_entries): Cleaned unused local variables.
14766
14767 1997-10-20 Per Bothner <bothner@cygnus.com>
14768
14769 * expr.c (can_widen_reference_to): Allows equal array element types.
14770 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
14771 * jcf-dump.c (RET): Get (and print) index.
14772
14773 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
14774 Promote element type to POINTER_TYPE.
14775
14776 1997-10-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
14777
14778 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
14779 find_in_current_zip, jcf_figure_file_type): Moved from
14780 jcf-reader.c to parse.c.
14781 * zextract.c: (read_zip_archive): takes file_comment_length possible
14782 field into account.
14783
14784 1997-10-20 Per Bothner <bothner@cygnus.com>
14785
14786 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
14787
14788 * verify.c (merge_types): Handle array types even better ...
14789
14790 1997-10-17 Per Bothner <bothner@cygnus.com>
14791
14792 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
14793
14794 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
14795 * class.c (make_class_data): Don't build fields_decl if no fields.
14796 When building fields_decl, skip if DECL_ARTIFICIAL.
14797
14798 * expr.c (java_stack_swap): Update stack_type_map.
14799 * verify.c (merge_types): Handle array types better.
14800
14801 1997-10-15 Per Bothner <bothner@cygnus.com>
14802
14803 * class.c (add_field): Don't promote short integral fields to
14804 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
14805 * expr.c (push_value): Promote and convert short integral values.
14806
14807 * decl.c, java-tree.h (integer_two_node): New constant node.
14808 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
14809
14810 1997-10-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
14811
14812 * class.c (append_gpp_mangled_type): Use function argument
14813 unpromoted type to generate mangled name.
14814
14815 1997-10-13 Alexandre Petit-Bianco <apbianco@cygnus.com>
14816
14817 * constants.c (build_constant_data_ref): Now uses current_class
14818 instead of main_class.
14819 (build_constants_constructor): Now uses current_class instead of
14820 main_class.
14821 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
14822 of the global variable SeepZipFiles done here.
14823 * zextract.c (read_zip_archive): extra_field optional field taken
14824 into account while computing the position of the class file in the
14825 archive.
14826 * verify.c (verify_jvm_instructions): Use current_jcf to search
14827 the constant pool.
14828 * parse.c (load_class): First search for the class to load in the
14829 current zip file. Saves current_jcf (restored before returning
14830 from that function). Don't call JCF_FINISH in the class was found
14831 in the current ZIP file.
14832 (jcf_parse): If the class was found in the current ZIP file, save
14833 its tree_constant_pool (for later reuse).
14834 (parse_class_file): New function. Process each method defined in
14835 the current class and record the class as to be later registered.
14836 (yyparse): Rewritten. Figure the type of the current file and switch
14837 accordingly.
14838 * lang.c: New global variable current_jcf.
14839 (lang_init): Removed compiling_from_source test (done later, in
14840 yyparse). Removed call the jcf_parse ().
14841 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
14842 (typedef struct JCF): New fields seen_in_zip (to mark a class found
14843 in the current ZIP file) and zip_offset (offset to the class data in
14844 the current zip file).
14845 * jcf-reader.c: zipfile.h included.
14846 localToFile: New ZipFileCache static global variable
14847 (parse_zip_file_entries): New function. Browse the current ZIP
14848 file directory and process each class found.
14849 (process_zip_dir): New function. Register each class found in the
14850 ZIP file directory. The class aren't parsed but a valid JCF is
14851 link to each of them.
14852 (find_in_current_zip): New function. Search for a class in the
14853 current ZIP file directory. If found, prepare the class so that it
14854 can be loaded.
14855 (jcf_figure_file_type): New function. Examine the file structure
14856 to figure a class file, a ZIP file. If none of these categories are
14857 matched, a source file is assumed.
14858 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
14859 SeenZipFile: New global variable.
14860 (open_in_zip): Use zipmember's length to accelerate the search for
14861 a member. If zipmember was NULL and zip file successfully read,
14862 return 0.
14863 * java-tree.h: New global variable current_jcf declared. Added
14864 declaration for current_constant_pool_tags, current_constant_pool_data,
14865 current_constant_pool_length, current_constant_pool_data_ref.
14866 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
14867 store the JCF of classes seen in a zip file) and tree *constant_pool
14868 (to save a loaded class constant pool). current_class declared here.
14869 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
14870 retrieve method_ref_constant.
14871 (PUSHC): java_push_constant_from_pool now uses current_jcf.
14872 (OBJECT): get_class_constant now uses current_jcf.
14873 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
14874 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
14875 (expand_invoke): Now uses current_class instead of main_class
14876 (build_class_init): Now uses current_class instead of main_class
14877 * class.c: New static global variable registered_class.
14878 (register_class): New function.
14879 (emit_register_class): Modified to use registered_class instead of
14880 main_class
14881 (is_compiled_class): Now take into account class seen in the archive.
14882
14883 1997-10-06 Per Bothner <bothner@cygnus.com>
14884
14885 * except.h: Renamed to: java-except.h.
14886 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
14887 * except.c: Add semi-working (commented out) implementation.
14888
14889 * expr.c (expand_iinc): Add needed flush_quick_stack.
14890 * parse.c (set_source_filename): New function.
14891 (give_name_to_class): Set input_filename from package.classname.java.
14892
14893 * jcf-io.c (find_class): Don't look first in ".".
14894
14895 1997-10-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
14896
14897 * zextract.c (read_zip_archive): Now takes into account the
14898 extra_field field.
14899 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
14900
14901 1997-09-20 Per Bothner <bothner@cygnus.com>
14902
14903 * constants.c, java-tree.h (build_internal_class_name): New function.
14904 (alloc_class_constant): Re-implement using build_internal_class_name.
14905 * class.c (make_class_data): Likewise.
14906 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
14907
14908 1997-09-17 Per Bothner <bothner@cygnus.com>
14909
14910 * verify.c (verify_jvm_instructions): Temporarily set current_subr
14911 to NULL before pushing an exception handler target.
14912
14913 * expr.c (flush_quick_stack): Save from low stack indexes to high.
14914 (java_stack_swap, java_stack_dup): Re-write to be safe from
14915 clobbering registers.
14916 (build_class_init): New function.
14917
14918 1997-09-17 Alexandre Petit-Bianco <apbianco@cygnus.com>
14919
14920 * typeck.c (build_java_array_type): Temporary use
14921 permanent_obstack to create the array 'length' field.
14922 * expr.c (lookup_label): Temporay use permanent_obstack to create
14923 label if not found.
14924 * class.c (push_super_field): Tempory use permanent_obstack.
14925
14926 1997-09-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
14927
14928 * typeck.c (type_for_mode): Now handles double_type_node and
14929 float_type_node.
14930 * verify.c (verify_jvm_instructions): The instruction following
14931 the wide bytecode is checked. OPCODE_ret added to the list of
14932 wide.
14933
14934 1997-09-11 Alexandre Petit-Bianco <apbianco@cygnus.com>
14935
14936 * class.c (make_class): Temporary use permanent_obstack. Set the
14937 class CLASS_P field to 1.
14938 (push_class): Temporary use permanent_obstack.
14939 (set_super_info): Temporary use permanent_obstack.
14940 (add_method): Temporary use permanent_obstack, set
14941 METHOD_TRANSIENT().
14942 (add_field): Temporary use permanent_obstack. Sets
14943 FIELD_VOLATILE() and FIELD_TRANSIENT().
14944 (build_class_ref): Temporary use permanent_obstack if the class
14945 isn't compiled.
14946 (build_static_field_ref): Temporary use permanent_obstack when
14947 creating field's rtl.
14948 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
14949 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
14950 and fields. Function finalized, as far as flag handling.
14951 (push_class_static_dummy_field): Temporary use permanent_obstack.
14952 (emit_register_class): Force generation of class registration at
14953 -O3 or deeper.
14954 * decl.c (end_java_method): Call permanent_allocation() before
14955 returning.
14956 * expr.c (can_widen_reference_to): Added comment to interface
14957 handling, fixed typo.
14958 (lookup_field): Now uses CLASS_P() to correct FIXME
14959 (expand_invoke): Verification on public && !static &&
14960 !abstract moved into soft_lookupinterfacemethod (kaffe).
14961 Use Object class dtable if objectref is an array when expanding
14962 invokeinterface.
14963 (java_push_constant_from_pool): Temporary use permanent_obstack
14964 for CONSTANT_string
14965 * parse.c (get_ref_constant): Temporary use permanent_obstack to
14966 create constant references.
14967 (get_constant): Temporary use permanent_obstack to create constant.
14968 (load_class): Temporary use permanent_obstack to load class.
14969 (jcf_parse): Temporary use permanent_obstack to perform class
14970 layout.
14971 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
14972 (build_java_signature): Temporary use permanent_obstack.
14973 * verify.c: (verify_jvm_instruction): removed unnecessary verification
14974 on ACC_SUPER flag.
14975 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
14976 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
14977 (CLASS_P): Defined
14978
14979 1997-09-11 Per Bothner <bothner@cygnus.com>
14980
14981 * class.c (append_gpp_mangled_type): Fix typo.
14982 (emit_register_class): Use main_class to get class object, rather
14983 than looking for no-longer-existing static decl starting with _CL.
14984 * typeck.c (parse_signature_type): Promote array element type
14985 if it is a RECORD_TYPE.
14986
14987 1997-09-10 Per Bothner <bothner@cygnus.com>
14988
14989 * class.c (push_class_static_dummy_field): New function.
14990 (mangle_static_field): New. Do G++-style mangling of static fields.
14991 (layout_class): Mandle static fields here, not in add_field.
14992 (build_class_ref): The class object is now a dummy static field.
14993 * decl.c (find_local_variable): Look for best, instead of first match.
14994 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
14995 (build_java_athrow): Don't check here if exception is Throwable.
14996 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
14997 (TYPE_USED): Removed. No longer used ...
14998 * parse.c (jcf_parse): Call push_class_static_dummy_field.
14999 * verify.c (push_pending_label): New function.
15000 (push_pending_block): Renamed to check_pending_block.
15001 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
15002 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
15003 re-checking possible handlers) after a store (less wasted work).
15004 Check for null handler (finally) before calling add_handler.
15005 Various changes to (finally?) correctly handle try/finally.
15006
15007 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
15008
15009 * class.c: Include stdio.h.
15010
15011 1997-09-04 Per Bothner <bothner@cygnus.com>
15012
15013 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
15014 to make sure class is initialized before static/special invoke.
15015
15016 * verify.c (verify_jvm_instructions): On a store instruction,
15017 call find_local_variable to force pre-allocation of decl and rtx.
15018 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
15019
15020 1997-09-03 Per Bothner <bothner@cygnus.com>
15021
15022 * class.c (build_class_ref): Strip off "promoted_" if need be.
15023 (make_field_value): Call build_java_signature when needed.
15024 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
15025 * expr.c (build_java_athrow): Don't push_value of exception.
15026 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
15027 match specification of [fd]cmp[lg] for NaNs.
15028 (expand_byte_code): Add support for exception handler ranges.
15029 * except.c: Add skeleton for EH code-generation.
15030 * verify.c (merge_types): Treat all promoted integral types as equal.
15031 * constants.c (build_constants_constructor): To force creation of
15032 current_constant_pool_data_ref, call build_constant_data_ref.
15033
15034 * javaop.def (lload): Fix typo.
15035 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
15036
15037 1997-09-02 Brendan Kehoe <brendan@lisa.cygnus.com>
15038
15039 * parse.c: Don't include function.h.
15040
15041 1997-08-27 Per Bothner <bothner@cygnus.com>
15042
15043 * except.[ch]: New files.
15044 * Makefile.in (JAVA_OBJS): Add except.o
15045 * expr.c: Temporary warning about unimplemented exceptions.
15046 * verify.c: Verify exception handlers.
15047
15048 * jcf-dump.c (disassemble_method): Print exception table.
15049
15050 1997-08-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
15051
15052 * expr.c (verify_jvm_instructions): Started a thorough
15053 verification of invoke* bytecodes.
15054 (expand_byte_code): flush quick stack if PC is the target of a
15055 branch. and undef RET (conflicting with config/i386/i386.h).
15056 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
15057 used.
15058 (expand_invoke): Now handles invokeinterface and do more
15059 verification according to the bytecode.
15060 (lookup_field): Don't try to load the class if processing
15061 dtable_type.
15062 (can_widen_reference_to): Now handles interfaces.
15063 * decl.c (init_decl_processing): New global variable
15064 soft_lookupinterfacemethod_node, declared in java-tree.h.
15065 Call set_super_info on string_type_node.
15066 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
15067 defined.
15068 * class.c (set_super_info): Fills the CLASS_* flags according to
15069 access_flags.
15070 (get_access_flags_from_decl): Handles all class flags.
15071
15072 1997-08-26 Per Bothner <bothner@cygnus.com>
15073
15074 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
15075 * parse.c (yyparse): Check for abstract method, and missing code.
15076 * expr.c (expand_byte_code): Change interface.
15077 * lang.c (put_decl_node): Print promoted types prettier.
15078 * verify.c (verify_jvm_instruction): Change interface.
15079 Partial support for scanning exception table.
15080 For load instructions, handle promoted integral types.
15081
15082 1997-08-21 Per Bothner <bothner@cygnus.com>
15083
15084 * verify.c: New file, with contents moved from expr.c.
15085 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
15086 * typeck.c (is_array_type_p): Moved here from expr.c.
15087 * java-tree.h: Add some now-needed function declarations.
15088 * Makefile.in (JAVA_OBJS): Added verify.o.
15089
15090 1997-08-20 Alexandre Petit-Bianco <apbianco@cygnus.com>
15091
15092 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
15093 METHOD_ABSTRACT flag.
15094
15095 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
15096 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
15097 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
15098
15099 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
15100 variables.
15101 (start_java_method): Hook for SYNCHRONIZED methods.
15102
15103 * expr.c (build_java_jsr, build_java_ret): New functions
15104 (JSR,PRE): New macros
15105 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
15106 (verify_jvm_instructions): tableswitch, lookupswitch,
15107 monitorenter, monitorexit, goto_w: verified.
15108 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
15109 (build_java_monitor): New function.
15110 (MONITOR_OPERATION): Modified to call build_java_monitor()
15111 (verify_jvm_instructions): Started a thorough verification of
15112 invoke* bytecodes.
15113
15114 1997-08-19 Per Bothner <bothner@cygnus.com>
15115
15116 Support verification of jsr/ret subroutines (used for try/finally).
15117 * decl.c (return_address_type_node): New type node.
15118 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
15119 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
15120 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
15121 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
15122 TYPE_USED): New macros for special types in type_map.
15123
15124 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
15125 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
15126 BCODE_JUMP_TARGET.
15127 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
15128
15129 * expr.c (can_widen_reference_to): New function.
15130 (pop_type): Use it.
15131 (merge_type_state): Support handling start of subroutine.
15132 (push_pending_block): Return char* error message, instead of calling
15133 fatal on an error. Also handle subroutines.
15134 (verify_jvm_instructions): Handle errors from push_poending_block.
15135 Support jsr and ret instructions.
15136
15137 1997-08-19 Per Bothner <bothner@cygnus.com>
15138
15139 * jcf-io.c (find_classfile): Fix thinko.
15140 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
15141
15142 1997-08-12 Jason Merrill <jason@yorick.cygnus.com>
15143
15144 * Makefile.in (BISON): Remove.
15145
15146 1997-08-07 Per Bothner <bothner@cygnus.com>
15147
15148 * Makefile.in: Convert to autoconf.
15149 * config-lang.in (outputs): Added java/Makefile.
15150
15151 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
15152 Rename cc1java to jc1.
15153
15154 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
15155 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
15156
15157 * class.c (class_depth): Do load_class if needed.
15158
15159 Mostly better verification.
15160 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
15161 (init_decl_processing): Change return type of soft_checkcast.
15162 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
15163 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
15164 lang_print_error): New functions.
15165 (lang_init): Set global hook print_error_function to lang_print_error.
15166 * expr.c: In the type_map ptr_type_node is only used for null now.
15167 (pop_type, merge_types): Hence ptr_type_node matches any reference.
15168 (merge_types): Dererence pointer to record types before comparing.
15169 (decode_newarray_type, merge_types): On error just return NULL.
15170 (build_java_binop): Add preliminary implementation (with warning)
15171 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
15172 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
15173 (expand_compare, expand_java_goto, expand_java_call): Don't
15174 push_pending_block, since that only makes sense when verifying.
15175 (merge_type_state): Different return codes.
15176 (push_pending_block): A block may need to be verified more than once.
15177 (expand_byte_code): Warn about unused code at code generation time.
15178 (verify_jvm_instruction): Changed logic, since code may need to be
15179 re-verified if type-state has changed. Also, better error handling.
15180 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
15181 Improve newarray, anewarray, ?aload, athrow,
15182 * java-tree.h (LABEL_CHANGED): New macro.
15183
15184 1997-08-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
15185
15186 * decl.c (soft_athrow_node): New global variable initialized.
15187 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
15188 * typeck.c (convert): Added support for REAL_TYPE.
15189 (convert_to_char): New function.
15190 (convert): Handle CHAR_TYPE.
15191 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
15192 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
15193 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
15194 promoted type.
15195 (verify_jvm_instructions): Added break a the end of bogus unop: label.
15196 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
15197 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
15198 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
15199 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
15200 to Use The Right Things.
15201 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
15202 compatible with INT. BOOLEAN is made equivalent to BYTE.
15203 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
15204 OPCODE_ifnonnull): Now supported.
15205 (build_java_athrow): New function.
15206
15207 1997-08-04 Per Bothner <bothner@cygnus.com>
15208
15209 Rename method name <init> to match G++ (and fix mangling).
15210 * class.c (layout_class): Replace method name of <init> by class name.
15211 (make_method_value): Do inverse renaming of constructor from <init>.
15212 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
15213 * typeck.c (lookup_java_constructor): New function.
15214 * expr.c (expand_invoke): If method_name is <init>, call
15215 lookup_java_constructor to find constructor.
15216
15217 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
15218
15219 1997-08-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
15220
15221 * parse.c (get_class_constant): Modified to handle array "classes"
15222 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
15223 wide type.
15224 (convert): Modified to handle real type.
15225 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
15226 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
15227 variables declared.
15228 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
15229 soft_multianewarray, soft_newarray_node, soft_throw_node): New
15230 global variables initialized.
15231 (find_local_variable): Handles the case of a pointer
15232 (end_java_method): Restore the use of one more scope
15233 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
15234 build_java_array_length_access, expand_java_arrayload,
15235 expand_java_arraystore, expand_java_array_length,
15236 expand_java_multianewarray, expand_java_anewarray,
15237 build_java_check_indexed_type, is_array_type_p,
15238 build_java_throw_out_of_bound_exception): New functions.
15239 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
15240 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
15241 OPCODE_<t>aload): Implemented code for verification.
15242 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
15243 ARRAY_NEW_MULTI): Macro defined.
15244 (CONVERT): Modified to invoke convert().
15245 (case OPCODE_aload2): Fixed index typo from 2 to 1.
15246
15247 1997-07-31 Per Bothner <bothner@cygnus.com>
15248
15249 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
15250 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
15251 (make_class_data): Field name needs '/' as package prefix.
15252 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
15253
15254 1997-07-25 Per Bothner <bothner@cygnus.com>
15255
15256 Implement debug information for local variables.
15257 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
15258 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
15259 DECL_LOCAL_SLOT_CHAIN): New macros.
15260 (struct lang_decl_var): New type.
15261 * parse.c (give_name_to_locals): Move to decl.c.
15262 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
15263 (start_java_method): Re-write parameter handling.
15264 (pending_local_decls): New global variable.
15265 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
15266 (find_local_variable): Accept pc so we can skips decls not in range.
15267 (struct binding_level): Add end_pc field.
15268 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
15269 (various): Change so current pc gets passed to find_local_variable.
15270
15271 * decl.c (init_decl_processing): Re-arrange fields in
15272 class_type_node and and method_type_node to match kaffe 0.9.1.
15273 * class.c (make_method_value, make_class_data): Update
15274 initializations to match.
15275
15276 1997-07-16 Per Bothner <bothner@cygnus.com>
15277
15278 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
15279 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
15280 (push_super_field): New function.
15281 (make_class_data): Handle inheritance of class static initializer.
15282 (layout_class): New name mangling.
15283 * constants.c (build_constant_data_ref): Init type of data array
15284 to a one-element array.
15285 (build_constants_constructor): Set DECL_SIZE from complete array type.
15286 * decl.c: Rename class_type, object_type etc to class_type_node,
15287 object_type_node etc. Make former inherit from latter.
15288 * expr.c (expand_invoke): Add cast of function address.
15289 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
15290 * parse.c (yyparse): Don't call layout_class here.
15291 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
15292
15293 1997-06-14 Per Bothner <bothner@cygnus.com>
15294
15295 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
15296 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
15297 (alloc_class_constant): New.
15298 * expr.c (expand_invoke): Make sure method's class is initialized.
15299 * class.c (interits_from_p, emit_register_class): New functions.
15300 * parse.c (yyparse): Call emit_register_class.
15301
15302 1997-06-09 Per Bothner <bothner@cygnus.com>
15303
15304 * constants.c: New file, to handle constant pool.
15305 * Makefile.in (JAVA_OBJS): Add constants.o.
15306 * decl.c (init_decl_processing): Update, fix, finish various structs.
15307 (pushdecl_top_level): New.
15308 * parse.c (layout_class): Moved to class.c.
15309 * expr.c (java_push_constant_from_pool): New function.
15310 * class.c (build_class_ref): Make work fully
15311 (make_class_data): Emit super-class, constant pool, interface vector.
15312
15313 1997-06-03 Per Bothner <bothner@cygnus.com>
15314
15315 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
15316 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
15317 * class.c (class_depth): New function.
15318 (lookup_named_class): Replaced by new function lookup_class.
15319 * decl.c (object_type_node, string_type_node): New.
15320 Remove various types that we no longer need.
15321 * expr.c (verify_jvm_instructions): New separate verifier pass.
15322 (push_type, pop_type): New functions for verifier.
15323 (type_stack_dup, pop_argument_types, merge_types): Likewise.
15324 (expand_byte_code): Simplify, since we assume already verified.
15325 (expand_invoke): Now mostly works.
15326 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
15327 * lang.c (main_class): Move to parse.c. Don't make_class yet.
15328 * parse.c: Wait to allocate class object until we know its name.
15329 (layout_class): Calculate DECL_VINDEX for each virtual method.
15330 * typeck.c (get_array_type): Rename to ...
15331 (build_java_array_type): ... and provide working implementation.
15332 (build_java_signature): New function - build Java signature of type.
15333 (set_java_signature): New function - cache signature with type.
15334 (lookup_java_method): New function.
15335
15336 1997-05-06 Per Bothner <bothner@deneb.cygnus.com>
15337
15338 * class.c (ident_subst): Take extra SUFFIX parameter.
15339 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
15340 (set_constant_value, build_static_field_ref, is_compiled_class): New.
15341 (build_class_ref): Actually implement.
15342 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
15343 * decl.c (builtin_function): New.
15344 (init_decl_processing): Update for current Kaffe. Declare some
15345 builtin Kaffe functions.
15346 * expr.c (build_address_of): New.
15347 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
15348 Renamed (from expand_java_new etc), and added working implementations.
15349 (build_field_ref): Now also handle static fields.
15350 (expand_invoke): Implement invokestatic, and start implement rest.
15351 * java-opcodes.h: Use javaop.def to avoid duplicated list.
15352 * javaop.def: Rename invokevirt -> invokevirtual.
15353 * lang.c (use_handles): Removed.
15354 * parse.c: Add support for ConstantValue attribute.
15355 Handle nested loading of a class. (JPOOL_UTF): New.
15356
15357 1997-03-11 Per Bothner <bothner@deneb.cygnus.com>
15358
15359 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
15360
15361 1997-02-27 Per Bothner <bothner@deneb.cygnus.com>
15362
15363 * Make-lang.in (java.install-man): New empty rule.
15364 * typeck.c (set_local_type): New function.
15365 * expr.c (STORE_INTERNAL): Call find_local_variable,
15366 not find_stack_slot. Call set_local_type.
15367
15368 1997-02-12 Per Bothner <bothner@kalessin.cygnus.com>
15369
15370 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
15371 and building RECORD_TYPE CONSTRUCTORs.
15372 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
15373
15374 * lang.c (use_handles): Change the default to 0.
15375 * decl.c: Define and build class_type, field_type, utf8const_type.
15376 * class.c (make_class_data, make_field_value,
15377 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
15378 hashUtf8String, strLengthUtf8, mangled_classname:
15379 Functions to build reflective data structures.
15380 * parse.c (yyparse): Call make_class_data.
15381
15382 * jcf-io.c (open_class, find_classfile): New functions.
15383 * jcf-dump.c: Support reading classfile from explicitly-named
15384 class file (without CLASSPATH searching).
15385
15386 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>
15387
15388 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
15389 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
15390 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
15391 (get_constant): Now trivial for CONSTANT_Utf8.
15392
15393 * jcf.h: Make NEW_CPOOL the default.
15394 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
15395
15396 1996-10-24 Per Bothner <bothner@deneb.cygnus.com>
15397
15398 New directory.