]> gcc.gnu.org Git - gcc.git/blame - gcc/java/ChangeLog
re GNATS java.util/47 (Date.toString() returns embedded newline)
[gcc.git] / gcc / java / ChangeLog
CommitLineData
26db82d8
BS
1Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
2
3 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
4 FUNCTION_CODE now of type int. All callers changed.
5 Set the builtin's DECL_BUILT_IN_CLASS.
6
0cffaca3
TT
71999-09-23 Tom Tromey <tromey@cygnus.com>
8
9 * jvspec.c (lang_specific_driver): Don't read spec file if
10 -fsyntax-only given.
11
bad1e2ac
TT
121999-09-22 Tom Tromey <tromey@cygnus.com>
13
ba020951
TT
14 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
15
bad1e2ac
TT
16 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
17 (WORDS_TO_LONG): Likewise.
18 (WORDS_TO_DOUBLE): Likewise.
19
7161fcc7
AS
201999-09-15 Andreas Schwab <schwab@suse.de>
21
22 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
23
03d32d1a
NC
241999-09-20 Nick Clifton <nickc@cygnus.com>
25
26 * lang.c (lang_decode_option): Extend comment.
27
b771925e
APB
28Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
29
30 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
31 instead of fndecl.
32
c2e3db92
KG
331999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
34
35 * gjavah.c (get_field_name, print_method_info, print_include,
36 add_namelet): Use xmalloc, not malloc.
37
38 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
39 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
40 NULL pointer.
41
42 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
43
44 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
45
46 * jcf-path.c (add_entry): Likewise.
47
48 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
49
50 * jv-scan.c (xmalloc): Remove definition.
51
52 * jvgenmain.c (xmalloc): Likewise.
53
54 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
55
56 * lex.c (java_store_unicode): Use xrealloc, not realloc.
57
58 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
59 concat, not xmalloc/sprintf.
60 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
61 (xstrdup): Remove definition.
62
63 * parse.y (duplicate_declaration_error_p,
64 constructor_circularity_msg, verify_constructor_circularity,
65 check_abstract_method_definitions, java_check_regular_methods,
66 java_check_abstract_methods, patch_method_invocation,
67 check_for_static_method_reference, patch_assignment, patch_binop,
68 patch_cast, array_constructor_check_entry, patch_return,
69 patch_conditional_expr): Use xstrdup, not strdup.
70
71 * zextract.c (ALLOC): Use xmalloc, not malloc.
72
9257393c
KG
73Sun Sep 12 23:30:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
74
75 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
76
77 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
78 (do_spec, lang_specific_pre_link, lang_specific_driver,
79 input_filename, input_filename_length): Don't declare.
80 (main_class_name, jvgenmain_spec, lang_specific_driver):
81 Constify a char*.
82 (lang_specific_driver): All calls to the function pointer
83 parameter now explicitly call `fatal'.
84
f4e16489
APB
85Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
86
87 * parse.y (find_applicable_accessible_methods_list): Search
88 abstract classes as interfaces.
89
fcf6eeb6
APB
90Thu Sep 9 17:33:28 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
91
92 * class.c (finish_class): We're now outside a valid method
93 declaration. Tell the rest of gcc so.
94
512d594b
TT
951999-09-07 Tom Tromey <tromey@cygnus.com>
96
97 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
98 java-array.h.
99 (decode_signature_piece): Don't emit "::" in JArray<>.
100 (print_namelet): Only print trailing `;' when printing a class.
101
81b3411c
BS
102Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
103
104 * java-tree.h: Delete declarations for all tree nodes now moved to
105 global_trees.
106 * decl.c: Delete their definitions.
107
6308c574
MM
1081999-09-04 Mark Mitchell <mark@codesourcery.com>
109
110 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
111 * Makefile.in (OBJS): Add ggc-callbacks.o.
112 (OBJDEPS): Likewise.
113
2f11d407
TT
1141999-09-03 Tom Tromey <tromey@cygnus.com>
115
116 * parse.y (strip_out_static_field_access_decl): Return operand if
117 it satisfies JDECL_P.
118
3a5395a3
TT
1191999-09-02 Tom Tromey <tromey@cygnus.com>
120
121 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
122 Handle nested arrays, like `[[I'.
123
d593dd8c
KG
1241999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
125
126 * class.c (finish_class): Remove unused parameter, all callers
127 changed.
128
129 * expr.c (build_java_athrow): Change return type to void.
130 (java_lang_expand_expr): Make sure each case in switch returns a
131 value.
132
133 * java-tree.h (finish_class): Fix prototype to take void args.
134
135 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
136 (main): Issue return from main, not exit.
137
138 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
139
140 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
141
142 * jv-scan.c (main): Issue return from main, not exit.
143
144 * parse.y (check_abstract_method_definitions,
145 java_check_abstract_method_definitions): Add static prototypes.
146 (java_complete_expand_methods): Fix call to `finish_class'.
147
148 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
149 and `prevpc'.
150
f425a887
KG
1511999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
152
153 * lang.c (language_string): Constify.
154
00d30284
KG
1551999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
156
157 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
158 Remove hacks for stuff which comes from libiberty.
159
160 * Make-lang.in: Likewise.
161
24c30b28
HPN
162Mon Aug 30 16:41:41 1999 Hans-Peter Nilsson <hp@axis.se>
163
164 * Makefile.in (xref.o): Depend on xref.c explicitly.
165
1b93a502
KG
1661999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
167
168 * java-tree.h (lang_printable_name): Constify a char*.
169
170 * lang.c (lang_printable_name): Likewise.
171
5f9ee695
JL
172Fri Aug 27 23:31:57 1999 Jeffrey A Law (law@cygnus.com)
173
174 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
175 comments in C code.
176
12207a87
TT
1771999-08-26 Tom Tromey <tromey@cygnus.com>
178
179 * gjavah.c (print_cxx_classname): Print "::" before qualified
180 name.
181
f441f671
APB
182Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
183
184 * parse.y (lookup_cl): Changed leading comment. Now does its best
185 to set the column number.
186 (qualify_ambiguous_name): Take WFL wrappers into account.
187
ee5cd638
GT
188Wed Aug 25 15:37:15 1999 Gregg Townsend <gmt@cs.arizona.edu>
189
190 * verify.c (verify_jvm_instructions): Don't check instruction
191 validity beyond end of method.
192
20c96b2a
TT
1931999-08-25 Tom Tromey <tromey@cygnus.com>
194
195 * jvspec.c (lang_specific_driver): Correctly handle --help again.
196
be245ac0
KG
1971999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
198
199 * gjavah.c (print_name, print_base_classname, utf8_cmp,
200 cxx_keyword_subst, generate_access, name_is_method_p,
201 get_field_name, print_field_name, super_class_name, print_include,
202 decode_signature_piece, print_class_decls, usage, help,
203 java_no_argument, version, add_namelet, print_namelet): Add static
204 prototype.
205 (print_base_classname, utf8_cmp, cxx_keyword_subst,
206 name_is_method_p): Constify a char*.
207 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
208 Provide a final else clause in an if-else-if.
209 (print_field_info): Add missing final arg in function call to
210 `print_field_name'.
211 (print_method_info, decompile_method, decode_signature_piece,
212 print_c_decl, print_full_cxx_name, print_stub,
213 print_mangled_classname, super_class_name, print_include,
214 add_namelet, add_class_decl, print_class_decls, process_file,
215 help): Constify a char*.
216
217 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
218 push_int_const, find_constant_wide, find_constant_index,
219 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
220 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
221 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
222 emit_if, emit_goto, emit_jsr, call_cleanups,
223 make_class_file_name): Add static prototypes.
224 (generate_bytecode_return, generate_bytecode_insns): Pass a
225 NULL_PTR, not a NULL_TREE.
226
227 * jv-scan.c: Include "jcf.h".
228 (main): Declare using DEFUN macro.
229
230 * jvspec.c (find_spec_file, lang_specific_pre_link,
231 lang_specific_driver): Add prototypes.
232 (find_spec_file): Constify a char*.
233
234 * keyword.gperf (hash, java_keyword): Add prototypes.
235
236 * lang.c (lang_print_error): Add static prototype.
237 (lang_init): Prefer memcpy over bcopy to avoid casts.
238
239 * lex.c (yylex): Add static prototype.
240
241 * parse-scan.y: Include "lex.c" earlier.
242
243 * parse.h: Remove redundant declaration for `yylex'.
244
245 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
246 labeled_block_contains_loop_p): Add static prototypes.
247 (not_accessible_p): Make static to match prototype.
248
249 * verify.c (start_pc_cmp): Don't needlessly cast away const.
250
d77613be
APB
251Sun Aug 22 11:07:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
252
253 * parse.y (check_method_redefinition): Changed leading comment.
254 (check_abstract_method_definitions): New function.
255 (java_check_abstract_method_definitions): New function.
256 (java_check_regular_methods): Call it.
257 (verify_constructor_super): Fixed indentation.
258 (lookup_method_invoke): Likewise.
259
79d13333
APB
260Thu Aug 19 10:26:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
261
262 * parse.y (method_header): Return a null pointer if the current
263 class node is null.
264 (finish_method_declaration): Return if the current function decl
265 is null.
266 (source_start_java_method): Likewise.
267 (java_method_add_stmt): Likewise.
268
5cbdba64
APB
269Wed Aug 18 13:17:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
270
271 * class.c (emit_register_class): Removed unnecessary call to
272 start_sequence.
273 * parse.y (labeled_block_contains_loop_p): Removed unused local
274 variable.
275
276Tue Aug 17 22:51:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
277
278 * parse.y (java_refold): Added prototype.
279
280Tue Aug 17 21:48:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
281
282 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
283 (java_stabilize_reference): Removed unnecessary `else'.
284 (java_complete_lhs): Set flag to remember boolean. Call
285 java_refold. Added comments.
286 (java_decl_equiv): New function.
287 (binop_compound_p): Likewise.
288 (java_refold): Likewise.
289 (patch_unaryop): Striped static field access assigned to decl and
290 op. Changed promotion scheme for ++/-- operators.
291 (search_loop): New function.
292 (labeled_block_contains_loop_p): Likewise.
293 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
294 comment.
295 (patch_bc_statement): Call search_loop. Fixed comment.
296
66e06429
AG
2971999-08-14 Anthony Green <green@cygnus.com>
298
299 * expr.c (java_lang_expand_expr): Mark static array data as
300 referenced.
301
9a816500
RO
302Tue Aug 10 00:28:31 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
303
304 * jvgenmain.c (main): NUL-terminate name_obstack.
305
c8e7d2e6
KG
3061999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
307
308 * check-init.c (check_bool2_init, done_alternative): Add static
309 prototypes.
310
311 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
312 (add_method, build_utf8_ref, build_class_ref,
313 append_gpp_mangled_type, layout_class_method): Constify a char*.
314
315 * decl.c (push_promoted_type, make_binding_level): Add static
316 prototypes.
317 (push_promoted_type, pushdecl): Constify a char*.
318
319 * except.c (find_handler_in_range, link_handler,
320 check_start_handlers): Add static prototypes.
321
322 * expr.c (process_jvm_instruction): Constify a char*.
323
324 * gjavah.c (main): Constify a char*.
325
326 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
327 Constify a char*.
328
329 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
330 static prototypes.
331 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
332 munge, print_ents): Constify a char*.
333
334 * jcf-dump.c (disassemble_method): Constify a char*.
335 (print_constant_pool, print_exception_table): Add static prototypes.
336 (print_constant, print_exception_table, main, disassemble_method):
337 Constify a char*.
338
339 * jcf-io.c (find_classfile, find_class): Likewise.
340
341 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
342 (set_source_filename, predefined_filename_p): Add static prototypes.
343 (set_source_filename, get_constant, get_class_constant,
344 find_in_current_zip): Constify a char*.
345
346 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
347 static prototypes.
348 (add_entry, add_path, jcf_path_classpath_arg,
349 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
350
351 * jcf-reader.c (get_attribute, jcf_parse_preamble,
352 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
353 jcf_parse_one_method, jcf_parse_methods,
354 jcf_parse_final_attributes): Add static prototypes.
355 (get_attribute): Constify a char*.
356
357 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
358 jcf_dependency_add_target, jcf_path_classpath_arg,
359 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
360
361 * jv-scan.c (main): Constify a char*.
362 (gcc_obstack_init): Add prototype arguments.
363
364 * jvgenmain.c (gcc_obstack_init): Likewise.
365 (main): Constify a char*.
366
367 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
368 static prototypes.
369 (put_decl_string, lang_print_error): Constify a char*.
370 (lang_init): Remove redundant extern prototype.
371
372 * mangle.c (emit_unicode_mangled_name): Constify a char*.
373
374 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
375 Add static prototypes.
376 (get_type_from_signature): Constify a char*.
377
378 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
379 Add static prototypes.
380 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
381 (verify_jvm_instructions): Constify a char*.
382
383 * xref.c (xref_flag_value): Likewise.
384
385 * xref.h (xref_flag_value): Likewise.
386
387 * zextract.c (makeword, makelong): Add static prototypes.
388 (makeword, makelong): Constify a uch*.
389
0070eeda
KG
3901999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
391
392 * lang.c (java_dummy_print): Constify a char*.
393 (lang_print_error): Likewise.
394 (lang_init): Remove redundant prototype for `print_error_function'.
395 (lang_init_source): Likewise.
396 (lang_identify): Constify a char*.
397
63ac1f08
TT
3981999-08-09 Tom Tromey <tromey@cygnus.com>
399
400 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
401 (WORDS_TO_LONG): Likewise.
402 (WORDS_TO_DOUBLE): Likewise.
403
49f48c71
KG
4041999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
405
406 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
407
408 * expr.c (java_stack_pop, java_array_data_offset,
409 build_java_throw_out_of_bounds_exception, case_identity,
410 build_java_check_indexed_type): Add static prototypes.
411 (linenumber_table, expand_invoke, expand_java_field_op,
412 build_primtype_type_ref, expand_byte_code): Constify a char*.
413
414 * java-tree.h (build_primtype_type_ref, linenumber_table):
415 Constify a char*.
416 (java_lang_expand_expr): Add prototype.
417
418 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
419 `java_lang_expand_expr'.
420
421 * lex.c (java_lex_error): Constify a char*.
422 (java_get_unicode, java_read_char, java_allocate_new_line,
423 java_unget_unicode, java_sneak_unicode): Prototype.
424
425 * parse-scan.y (current_class, package_name, method_declarator,
426 report_class_declaration, yyerror): Constify a char*.
427
428 * parse.h (java_report_errors): Prototype.
429 (yyerror): Constify a char*.
430
431 * parse.y (classitf_redefinition_error, check_modifiers,
432 parse_jdk1_1_error, lookup_package_type,
433 lookup_package_type_and_set_next, get_printable_method_name,
434 purify_type_name): Constify a char*.
435 (build_super_invocation, maybe_generate_finit,
436 verify_constructor_super, parser_add_interface,
437 add_superinterfaces, jdep_resolve_class, note_possible_classname,
438 java_complete_expand_methods, java_expand_finals,
439 cut_identifier_in_qualified, java_stabilize_reference,
440 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
441 merge_string_cste): Prototype.
442 (single_type_import_declaration, yyerror,
443 variable_redefinition_error, build_array_from_name,
444 build_unresolved_array_type, check_class_interface_creation,
445 resolve_class, complete_class_report_errors,
446 note_possible_classname, read_import_dir,
447 find_in_imports_on_demand, resolve_package, fix_constructors,
448 check_deprecation, lookup_method_invoke,
449 maybe_build_primttype_type_ref, array_constructor_check_entry):
450 Constify a char*.
451 (java_complete_expand_methods, java_expand_finals): Make static.
452 (convert_narrow): Remove static prototype.
453
02edc62b
R
454Tue Aug 3 20:21:20 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
455
456 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
457
0ae70c6a
RH
4581999-08-02 Richard Henderson <rth@cygnus.com>
459
460 * decl.c: Include defaults.h instead of expr.h.
461 * parse.y: Likewise.
462
e438e1b7
JJ
4631999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
464
465 * java/decl.c (start_java_method): Change all uses of
466 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
467 Ensure expr.h is included.
468 * java/expr.c (pop_arguments): Ditto.
469 * java/parse.y (expand_start_java_method): Ditto.
470
9490b7d6
KG
4711999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
472
473 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
474
b384405b
BS
4751999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
476
477 * decl.c: Include "function.h".
478 * except.c: Likewise.
479 * parse.y: Likewise.
480 * Makefile.in: Update dependencies.
481
cd531a2e
KG
4821999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
483
484 * expr.c (build_java_soft_divmod): Provide a default case in switch.
485 (java_lang_expand_expr): Mark parameters `target', `tmode' and
486 `modifier' with ATTRIBUTE_UNUSED.
487
488 * gjavah.c (process_file): Add braces around ambiguous `else'.
489
490 * jcf-dump.c (print_access_flags, localvar_free): Change return
491 type to void.
492
493 * parse.y (java_complete_expand_method): Initialize variable
494 `exception_copy'.
495 (resolve_qualified_expression_name): Likewise for `field_decl'.
496 (patch_method_invocation): Likewise for `class_to_search'.
497 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
498 (patch_assignment): Likewise for `lhs_type'.
499
500 * verify.c (verify_jvm_instructions): Remove unused variable
501 `caller'.
502
8824cf7e
RH
5031999-07-25 Richard Henderson <rth@cygnus.com>
504
505 * decl.c (va_list_type_node): New.
506
6c9c5c1f
AG
5071999-07-25 Anthony Green <green@cygnus.com>
508
509 * gjavah.c (print_stub): New function.
510 (METHOD_IS_NATIVE): New macro.
511 (print_mangled_classname): Make static.
512 (HANDLE_END_FIELD): Don't emit fields during stub generation.
513 (process_file): Perform stub generation.
514 (HANDLE_METHOD): Don't emit class decls during stub
515 generation.
516 (HANDLE_END_METHOD): Take into account stub generation.
517 (print_method_info): Handle stub generation.
518 (print_stub): New function.
519 (print_cxx_classname): Make signature consistant with others.
520 (help): Describe -stubs option.
521 (main): Create stub file.
522 (version): Use version.c.
523 (print_full_cxx_name): New function.
524 (print_c_decl): Use print_full_cxx_name.
525
ac1d97ce
APB
526Thu Jul 22 12:41:12 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
527
528 * check-init.c (check_init): Handle MAX_EXPR.
529
aa4759c1
AH
5301999-07-15 Andrew Haley <aph@cygnus.com>
531
0b094f65
AH
532 * lang.c (flag_use_divide_subroutine): New variable.
533 * typeck.c: (convert_ieee_real_to_integer): Bounds check
534 fp-to-integer conversion.
535 (convert): Call convert_ieee_real_to_integer when flag_fast_math
536 is not set.
537
538 * expr.c (build_java_soft_divmod): New function.
539 (build_java_binop): Call build_java_soft_divmod if
540 flag_use_divide_subroutine is set.
541 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
542 soft_lrem_node: new builtin functions.
543 (init_decl_processing) Initialize the new builtins.
544 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
545 soft_lrem_node: new builtin functions.
546 (build_java_soft_divmod): New function.
547 * parse.y: Call build_java_soft_divmod if
548 flag_use_divide_subroutine is set.
549 * parse.c: Rebuilt.
550
551 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
552 a --specs= arg) even if not linking.
553 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
554 -fuse-divide-subroutine
555
7705e9db
APB
556Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
557
558 * parse.y (resolve_and_layout): Check methods only once.
559 (resolve_qualified_expression_name): Verify thrown exceptions
560 compatibility.
561 (check_thrown_exceptions): Reject exceptions thrown in
562 initializer. Error message tuned.
563
e533f648
AH
5641999-07-14 Andrew Haley <aph@cygnus.com>
565
566 * expr.c (expand_expr): Do not return the last statement in a
567 block as the block's value.
568
1a6d4fb7
APB
569Sat Jul 3 22:26:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
570
571 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
572 CALL_EXPR, to avoid order of evaluation changes.
573
574Fri Jul 2 17:44:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
575
576 * parse.y (qualify_ambiguous_name): Do not use
577 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
578
579Thu Jul 1 23:31:16 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
580
581 * check-init.c (check_init): Handle MAX_EXPR.
582 * expr.c (force_evaluation_order): Force method call arguments to
583 be evaluated in left-to-right order.
584 * parse.y (qualify_ambiguous_name): Loop again to qualify
585 NEW_ARRAY_EXPR properly.
586
587Wed Jun 30 17:27:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
588
589 * parse.y (patch_invoke): Resolve unresolved invoked method
590 returned type.
591 (qualify_ambiguous_name): STRING_CST to qualify expression for
592 type name resolution.
593
ac8f5d48
AH
5941999-06-24 Andrew Haley <aph@cygnus.com>
595
596 * class.c (finish_class): Whenever a deferred method is
597 output, rescan the list of methods to see if a new candidate for
598 output can be found.
599
4198d734
TT
6001999-06-28 Tom Tromey <tromey@cygnus.com>
601
602 * jvspec.c (lang_specific_driver): Recognize --help.
603
2c56429a
APB
604Fri Jun 25 13:35:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
605
606 * parse.y (resolve_package): Fixed bogus return statement.
607 (patch_method_invocation): Resolve method invocation beginning with
608 a package name qualifier.
609
58ec4285
KG
6101999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
611
612 * Make-lang.in (java.stage1): Depend on stage1-start.
613 (java.stage2): Likewise for stage2-start.
614 (java.stage3): Likewise for stage3-start.
615 (java.stage4): Likewise for stage4-start.
616
2c56429a
APB
617Thu Jun 24 13:12:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
618
619 * parse.y (java_complete_lhs): When doing cross referencing, don't
620 try to keep file location on a WFL expanded as a CALL_EXPR.
621
622Wed Jun 23 14:37:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
623
624 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
625 compiling to class file a void method with an empty method body.
626 As a side effect, the bytecode backend will generate the
627 appropriate `return' instruction.
628
629Tue Jun 22 20:43:49 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
630
631 * parse.y (lookup_package_type_and_set_next): New function prototype.
632 (resolve_package): Search current and imported packages.
633 (lookup_package_type_and_set_next): New function.
634
45b0aa31
AH
6351999-06-22 Andrew Haley <aph@cygnus.com>
636
637 * verify.c (verify_jvm_instructions): Check for pending blocks
638 before invalid PC test and opcode switch, not after.
639
44d7502b
AH
6401999-06-21 Andrew Haley <aph@cygnus.com>
641
642 * except.c (find_handler_in_range): The upper limit for exception
643 ranges is exclusive, not inclusive: (start <= pc < end).
644 (link_handler): find child pointer which points to outer by
645 searching sibling list: previous code incorrectly assumed that
646 outer->outer->first_child must point to outer.
647 * verify.c (verify_jvm_instructions): FIXME added to code for
648 `athrow'.
649 (verify_jvm_instructions): Do not assume that the last block
650 processed in a subroutine is a block which ends with a `ret'
651 instruction. With some control flows it is possible that the last
652 block ends with an `athrow'.
653
8576f094
APB
654Mon Jun 14 13:13:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
655
656 * parse.y (qualify_ambiguous_name): Reorganized the post
657 evaluation of non WFL leading expression nodes.
658
659Fri Jun 11 21:37:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
660
661 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
662 CONVERT_EXPR.
663
664Thu Jun 10 22:26:17 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
665
666 * parse.y (qualify_ambiguous_name): Handle qualified expression
667 beginning with a STRING_CST.
668
669Thu Jun 10 20:27:25 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
670
671 * parse.y (register_fields): Set DECL_INITIAL on both
672 pre-initialized static and public fields.
673 (resolve_field_access): Static field access expressions to always
674 use pointer types.
675 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
676 qualification. CONVERT_EXPR to be resolved as an expression name.
677 (java_complete_lhs): Identify and access qualified final
678 initialized field in switch statement case expression.
679 (fold_constant_for_init): Pre-initialized field decl constant to
680 be folded.
681
fe0e4d76
APB
682Mon Jun 7 16:09:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
683
684 * parse.y (note_possible_classname): Mark returned node with
685 QUALIFIED_P only if the original class name contained a '/'.
686
db1421c7
AG
687Sat Jun 5 11:46:59 1999 Anthony Green <green@cygnus.com>
688
689 * Make-lang.in (gcjh): More parallel build fixes.
690
6911999-06-03 Mike Stump <mrs@wrs.com>
692
693 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
694
99fd3aa5
AG
695Wed Jun 2 10:44:38 1999 Anthony Green <green@cygnus.com>
696
697 * except.c (link_handler): Chain exception handlers in order.
698
699Wed Jun 2 10:41:24 1999 Anthony Green <green@cygnus.com>
700
701 * expr.c (expand_byte_code): Fill unreachable bytecode regions
702 with nops and process as usual in order to always set correct EH
703 ranges. Emit detailed warnings about unreachable bytecodes.
704
705Wed Jun 2 10:35:13 1999 Anthony Green <green@cygnus.com>
706
707 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
708 constant.
709
93024893
APB
710Fri May 28 18:22:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
711
712 * parse.y (lookup_field_wrapper): Unified returned value to NULL
713 or the searched field decl.
714
715Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
716
717 * parse.y (fold_constant_for_init): Convert numerical constant
718 values to the type of the assigned field.
719
720Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
721
722 * expr.c (lookup_field): Relaxed the test on class loading error
723 detection.
724 * parse.y (fold_constant_for_init): Enabeled old code.
725
726Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
727
728 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
729 decide the validity of the cast of a java.lang.Cloneable reference
730 to an array.
731 (patch_conditional_expr): Fixed first argument passed to
732 binary_numeric_promotion.
733
2ba1f15f
APB
734Wed May 26 15:33:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
735
736 * parse.y (qualify_ambiguous_name): Take into account that a
737 CONVERT_EXPR might specify a type as a WFL.
738
dc4e6ccf
APB
739Tue May 25 15:06:13 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
740
741 * parse.y (patch_assignment): Save the rhs before using it as an
742 argument to _Jv_CheckArrayStore.
743
744Tue May 25 11:23:59 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
745
746 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
747
748Mon May 24 13:26:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
749
750 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
751 floating point litteral only when the exponent indicator has been
752 parsed.
753
5256aa37
APB
754Sat May 22 13:54:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
755
756 * parse.y (formal_parameter:): Construct argument tree list
757 element even if a yet unsupported final parameter was encountered.
758
759Tue May 18 00:28:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
760
761 * parse.y (finish_method_declaration): Issue errors for native or
762 abstract methods declared with a method body, as well as for non
763 native or non abstract methods with no method body.
764
ab3a6dd6
KG
7651999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
766
767 * class.c (build_utf8_ref): Initialize variable `field'.
768
769 * decl.c (init_decl_processing): Initialize variable `field'.
770
771 * expr.c (build_known_method_ref): Mark parameters `method_type',
772 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
773 (process_jvm_instruction): Likewise for parameter `length'.
774
775 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
776 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
777 ATTRIBUTE_UNUSED.
778
779 * parse.y (maybe_generate_clinit): Remove unused variable
780 `has_non_primitive_fields'.
781 (find_in_imports_on_demand): Initialize variables `node_to_use'
782 and `cl'.
783 (patch_binop): Likewise for variable `prom_type'.
784 (patch_unaryop): Likewise for variable `prom_type'.
785
786 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
787
788 * xref.c (xref_table): Add missing initializer.
789
5a9e5c6f
TT
7901999-05-14 Tom Tromey <tromey@cygnus.com>
791
792 * java-except.h (struct eh_range): Removed unused `next' member.
793 * verify.c (verify_jvm_instructions): Call check_nested_ranges
794 after adding all exception handlers. Sort exception ranges in
795 order of start PC.
796 (struct pc_index): New structure.
797 (start_pc_cmp): New function.
798 * except.c (add_handler): Return `void'. Don't call link_handler;
799 instead construct an ordinary linked list and do range
800 coalescing.
801 (check_nested_ranges): New function.
802 (link_handler): Changed interface to allow merging of eh_ranges.
803 Split overlapping ranges. Return `void'.
804
2e5eb5c5
APB
805Mon May 17 19:20:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
806
807 * parse.y (constructor_block_end:): New rule, tagged <node>.
808 (constructor_body:): Use `constructor_block_end' instead of
809 `block_end'.
810
9dd939b2
APB
811Mon May 17 18:01:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
812
813 * parse.y (statement_nsi:): Pop `for' statement block.
2e5eb5c5 814 (java_complete_lhs): Labeled blocks containing no statement are
9dd939b2
APB
815 marked as completing normally.
816
af8b342a
APB
817Fri May 14 12:31:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
818
819 * xref.c (xref_set_current_fp): New function, defined.
820 * xref.h (xref_set_current_fp): New function, prototyped.
821
822Fri May 14 11:57:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
823
824 * check-init.c (check_init): Take into account that
825 LABELED_BLOCK_STMT can be empty.
826
1fb89a4d
APB
827Thu May 13 18:30:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
828
829 * parse.y (java_check_regular_methods): Warning check on not
830 overriding methods with default access in other packages does not
831 apply to `<clinit>'.
832 (java_complete_lhs): If block body is an empty_stmt_node, replace
af8b342a
APB
833 it by NULL_TREE. This prevents gcc from generating an irrelevant
834 warning.
1fb89a4d 835
ce6e9147
APB
836Thu May 13 13:23:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
837
838 * check-init.c (check_init): Removed code accepting to see things
839 falling through default:, when doing xrefs.
840 * java-tree.h (do_not_fold): New global variable, declared.
841 * parse.y (do_not_fold): New global variable, defined.
842 (java_complete_expand_method): Set `do_not_fold' to the value of
843 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
844 and reinstall them after them have been purged; do not check for
845 initializations; do not issue missing return errors.
846 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
847 when doing xrefs.
848 (patch_binop): Skip the fold part when doing xrefs.
849 (build_string_concatenation): Skip the concatenation part when
850 doing xrefs.
851 (patch_synchronized_statement): Do not generate a try-finally when
852 doing xrefs.
853 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
854 and keep the location where the throw was seen.
855 * typeck.c (convert): When `do_not_fold' is set, do not attempt
856 any treatment on the converted node an simply return a NOP_EXPR of
857 the targeted type.
858 * xref.c (xref_get_data): New function, defined.
859 * xref.h (xref_get_data): New function, declared.
860 (XREF_GET_DATA): Use xref_get_data.
861
ab3a6dd6 8621999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1b01250d
KG
863
864 * gjavah.c (print_include): Cast the result of `strlen' to int
865 when comparing against a signed value.
866 (add_namelet): Likewise.
867
ab3a6dd6 8681999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
34ba56fa 869
b4b63e32
KG
870 * expr.c (expand_invoke): Mark parameter `nargs' with
871 ATTRIBUTE_UNUSED.
872 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
873
874 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
875 ATTRIBUTE_UNUSED.
876
877 * jcf-reader.c (get_attribute): Cast a value to long
878 when comparing against a signed expression. Likewise.
879
34ba56fa
KG
880 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
881 HOST_BITS_PER_CHAR.
882
138657ec
AH
8831999-05-11 Andrew Haley <aph@cygnus.com>
884
885 * parse.y (source_end_java_method): If the current method contains
886 any exception handlers, force asynchronous_exceptions: this is
887 necessary because signal handlers in libjava may throw exceptions.
888 * decl.c (end_java_method): Ditto.
889
6a09296d
TT
8901999-05-11 Tom Tromey <tromey@cygnus.com>
891
892 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
893 flags.
894 * jvspec.c (THREAD_NAME): Removed.
895 (GC_NAME): Likewise.
896 (MATHLIB): Likewise.
897 (WITHLIBC): Likewise.
898 (GCLIB): Likewise.
899 (THREADLIB): Likewise.
900 (MATH_LIBRARY): Likewise.
901 (lang_specific_driver): Don't add `-l' options to command line.
902 Instead, add a single --specs option. Recognize `-L' options and
903 use them to search for spec file.
904 (find_spec_file): New function.
905 (SPEC_FILE): New define.
906
b8b8bc03
DB
907Tue May 11 11:46:36 1999 Dave Brolley <brolley@cygnus.com>
908
909 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
910 cpplib-enabled build.
911
c14cff58
PB
9121999-05-05 Per Bothner <bothner@cygnus.com>
913
914 * class.c (make_field_value): DECL_INITIAL may be a string literal;
915 temporarily zero it while calling rest_of_decl_compilation.
916
917 * java-tree.h (string_ptr_type_node): Add declaration.
918 * decl.c: Define and initialize string_ptr_type_node.
919 * parse.y (patch_string_cst): Use string_ptr_type_node.
920
921 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
922 * parse.y (for_statement): Now unconditionally exit_block.
923 (finish_labeled_statement): No longer exit_block if for-loop.
924 (patch_loop_statement): Check harder if the loop is already labeled.
925
926 * parse.y (patch_initialized_static_field): Removed function.
927 (maybe_generate_clinit): Removed special handling for interfaces.
928 (java_complete_expand_methods): Do a preliminary java_complete_tree
929 on <clinit> to determine if it can be removed.
930 (java_complete_expand_method): Remove special handling for <clinit>.
931 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
932 optimize if we get back empty_stmt_node.
933 For MODIFY_EXPR, re-do checking of static initializers.
934 (fold_constant_for_init): Don't return immediate if VAR_DECL.
935 For VAR_DECL, pass correct context.
936
937 * verify.c (verify_jvm_instructions): Better error messages.
938
a7f0ef91
TT
9391999-05-03 Tom Tromey <tromey@cygnus.com>
940
941 * parse-scan.y (interface_declaration): Call
942 report_class_declaration for interfaces.
943
b4c92efc
ZW
9441999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
945
946 * Makefile.in: Remove -v from bison command lines.
947
7f10c2e2
APB
948Fri Apr 30 17:54:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
949
950 * check-init.c (check_init): Exclude a case of error when doing
951 xrefs.
952 * class.c (layout_class_method): Don't generate the error message
953 twice when compiling from source.
954 * lang-options.h: Added `-Wredundant-modifers' and
955 `-Wunusupported-jdk11' flags and help text.
956 * lang.c (lang_decode_option): Added support for
957 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
958 flag_static_local_jdk11 and flag_redundant set accordingly.
959 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
960 * parse.h (EXPR_WFL_ADD_COL): New macro.
961 (DECL_END_SOURCE_LINE): Likewise.
962 (DECL_INHERITED_SOURCE_LINE): Likewise.
963 * parse.y (static_ref_err): New function, prototyped.
964 (CCB_TK): Now tagged <operator>.
965 (class_body:): Remember the location of the closing '}' of a class
966 definition when doing xrefs.
967 (block:): Likewise.
968 (block_end:): Likewise.
969 (create_class): Remember the location of the inherited class
970 identifier when doing xrefs.
971 (register_fields): Added test on first operand of `init' before
972 testing it TREE_CODE.
973 (method_header): Store the location of the class identifier in the
974 class decl when doing xrefs.
975 (finish_method_declaration): Don't combine first/last method line
976 when doing xref.
977 (java_check_regular_methods): Warning check on not overriding
978 methods with default access on other packages move before check on
979 static methods. Initialization of `aflags' also moved up.
980 (resolve_expression_name): Call static_ref_err to report the error.
981 (static_ref_err): New function, implemented.
982 (resolve_field_access): Returned simplified static field access
983 when doing xrefs.
984 (resolve_qualified_expression_name): Check for illegal use of
985 static fields in a non static context. Call static_ref_err to
986 report error in various places.
ce6e9147 987 (java_complete_tree): Do not fold initialized static fields when
7f10c2e2
APB
988 doing xrefs.
989 (java_complete_lhs): Likewise.
990
d2e0d40a
AG
9911999-04-29 Anthony Green <green@cygnus.com>
992
993 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
994 create internal labels.
995 (lookup_label): Ditto.
996
7f1d4866
APB
997Sat Apr 24 16:50:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
998
999 * class.c (layout_class_method): Generate <clinit>'s rtl for
1000 interfaces.
1001 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
1002 for interfaces' <clinit>.
1003 * expr.c (lookup_field): Search for fields in interfaces.
1004 (expand_invoke): Fixed indentation.
1005 (expand_java_field_op): Likewise. Use IS_CLINIT.
1006 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
1007 (IS_CLINIT): New macro.
1008 * parse.y (type_declaration:): Call maybe_generate_clinit after an
1009 interface was parsed.
1010 (maybe_generate_clinit): Don't generate if the current class is an
1011 interface with only fields of primitive types.
1012 (reset_method_name): Use IS_CLINIT.
1013 (java_complete_expand_method): Expand <clinit> when it exists for
1014 interfaces. Use IS_CLINIT.
1015 (resolve_expression_name): Use DECL_CONTEXT instead of
1016 current_class to build static field references.
1017 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
1018 ARRAY_REF when doing xreferencing.
1019 (check_final_assignment): Fixed typo in leading comment. Use
1020 IS_CLINIT.
1021 (patch_array_ref): Don't fully expand array references when
1022 xreferencing.
1023 (patch_return): Use IS_CLINIT.
1024 (patch_throw_statement): Likewise.
1025
c9eb638e
TT
10261999-04-22 Tom Tromey <tromey@cygnus.com>
1027
1028 * Make-lang.in (JAVA_SRCS): Added check-init.c.
1029
5423609c
APB
1030Wed Apr 21 11:13:36 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1031
1032 * decl.c (predef_filenames, predef_filenames_size): New globals
1033 (init_decl_processing): predef_filenames and predef_filenames_size
1034 initialized.
1035 * java-tree.h (predef_filenames, predef_filenames_size): Declared
1036 extern.
1037 * jcf-parse.c (predefined_filename_p): New function.
1038 (yyparse): Check that files on the command line are specified only
1039 once and issue a warning otherwise.
1040 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
1041 * parse.y (source_end_java_method): Nullify NOP method bodies, to
1042 avoid a gcc warning with -W -Wall turned on.
1043 (java_expand_classes): Abort if errors were encountered.
1044 (java_complete_lhs): If the cross reference flag is set, wrap
1045 field DECL node around a WFL when resolving expression name.
1046
e8fc7396
APB
1047Mon Apr 19 14:44:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1048
1049 * lang.c (lang_decode_option): Fixed returned value when parsing
1050 `-fxref=...' and `-Wall'.
1051 * parse.y (source_end_java_method): Do not generate code when
1052 flag_emit_xref is set.
1053 (resolve_expression_name): Do not build static field access when
1054 flag_emit_xref is set.
5423609c 1055 (resolve_field_access): No special treatment on `length' when
e8fc7396
APB
1056 flag_emit_xref is set. Do not build qualified static field access
1057 when flag_emit_xref is set.
1058 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
1059 when flag_emit_xref is set.
1060 (patch_assignment): Do not generate array store runtime check when
1061 flag_emit_xref is set.
1062 * xref.c (xref_flag_value): Fixed function declaration
1063 indentation.
1064 (xset_set_data): New function.
1065 * xref.h (xref_set_data): Added prototype for new function.
1066 (typedef struct xref_flag_table): New field data.
1067 (XREF_GET_DATA): New macro.
1068
a3f406ce
TT
10691999-04-19 Tom Tromey <tromey@cygnus.com>
1070
1071 * xref.h (enum): Removed trailing comma.
1072
1073 * parse.y (resolve_qualified_expression_name): Added missing
1074 `break'.
1075
08967681
AG
1076Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com>
1077
1078 * gjavah.c: New prototypes for java_float_finite and
1079 java_double_finite.
1080
b3edebcf
APB
1081Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1082
e8fc7396 1083 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
b3edebcf
APB
1084 references.
1085
0bb07950
JL
1086Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com)
1087
1088 * Makefile.in (TREE_H): Add tree-check.h.
1089 (RTL_H): Add genrtl.h.
1090
2622b947
APB
1091Tue Apr 6 15:15:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1092
1093 * parse.y (patch_assignment): Added ArrayStoreException runtime
1094 check.
1095
b399dcd2
PB
10961999-04-06 Per Bothner <bothner@cygnus.com>
1097
ab45646c
PB
1098 * expr.c (pop_type_0): New function.
1099 (pop_type): Use pop_type_0.
1100 * java-tree.h (pop_type_0): New declaration.
1101 * verify.c (verify_jvm_instructions): Check return instructions.
1102
b399dcd2
PB
1103 * parse.y (patch_binop): Don't fold if non-constant and emiting
1104 class files.
1105
4f65832d
KG
1106Mon Apr 5 16:06:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1107
1108 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
1109
1110 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
1111 (main_jcf): Don't define.
1112 (process_file): Don't set `main_jcf'.
1113
1114 * java-tree.h (main_jcf): Don't declare.
1115
1116 * jcf-parse.c (main_jcf): Add static definition.
1117
1118 * lang.c (main_jcf): Don't define.
1119
4504ead1
KG
1120Mon Apr 5 15:43:51 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1121
1122 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
1123
1124 * decl.c (copy_lang_decl): Likewise for `bcopy'.
1125
1126 * jcf-depend.c: Include "config.h", not <config.h>.
1127
1128 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
1129 `bcopy' to PTR.
1130
1131 * jcf-path.c: Include "config.h", not <config.h>.
1132
1133 * lex.c: Don't include various system header files.
1134 (java_init_lex): Cast the argument of `bzero' to PTR
1135
1136 * parse-scan.y (java_push_parser_context): Likewise.
1137
1138 * parse.y (java_push_parser_context): Likewise.
1139 (patch_bc_statement): Match format specifier to variable argument.
1140
1141 * xref.c: Don't include <stdio.h>.
1142
d4370213
APB
1143Mon Apr 5 11:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1144
1145 * parse.y (struct parser_ctxt *ctxp): Now global.
1146 (declare_local_variables): Use WFL compound value for the
1147 declaration source line value, when doing cross-referencing.
1148
5877286e
TT
11491999-03-31 Tom Tromey <tromey@cygnus.com>
1150
1151 * gjavah.c (print_field_info): Allow constants of other types.
1152 (print_include): Generate include when new name is proper prefix
1153 of already printed name.
1154 (add_namelet): Likewise.
1155 (cxx_keyword_subst): New function.
1156 (print_method_info): Use it.
1157 (print_field_name): New function.
1158 (get_field_name): New function.
1159 (print_field_info): Use get_field_name and print_field_name.
1160
6a28cabc
KG
1161Wed Mar 31 11:00:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1162
1163 * Makefile.in (keyword.h): Generate using gperf language 'C', not
1164 'KR-C', so gperf uses the `const' keyword on strings.
1165
1166 * keyword.gperf (java_keyword): Const-ify a char*.
1167
1504b2b4
APB
1168Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1169
1170 * parse.y (patch_bc_statement): Fixed identation and a bogus
1171 `printf' format.
1172
1173Tue Mar 30 11:29:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1174
1175 * parse.y (patch_assignment): Allow static variables in other
1176 classes to be assigned.
1177
152f94fc
KG
1178Sun Mar 28 22:12:10 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1179
1180 * class.c (maybe_add_interface): Remove unused variable
1181 `interface_binfo'.
1182 (make_class_data): Use = for assignment, not ==. Likewise.
1183 (emit_register_classes): Remove unused variable `decl'.
1184
1185 * lex.c: Fix comment so as not to contain an embedded `/*'.
1186
1187 * verify.c (verify_jvm_instructions): Remove unused variable
1188 `self_type'.
1189
f1b0c0d8
PB
1190Sat Mar 27 15:49:18 1999 Per Bothner <bothner@cygnus.com>
1191
1192 * parse.y (complete_loop_body): Rename to finish_loop_body.
1193 (complete_labeled_statement): Rename to finish_labeled_statement.
1194 (complete_for_loop): Rename to finish_for_loop.
1195 (complete_method_declaration): Rename to finish_method_declaration.
1196
1197 * java-tree.h (continue_identifier_node): New global node.
1198 * decl.c: Define and initialize continue_identifier_node.
1199 * parse.y (generate_labeled_block): Remove - no longer needed.
1200 (build_loop_body): Use continue_identifier_node for continue block.
1201 (finish_labeled_statement): Also do pop_labeled_block actions.
1202 (java_complete_lhs): POP_LOOP even if error.
1203 (build_labeled_block): Special handling for continue_identifier_node.
1204 (patch_loop_statement): Re-organize.
1205 (patch_bc_statement): Re-write.
1206
f099f336
APB
1207Sat Mar 27 15:13:21 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1208
1209 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
1210 using a WFL compound value.
1211 * parse.y (xref.h): Include.
1212 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
1213 WFL compound value.
1214 (register_fields): Set WFL compound value to lineno if doing
1215 xrefs.
1216 (java_complete_expand_method): Call expand_xref if flag_emit_xref
1217 is set.
1218 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
1219 * xref.h (expand_xref): Prototype renamed from xref_generate.
1220
1221Sat Mar 27 14:16:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1222
1223 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
1224 (GET_CURRENT_BLOCK): New macro.
1225 * parse.y (current_static_block): New global variable.
1226 (method_body:): Define action.
1227 (complete_method_declaration): Set current_function_decl to NULL
1228 when work on the current method is done.
1229 (declare_local_variables): Use GET_CURRENT_BLOCK.
1230 (java_method_add_stmt): Likewise.
1231 (java_complete_expand_method): Disable the use of `this' when
1232 expanding <clinit>.
1233 (enter_a_block): If no current method exist, use
1234 current_static_block to link static initializer blocks.
1235 (exit_block): Rewritten to use current_static_block when no current
1236 method decl exists.
1237 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
1238 (patch_return): Forbid the use of `return' in static initializers.
1239 (patch_throw_statement): Fixed indentation. Issue specific error
1240 for uncaught thrown checked exception in static initializer
1241 blocks. Removed FIXME.
1242
08dc830e
ZW
12431999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
1244
1245 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
1246 Link gcj from gcc.o.
1247
de0b553f
APB
1248Tue Mar 23 10:48:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1249
1250 * parse.y (find_applicable_accessible_methods_list): When dealing
1251 with interface: ensure that a given interface or java.lang.Object
1252 are searched only once.
1253
9ee9b555
KG
1254Tue Mar 23 10:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1255
1256 * gjavah.c (print_c_decl): Remove unused argument `flags'.
1257
1258 * jcf-dump.c (print_access_flags): Add braces around if-else.
1259
1260 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
1261 COMBINE_INPUTS.
1262
1263 * lex.c (build_wfl_node): Add static prototype.
1264
1265 * lex.h (build_wfl_node): Remove static prototype.
1266
1267 * parse.y: Include lex.c early enough to declare everything needed.
1268 Ensure calls to `build_wfl_node' pass the proper arguments.
1269 (create_class): Remove unused variable `super_decl'.
1270 (get_printable_method_name): Initialize variable `name'.
1271
8af456c8
APB
1272Mon Mar 22 20:14:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1273
1274 * Changelog: Fixed 1999-03-22 typos.
1275 * lang.c (lang_decode_option): Fixed typo in error string in the
1276 XARG section.
1277
235acd35
APB
12781999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
1279
8af456c8 1280 * Makefile.in (JAVA_OBJS): Added entry xref.o.
235acd35
APB
1281 (xref.o): New rule.
1282 * java-tree.h (flag_emit_xref): Declared extern.
8af456c8 1283 * lang.c (xref.h): Included.
235acd35
APB
1284 (flag_emit_xref): New global variable.
1285 (lang_decode_option): Added support for -fxref.
1286 * xref.c: Created.
1287 * xref.h: Likewise.
1288
e541d2b1
MH
12891999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
1290
1291 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
1292 linked with.
1293
4bcde32e
KG
1294Sun Mar 21 08:30:30 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1295
1296 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
1297 $(srcdir)/../system.h and $(JAVA_TREE_H).
1298 (jcf-io.o): Depend on $(JAVA_TREE_H).
1299 (mangle.o): Likewise.
1300
1301 * check-init.c (check_cond_init): Add static prototype.
1302
1303 * class.c (build_java_method_type, hashUtf8String,
1304 make_field_value, get_dispatch_vector, get_dispatch_table,
1305 append_gpp_mangled_type, mangle_static_field): Likewise.
1306 (strLengthUtf8): Hide unused definition.
1307 (hashUtf8String): Const-ify.
1308 (make_field_value): Un-ANSI-fy.
1309
1310 * constants.c: Move inclusion of jcf.h above java-tree.h.
1311 (set_constant_entry, find_class_or_string_constant,
1312 find_name_and_type_constant, get_tag_node,
1313 build_constant_data_ref): Add static prototype.
1314
1315 * decl.c (push_jvm_slot, builtin_function,
1316 lookup_name_current_level): Likewise.
1317 (builtin_function): Const-ify.
1318
1319 * except.c (expand_start_java_handler, expand_end_java_handler):
1320 Add static prototype.
1321
1322 * expr.c (flush_quick_stack, push_value, pop_value,
1323 java_stack_swap, java_stack_dup, build_java_athrow,
1324 build_java_jsr, build_java_ret, expand_java_multianewarray,
1325 expand_java_arraystore, expand_java_arrayload,
1326 expand_java_array_length, build_java_monitor, expand_java_pushc,
1327 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
1328 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
1329 expand_compare, expand_test, expand_cond, expand_java_goto,
1330 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
1331 expand_java_field_op, java_push_constant_from_pool): Likewise.
1332
1333 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
1334 (build_java_arraynull_check): Mark parameters `node' and `type'
1335 with ATTRIBUTE_UNUSED.
1336 (note_label): Likewise for parameter `current_pc'.
1337 (expand_java_call, expand_java_ret): Hide unused definition.
1338
1339 * java-tree.h (make_class, build_constants_constructor,
1340 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
1341 init_outgoing_cpool, register_class, emit_register_classes,
1342 java_layout_seen_class_methods): Prototype.
1343 (unicode_mangling_length): Const-ify.
1344 (append_gpp_mangled_name, append_gpp_mangled_classtype,
1345 emit_unicode_mangled_name, format_int, format_uint,
1346 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
1347 jcf_print_utf8_replace, open_class): Prototype.
1348
1349 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
1350 <stdio.h>. Include tree.h/java-tree.h.
1351 (utf8_equal_string usage, process_class): Add static prototype.
1352 (open_class): Don't prototype this here.
1353 (utf8_equal_string): Match arguments to format specifiers.
1354 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
1355 TABLE_SWITCH, disassemble_method): Likewise.
1356
1357 * jcf-io.c: Include tree.h/java-tree.h.
1358 (open_class, find_classfile, jcf_print_utf8,
1359 jcf_print_utf8_replace): Const-ify.
1360
1361 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
1362 parse_class_file): Add static prototype.
1363 (find_in_current_zip): Match definition to existing static
1364 prototype.
1365
1366 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
1367 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
1368 finish_jcf_block, define_jcf_label, get_jcf_label_here,
1369 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
1370 write_chunks, adjust_typed_op, generate_bytecode_conditional,
1371 generate_bytecode_return, perform_relocations, init_jcf_state,
1372 init_jcf_method, release_jcf_state, generate_classfile):
1373 Add static prototype.
1374 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
1375 (make_class_file_name): Const-ify.
1376
1377 * jcf.h (find_classfile): Const-ify.
1378
1379 * jv-scan.c (reset_report): Remove prototype.
1380
1381 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
1382 (error): Rewrite to allow varargs.
1383
1384 * lang.c (lang_f_options): Const-ify.
1385
1386 * lex.c (java_parse_escape_sequence): Add static prototype.
1387 (java_allocate_new_line): Match definition to existing static
1388 prototype.
1389
1390 * mangle.c Include tree.h/java-tree.h.
1391 (unicode_mangling_length, emit_unicode_mangled_name,
1392 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
1393
1394 * parse.h (jdep_code): Remove trailing comma in enumeration.
1395 (java_get_line_col): Move prototype outside of !JC1_LITE test.
1396 (reset_report): Add prototype.
1397
1398 * verify.c (push_pending_label, merge_types): Add static
1399 prototypes.
1400
1401 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
1402
1982388a
APB
14031999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
1404
1405 * parse.y (find_applicable_accessible_methods_list): Extend the
1406 search to superinterfaces when relevant.
1407 (search_applicable_methods_list): New function.
1408
14091999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
1410
1411 * class.c (unmangle_classname): Implemented stricter testing
1412 before setting the QUALIFIED_P flag on an identifier.
1413
8fe57f78
PB
1414Tue Mar 16 15:15:41 1999 Per Bothner <bothner@cygnus.com>
1415
1416 * parse.y (java_complete_lhs): Call force_evaluation_order
1417 after patch_newarray.
1418 (patch_binop): Don't call fold if there are side effects.
1419
642f15d1
APB
14201999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
1421
1422 * parse.y (java_stabilize_reference): Use save_expr instead of
1423 building a SAVE_EXPR node.
1424 (java_complete_lhs): Patch the resulting string of the `+='
1425 operator (if necessary) and complete the RHS after having built
1426 the cast.
1427
c52016e4
PB
1428Mon Mar 15 12:18:29 1999 Per Bothner <bothner@cygnus.com>
1429
1430 * class.c (make_class): Don't set CLASS_P here (because
1431 this function is also called by build_java_array_type).
1432 (push_class): Set CLASS_P here instead.
1433 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
1434
1435 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
1436 context. If the context is class, perfer "super" over "synchronized".
1437 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
1438
1439 * parse.y (create_class): Don't call parser_check_super here;
1440 it is not robust. Always wait until later.
1441
1442 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
1443 match what JDK 1.2 does), but don't set ACC_PUBLIC.
1444
b911df12
PB
1445Sat Mar 13 18:16:34 1999 Per Bothner <bothner@cygnus.com>
1446
1447 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
1448 * lex.h (UNGETC): Change misleading macro.
1449
2aa11e97
APB
14501999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
1451
1452 * parse.y (java_stabilize_reference): Return NODE when patching a
1453 COMPOUND_EXPR.
1454 (java_complete_lhs): Put parenthesis around truth values.
1455
14561999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
1457
1458 * class.c (layout_class_method): Don't make rtl for interface
1459 methods.
1460 * parse.h (GET_TYPE_NAME): New macro.
1461 * parse.y (if_then_statement:): Fixed indentation.
1462 (if_then_else_statement:): Likewise.
1463 (for_statement:): Fixed spacing.
1464 (try_statement:): Fixed indentation.
1465 (create_interface): Don't force interfaces to be abstract.
1466 (method_header): Abstract methods are OK in interfaces.
1467 (declare_local_variables): Fixed typo in comment.
1468 (java_complete_expand_method): Fixed indentation.
1469 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
1470 non accessible fields.
1471 (java_stabilize_reference): New function.
1472 (java_complete_lhs): Fixed indentation. Use
1473 java_stabilize_reference in compound assignement. Insert the
1474 cast. If not processing `+' fix string constants before processing
1475 binop.
1476
7e21fe59
KG
1477Fri Mar 12 19:42:55 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1478
1479 * constants.c (find_class_or_string_constant): Cast variable `j'
1480 to a `jword' when comparing against one.
1481
1482 * expr.c (java_lang_expand_expr): Remove unused variables
1483 `has_finally_p' and `op0'.
1484
1485 * gjavah.c (print_field_info): Cast a value to jint when comparing
1486 against one. Likewise for a jlong.
1487 (add_namelet): Likewise cast a `sizeof' to an int when comparing
1488 against a signed quantity.
1489
1490 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
1491 (print_signature): Don't needlessly dereference variable `str'
1492
1493 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
1494 `max_locals' with ATTRIBUTE_UNUSED.
1495 (jcf_parse_class): Likewise for variable `index'.
1496
1497 * parse.h (reverse_jdep_list): Remove static prototype.
1498
1499 * parse.y (build_jump_to_finally): Remove prototype and definition.
1500 (reverse_jdep_list): Add static prototype.
1501
1502 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
1503 `assignment' and `expr_decl'.
1504
1505 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
1506
ecef190c
AH
15071999-03-12 Andrew Haley <aph@cygnus.com>
1508
1509 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
1510 we'll need a directory separator and a null character.
1511
2aee04d2
PB
1512Wed Mar 10 23:20:11 1999 Per Bothner <bothner@cygnus.com>
1513
1514 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
1515
2aa11e97
APB
1516 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1517
1518 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
1519 interfaces.
1520
30ca27b4
PB
1521Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
1522
1523 * lex.c (java_parse_end_comment): Take extra parameter (next char).
1524
1525 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
1526
1527 * class.c (layout_class_method): A static method in a base class
1528 is never overridden, so treat it like it doesn't exist.
1529 However, do complain about private non-static method overriding
1530 public static method.
1531
1532 * parse.y: Don't set unused INITIALIZED_P flag.
1533 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
1534
1535 * parse.y (find_expr_with_wfl): Optimize tail-calls.
1536 (build_array_from_name): Re-order &index[string] to &string[index].
1537
2aa11e97 1538 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
30ca27b4
PB
1539 error_mark (it might catch more errors, but it is more likely to lose).
1540
8e1f2d4c
KG
1541Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1542
1543 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
1544 (parse-scan.o): Depend on toplev.h.
1545
1546 * class.c (make_method_value): Add prototype. Make it static.
1547 Remove unused second argument, caller changed.
1548
1549 * expr.c (java_lang_expand_expr): Remove unused variable
1550 `return_label'.
1551
1552 * java-tree.h: Don't prototype find_in_current_zip.
1553 Add prototypes for verify_constant_pool, start_java_method,
1554 end_java_method, give_name_to_locals, expand_byte_code,
1555 open_in_zip, set_constant_value, find_constant1, find_constant2,
1556 find_utf8_constant, find_string_constant, find_class_constant,
1557 find_fieldref_index, find_methodref_index, write_constant_pool,
1558 count_constant_pool_bytes and encode_newarray_type.
1559
1560 * jcf-dump.c: Remove unused variable `LONG_temp'.
1561
1562 * jcf-parse.c: Include parse.h.
1563 (jcf_parse_source): Remove unused parameter, all callers changed.
1564 (jcf_figure_file_type): Add static prototype.
1565 (find_in_current_zip): Likewise. Also remove unused parameter,
1566 all callers changed.
1567 (read_class): Initialize variable `saved_pos'.
1568
1569 * jcf-reader.c (jcf_parse_preamble): Mark variables
1570 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
1571
1572 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
1573 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
1574 (java_parse_doc_section): Initialize variable `seen_star'.
1575 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
1576 (java_lex_error): Mark parameters `msg' and `forward' with
1577 ATTRIBUTE_UNUSED.
1578 (java_get_line_col): Mark parameters `filename' and `line' with
1579 ATTRIBUTE_UNUSED.
1580
1581 * parse-scan.y: Include toplev.h.
1582 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
1583
1584 * parse.h: use `struct JCF', not plain `JCF'.
1585 (java_parser_context_save_global, java_expand_classes
1586 java_parser_context_restore_global, java_parse): Add prototypes.
1587
1588 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
1589 `node'.
1590
afe81dd6
PB
1591Wed Feb 24 16:13:59 1999 Per Bothner <bothner@deneb.cygnus.com>
1592
1593 * check-init.c (check_init): COPYN takes word count, not bit count.
1594
2d9e5c79
PB
1595Fri Feb 26 14:06:21 1999 Per Bothner <bothner@cygnus.com>
1596
1597 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
1598 explicit build_decl. (Avoids crash in reload when optimizing.)
1599
1600Thu Feb 25 21:05:04 1999 Per Bothner <bothner@cygnus.com>
1601
1602 * decl.c (complete_start_java_method): Handle synchronized method
1603 even when compiling from bytecode.
1604
f3d50f42
TT
16051999-02-26 Tom Tromey <tromey@cygnus.com>
1606
686fb236
TT
1607 * gjavah.c (add_class_decl): Only generate `#include' if outer
1608 class is not the name of the class we are processing. Correctly
1609 append `.h' in #include.
1610 (process_file): Clean up newlines around generated `#include's.
1611 (decode_signature_piece): Correctly handle inner classes.
1612 (struct include): New structure.
1613 (all_includes): New global.
1614 (print_include): New function.
1615 (add_class_decl): Use it.
1616 (process_file): Likewise.
1617 (add_class_decl): Generate include for java-array.h if array
1618 seen.
1619 (process_file): Don't generate java-array.h include.
1620
f3d50f42
TT
1621 * gjavah.c (add_namelet): Check for standard package names here.
1622 (add_class_decl): Don't check for standard package names here.
1623
345137c7
TT
16241999-02-25 Tom Tromey <tromey@cygnus.com>
1625
1626 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
1627 When reading a zip file, only use strncmp if both strings are
1628 bigger than the buffer length. Initialize `k' when looping
1629 through zip file.
1630
bdb59aec
TT
16311999-02-24 Tom Tromey <tromey@cygnus.com>
1632
1633 * gjavah.c (struct namelet): New structure.
1634 (add_namelet): New function.
1635 (print_namelet): New function.
1636 (print_class_decls): Use add_namelet and print_namelet to generate
1637 namespaces and not classes.
1638 (method_printed): New global.
1639 (HANDLE_END_METHOD): Examine method_printed.
1640 (print_method_info): Set method_printed when required. Print
1641 error if function to be ignored is marked virtual. Handle $finit$
1642 method.
1643 (METHOD_IS_FINAL): New macro.
1644 (print_field_info): Use it.
1645 (HANDLE_METHOD): Clear method_printed.
1646 (method_pass): New global.
1647 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
1648 (process_file): Do two passes over both fields and methods.
1649 (HANDLE_METHOD): Examine method_pass.
1650 (root): New global.
1651 (add_class_decl): New function.
1652 (print_class_decls): Don't scan over entire constant pool.
1653
4e2e5821
TT
16541999-02-23 Tom Tromey <tromey@cygnus.com>
1655
1656 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
1657 disable linking in that case.
1658
a3299934
TT
16591999-02-20 Tom Tromey <tromey@cygnus.com>
1660
1661 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
1662 not 0x1f.
1663
edd643a9
PB
1664Sun Feb 21 14:56:11 1999 Per Bothner <bothner@cygnus.com>
1665
92ada242
PB
1666 * decl.c (build_result_decl), java-tree.h: New method.
1667 (complete_start_java_method): Handle synchronized methods.
1668 Don't build DECL_RESULT here. (Ordering dependency problem.)
1669 (start_java_method): Call build_result_decl here instead ...
1670 * parse.y (java_complete_expand_method): ... and here.
1671 (expand_start_java_method): Don't call complete_start_java_method here.
1672 (java_complete_expand_method): Call it here instead.
1673 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
1674 * java-tree.h: ... here.
1675
1676 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
1677 * parse.y (java_complete_lhs): Don't call force_evaluation_order
1678 for ARRAY_REF - it doesn't work when array bounds are checked.
1679 (patch_array_ref): Handle it here instead.
1680
edd643a9
PB
1681 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
1682
419ff8e1
PB
1683Fri Feb 19 15:35:01 1999 Per Bothner <bothner@cygnus.com>
1684
1685 Force left-to-right evaluation of binary operations etc.
1686 * expr.c (force_evaluation_order), java-tree.h: New function.
1687 * parse.y (java_complete_lhs): Pass binary operations, procedure
1688 calls, and ARRAY_REFs to force_evaluation_order.
1689 (various): Set TREE_SIDE_EFFECTS more carefully.
1690
1691 Tolerate random (non-UTF8) encoding in comments without complaining.
1692 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
1693 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
1694
1695 * parse.y (resolve_qualified_expression_name): Handle error_mark.
1696 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
1697
1698 * parse.y (java_complete_lhs): Ignore an empty statement in a
1699 COMPOUND_EXPR. Don't complain about empty statement after return.
1700
04ed7a0c
PB
1701Fri Feb 19 13:00:56 1999 Per Bothner <bothner@cygnus.com>
1702
1703 * parse.y (obtain_incomplete_type): Don't wrap unknown types
1704 in TREE_LIST - just chain the POINTER_TYPEs together.
1705 (resolve_class): If type already resolved, return decl.
1706 After resolving, update TREE_TYPE(class_type), and name (if array).
1707 * parse.h (do_resolve_class), parse.y: Make non-static.
1708 * class.c (maybe_layout_super_class): Take this_class argument.
1709 Do do_resolve_class if necessary.
1710 (layout_class, layout_class_methods): Adjust calls appropriately.
1711 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
1712 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
1713 * typeck.c (build_java_array_type): Don't call layout_class.
1714
fad22e3b
APB
1715Wed Feb 17 15:47:20 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1716
1717 * parse.y (check_pkg_class_access): Allow private class access
1718 within the same package.
1719 (strip_out_static_field_access_decl): New function.
1720 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
1721 operator argument before testing its nature.
1722
ececaeae
PB
1723Wed Feb 3 12:38:43 1999 Per Bothner <bothner@cygnus.com>
1724
1725 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
1726 (TRY_EXPR): Simplify - it no longer has a finally clause.
1727 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
1728 Simpler handling of TRY_EXPR, which no longer has a finally clause.
1729 * expr.c (java_lang_expand_expr): Likewise.
1730 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
1731 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
1732 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
1733 (build_try_statement): Remove finally parameter and handling.
1734 (build_try_finally_statement): New function.
1735 (patch_try_statement): No longer need to support finally clause.
1736 (try_statement): Update grammar action rules.
1737 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
1738 Simpler handling of TRY_EXPR, which no longer has a finally clause.
1739
43c5ec70
AH
17401998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
1741
1742 * jcf-parse.c (get_constant): Add braces around computation of 'd'
1743 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
1744
7e57923c
AH
17451999-02-17 Andrew Haley <aph@cygnus.com>
1746
1747 * class.c (build_utf8_ref): Back out broken patch which was
1748 intended to to output signatures using '.' as a separator.
1749
1750 * class.c (make_class_data): Output signatures using '.' as a
1751 separator, rather than '/'.
1752 (mangled_classname): Likewise.
1753 (make_field_value): Likewise.
1754 (make_method_value): Likewise.
1755 * constants.c (alloc_class_constant): Likewise.
1756 * expr.c (build_invokeinterface): Likewise.
1757
e3884b71
APB
1758Thu Feb 11 21:25:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1759
1760 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
1761 of an ancient workaround.
1762
e860aea3
JL
1763Wed Feb 10 23:27:33 1999 Jeffrey A Law (law@cygnus.com)
1764
1765 * jvspec.c (xmalloc): Kill the prototype. It does not belong
1766 here anymore.
1767
fa2bb9fd
APB
17681999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
1769
1770 * lex.c (yylex): Encode \0 as UTF8.
1771
0ffe9eea
TT
17721999-02-10 Tom Tromey <tromey@cygnus.com>
1773
00368bdd
TT
1774 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
1775 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
1776 (libgcj_zip): Renamed.
1777 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
1778 LIBJAVA_ZIP_FILE.
1779 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
1780
0ffe9eea
TT
1781 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
1782 (GC_NAME): Renamed -lgc to -lgcjgc.
1783
09ed0f70
APB
1784Tue Feb 9 19:31:09 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1785
1786 * lex.c (java_lang_cloneable): Initialize.
1787 * parse.y (java_lang_cloneable): New static variable.
1788 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
1789 doing one more qualification round.
1790 (valid_ref_assignconv_cast_p): Reject null source or
1791 destination. Allow an array to be cast into java.lang.Cloneable.
1792 (patch_cast): Swapped two first arguments to first call to
1793 valid_ref_assignconv_cast_p.
1794
34f4db93
APB
1795Mon Feb 8 11:50:50 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1796
1797 * parse.h: DECL_P renamed JDECL_P.
1798 * parse.y: DECL_P replaced by JDECL_P.
1799 (build_array_from_name): Always use pointer's type.
1800 (patch_bc_statement): Extra code to search continue target in a
1801 for loop. Fixed comments. Continue target is current loop when
1802 unlabeled.
1803
93089423
AH
18041999-02-05 Andrew Haley <aph@cygnus.com>
1805
1806 * class.c (make_class_data): The superclass of an interface should
1807 be null, not class Object.
1808
1809 * lex.c (java_lex): Sign extend hex literals.
1810
954d8a5d
AH
18111999-02-04 Andrew Haley <aph@cygnus.com>
1812
1813 * class.c (build_utf8_ref): Output signatures using '.' as a
1814 separator, rather than '/'.
1815 (make_class_data): Likewise.
1816
3204fae4
ME
1817Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
1818
1819 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
1820 mkstemp.o. Get them from libiberty now.
1821
6d6dbe51
JL
1822Tue Feb 2 19:49:12 1999 Jeffrey A Law (law@cygnus.com)
1823
1824 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
1825
b0f780c3
KG
1826Tue Feb 2 20:04:50 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1827
1828 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
1829 from libiberty.h
1830
bb31662f
PB
1831Tue Feb 2 10:39:47 1999 Per Bothner <bothner@cygnus.com>
1832
1833 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
1834 * jcf-write.c (generate_bytecode_return): New function.
1835 (generate_bytecode_insns): Use it, for RETURN_EXPR.
1836
1837 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
1838 generate special [fd]const_[01] instructions.
1839
1840 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
1841
1842 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
1843 handling OPCODE_lookupswitch or OPCODE_tableswitch.
1844
f044fba9
PB
1845Mon Feb 1 20:44:47 1999 Per Bothner <bothner@cygnus.com>
1846
1847 * parse.y (patch_method_invocation): Handle calling static methods,
1848 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
1849
1850 * parse.y (java_complete_lhs): Don't complain about unreachable
1851 exit condition in a do-while statement.
acd663ee
APB
1852
1853Fri Jan 29 18:19:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1854
1855 * lex.c (java_read_char): Fixed utf8 decoding.
1856 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
1857 range.
1858 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
1859 comments. Local variable `all_primitive' is gone. Broadened
1860 acceptance of `0' to floating point targets. `long' can now be
1861 widened to `double' or `float'.
1862 (valid_method_invocation_conversion_p): Added leading
1863 comment. Fixed tabulation.
1864 (build_string_concatenation): Optimize out left or right empty
1865 string constants.
f044fba9 1866
36be4b99
PB
1867Thu Jan 28 18:51:26 1999 Per Bothner <bothner@cygnus.com>
1868
1869 * jcf-write.c (localvar_alloc): Only emit entry for
1870 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
1871 (generate_bytecode_insns): Only call put_linenumber if
1872 debug_info_level > DINFO_LEVEL_NONE.
1873 * jvspec.c (lang_specific_driver): If no -O* or -g* option
1874 is specified, add -g1 (for compatibility wih javac).
1875
9594b1b2
HPN
1876Thu Jan 28 09:17:51 1999 Hans-Peter Nilsson <hp@axis.se>
1877
1878 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
1879 gjavah.o, check-init.o, jv-scan.o
1880
9caaf519
KG
1881Mon Feb 1 09:50:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1882
1883 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
1884
1885 * gjavah.c: Include config.h and system.h.
1886
1887 * javaop.h (inline): Don't define, its handled by system.h.
1888 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
1889 from `inline' to `static inline'.
1890
1891 * jcf.h (inline): Don't define, its handled by system.h.
1892
1893 * lex.c (inline): Likewise.
1894
ba140e41
ZW
1895Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
1896
1897 * lang-specs.h: Map -Qn to -fno-ident.
1898
4c7f1c63
RH
1899Fri Jan 29 16:51:56 1999 Richard Henderson <rth@cygnus.com>
1900
1901 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
1902
061ac426
TT
19031999-01-29 Tom Tromey <tromey@cygnus.com>
1904
1905 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
1906 then cast it to Object before calling `append' method.
1907
f2693f2f
PB
1908Thu Jan 28 14:45:39 1999 Per Bothner <bothner@cygnus.com>
1909
1910 * check-init.c (check_bool2_init, check_bool_init, check_init):
1911 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
1912 * jcf-write.c (generate_bytecode_insns): Likewise.
1913
0b4d333e
APB
1914Thu Jan 28 11:50:11 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1915
1916 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
1917 * parse.y (patch_cast): Allow a boolean to be cast into a
1918 boolean.
1919
1920Wed Jan 27 10:19:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1921
1922 * parse.y: (class_declaration:): Fixed indentation.
1923 (class_member_declaration:): Extra `;' after field declaration now
1924 accepted.
1925 (interface_declaration:): Removed debug messages in error reports.
1926 (patch_binop): Nodes created and returned inherit the orignal
1927 node's COMPOUND_ASSIGN_P flag value.
1928 (patch_cast): Fix cast from char to floating point.
1929
1b18747f
AH
1930Mon Jan 25 17:39:19 1999 Andrew Haley <aph@cygnus.com>
1931
1932 * except.c, java-except.h (expand_resume_after_catch): new
1933 function.
1934 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
1935 to branch back to main flow of control after a catch block.
1936
d4476be2
KG
1937Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1938
1939 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
1940 $(srcdir)/../system.h.
1941 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
1942 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
1943 (jcf-write.o): Likewise.
1944 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1945 (mangle.o): Depend on $(srcdir)/../toplev.h.
1946 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1947 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1948
1949 * class.c: Include output.h and parse.h.
1950 (mangled_classname): Add the `const' keyword to a char*.
1951 (find_named_method): Hide unused function definition.
1952 (build_utf8_ref): Change type of variable `c' to unsigned char.
1953 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
1954 (build_class_ref): Add the `const' keyword to a char*.
1955 (layout_class_method): Remove unused variable `buf'.
1956
1957 * decl.c (find_local_variable): Remove unused variable `rtl'.
1958 (pushdecl): Likewise for variables `different_binding_level' and
1959 `oldglobal'.
1960 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
1961 (maybe_build_cleanup): Likewise for parameter `decl'.
1962
1963 * except.c (expand_start_java_handler): Mark parameter `range'
1964 with ATTRIBUTE_UNUSED.
1965
1966 * expr.c: Include except.h.
1967 (pop_type): Remove unused variable `i'.
1968 (pop_value): Likewise for variables `n_words' and `i'.
1969 (expand_java_arrayload): Likewise for variable `convert'.
1970 (java_lang_expand_expr): Likewise for variables `op0', `type',
1971 `mode', `unsignedp', `node' and `elements'.
1972 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
1973 `eh_ranges'.
1974 (process_jvm_instruction): Add a `const' qualifier to a char*.
1975
1976 * gjavah.c (output_directory): Add the `const' keyword to a char*.
1977 (temp_directory): Likewise.
1978 (print_c_decl): Likewise.
1979 (print_method_info): Likewise.
1980 (decode_signature_piece): Likewise.
1981 (print_mangled_classname): Likewise.
1982
1983 * java-except.h: Provide prototypes for maybe_start_try,
1984 maybe_end_try and add_handler.
1985
1986 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
1987 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
1988 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
1989 init_expr_processing, push_super_field, init_class_processing,
1990 can_widen_reference_to, class_depth, verify_jvm_instructions,
1991 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
1992 set_local_type, merge_type_state, push_type, load_type_state,
1993 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
1994 emit_unicode_mangled_name): Add prototypes.
1995
1996 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
1997 (print_signature_type): Use ISDIGIT, not isdigit.
1998 (print_signature): Remove unused variable `j'.
1999
2000 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
2001 int when comparing against one.
2002
2003 * jcf-parse.c: Include toplev.h.
2004
2005 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
2006 (localvar_free): Remove unused variable `i'.
2007 (generate_bytecode_conditional): Likewise for variable `kind'.
2008
2009 * jv-scan.c: Include config.h and system.h. Remove redundant
2010 OS header and gansidecl.h includes.
2011 (warning): Add the `const' keyword to a char*. Also add
2012 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
2013 __STDC__, when determining whether to use ANSI-isms.
2014 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
2015 (xmalloc): Don't redundantly prototype here.
2016 (main): Remove unused parameter `envp'. Also fix the arguments
2017 passed to function `fatal' to match the format specifier.
2018
2019 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
2020
2021 * mangle.c: Include toplev.h.
2022 (emit_unicode_mangled_name): Declare parameter `len'.
2023
2024 * parse.y (parse_warning_context): Add the `const' keyword to a
2025 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
2026 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
2027 (issue_warning_error_from_context): Add the `const' keyword to
2028 a char*.
2029 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
2030 not `__STDC__' for whether to use ANSI-isms.
2031
2032 * typeck.c (incomplete_type_error): Mark parameters `value' and
2033 `type' with ATTRIBUTE_UNUSED.
2034 (parse_signature_type): Use ISDIGIT, not isdigit.
2035
2036 * verify.c (check_pending_block): Add the `const' keyword to a char*.
2037 (verify_jvm_instructions): Likewise. Remove unused variables
2038 `field_name' and `default_val'.
2039
2040 * zextract.c: Include config.h and system.h. Remove redundant
2041 OS header includes.
2042
2043 * zipfile.h: Prototype `read_zip_archive'.
2044
fff02f07
AH
2045Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
2046
2047 * typeck.c (convert): Allow conversions to void type: some
2048 optimizations in gcc do this.
2049
2050Thu Jan 21 15:21:49 1999 Andrew Haley <aph@cygnus.com>
2051
2052 * typeck.c (convert_ieee_real_to_integer): New function.
2053 (convert): When not using fast-math and using hardware fp, convert
2054 an IEEE NaN to zero.
2055
73333a87
AH
20561999-01-18 Andrew Haley <aph@cygnus.com>
2057
2058 * parse.y (patch_binop): Do a type conversion from signed to
2059 unsigned and then back to signed when a ">>>" is found.
2060
d8fccff5
APB
2061Sun Jan 17 22:34:22 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2062
2063 * java-tree.h: (check_for_initialization): Added prototype.
2064 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
2065 * parse.y (do_resolve_class): Removed unused locals.
2066 (read_import_dir): Likewise.
2067 (resolve_qualified_expression_name): Array creation
2068 expressions are valid primary expressions.
2069 (qualify_ambiguous_name): Likewise.
2070 (patch_synchronized_statement): Removed unused local.
2071
82770562
JL
2072Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com)
2073
ef2b940d
JL
2074 * Makefile.in (zextract.o): Add dependencies.
2075
82770562
JL
2076 * Makefile.in: Do not put ^Ls at the start of a line.
2077
2a4dc31b
PB
2078Fri Jan 15 20:16:20 1999 Per Bothner <bothner@cygnus.com>
2079
2080 * expr.c (process_jvm_instruction): Coerce to correct Throwable
2081 sub-type the result of the call that gets the exception value.
2082
2083 * parse.y (java_complete_expand_methods): If flags_syntax_only,
2084 don't call finish_class.
2085
2086 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
2087 clear found before continuing.
2088
2089 * verify.c (verify_jvm_instructions): On an array load, allow
2090 and handle top of stack to be TYPE_NULL.
2091
2092 * gjavah.c (generate_access): Translate Java package private or
2093 protected access to C++ public, but with a comment.
2094
96847892
AH
20951999-01-13 Andrew Haley <aph@cygnus.com>
2096
2097 * expr.c (generate_name): Name prefix changed to avoid clashes
2098 with assembler temp labels.
2099
2100 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
2101 MODIFY_EXPR. Without this, code for the assignement may not be
2102 generated at all and the synchronized statement will read an
2103 uninitialized variable.
2104
ba179f9f
APB
2105Wed Jan 13 01:24:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2106
2107 * class.c (maybe_layout_super_class): Fixed returned value.
2108 * lex.c: Added 1999 to the copyright.
2109 (java_init_lex): Initialize java_lang_imported.
2110 * lex.h: Added 1999 to the copyright.
2111 * parse.h: Added 1999 to the copyright.
2112 (REGISTER_IMPORT): Fixed typo in trailing macro.
2113 (CURRENT_OSB): New macro.
2114 (struct parser_ctxt): New fields osb_depth, osb_limit.
2115 * parse.y (java_lang_id): New global variable.
2116 (type_import_on_demand_declaration): Don't import java.lang.* twice.
2117 (array_creation_expression:): Use CURRENT_OSB.
2118 (dims:): Uses a stack to keep track of array dimensions.
2119 (cast_expression:): Use CURRENT_OSB.
2120 (find_expr_with_wfl): Return NULL if node found doesn't meet the
2121 conditions.
2122 (register_fields): Fixed typos in comment.
2123 (check_method_redefinition): Fixed comment indentation.
2124 (java_check_regular_methods): Set saved found wfl to NULL after
2125 having reinstalled it in the previously found DECL_NAME.
2126
b6186fe6
RH
2127Sun Jan 10 13:36:14 1999 Richard Henderson <rth@cygnus.com>
2128
2129 * gjavah.c (java_float_finite): Use a union to do type punning.
2130 (java_double_finite): Likewise.
2131
fe053cfc
PB
2132Sat Jan 9 11:25:00 1999 Per Bothner <bothner@cygnus.com>
2133
2134 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
2135 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
2136 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
2137 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
2138 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
2139 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
2140
b82daa87
PB
2141Fri Jan 8 15:48:03 1999 Per Bothner <bothner@cygnus.com>
2142
2143 * check-init.c (check_init): If compiling to native, we don't
2144 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
2145
5c280133
TT
21461999-01-08 Tom Tromey <tromey@cygnus.com>
2147
2148 * parse-scan.y (variable_declarator_id): Set or increment
2149 bracket_count.
2150 (bracket_count): New global.
2151 (formal_parameter): Handle case where bracket pairs trail variable
2152 declarator id.
2153
5e1db167
AH
21541999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
2155
2156 * jcf-parse.c (yyparse): variable len changed from a char to an
2157 int to prevent overflow.
2158
db84cc46
PB
2159Wed Jan 6 17:19:46 1999 Per Bothner <bothner@cygnus.com>
2160
2161 * java-tree.h: Declare read_class.
2162 * jcf-parse.c (read_class): New function.
2163 (load_class): Now just call read_class.
2164
2165 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
2166 * jcf-parse.c (parse_source_file): Declare save_error_count,
2167 which is needed by java_parse_abort_on_error macro,
2168 * parse.y (java_layout_classes, java_expand_classes): Likewise.
2169
2170 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
2171 constructor, if initializing a static field.
2172 (patch_new_array_init): Set TREE_CONSTANT if it is.
2173 * expr.c (java_lang_expand_expr): For a static array constructor
2174 of primitive elements, allocate the array itself statically.
2175 Disabled until we can set the vtable field statically.
2176
2177 * check-init.c: New file. Checks for definite assignment.
2178 * Makefile.in (JAVA_OBJS): Add check-init.o.
2179 * parse.y (java_complete_expand_method): Call check_for_initialization.
2180 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
2181
8c4ea1fd
GS
2182Wed Jan 6 14:53:10 1999 Graham <grahams@rcp.co.uk>
2183
2184 * parse.y : include system.h instead of including
2185 standard headers directly with the exception of <dirent.h>.
2186
0d34ccb7
PB
2187Wed Jan 6 16:20:06 1999 Per Bothner <bothner@cygnus.com>
2188
2189 * lex.h: Moved static function declarations to lex.c,
2190 to shut up some -Wall warnings.
2191 * lex.c: Static function declarations moved here.
2192 * jcf-dump.c: Small fixes to shut up -Wall warnings.
2193
5b5d821c
KG
2194Tue Jan 5 22:15:40 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2195
2196 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
2197
e402ca98
PB
2198Tue Dec 22 11:25:19 1998 Per Bothner <bothner@cygnus.com>
2199
2200 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
2201 * verify.c (verify_jvm_instructions): Fix off-by-one error.
2202
2203 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
2204 (localvar_alloc): Change return type to void,
2205 (emit_unop): Remove unused variable size.
2206
2207 * jcf-write.c (struct jcf_block): Add new union.
2208 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
2209 (call_cleanups): New functions.
2210 (struct jcf_partial): New fields num_finalizers and return_value_decl.
2211 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
2212 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
2213 * lang.c (lang_init): Call using_eh_for_cleanups.
2214 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
2215 completing operands to patch_synchronized_statement.
2216 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
2217 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
2218 WITH_CLEANUP_EXPR instead of TRY_EXPR.
2219
62481348
JC
2220Sun Dec 20 16:15:44 1998 John F. Carr <jfc@mit.edu>
2221
2222 * Make-lang.in: Comment out control-Ls; they upset some makes.
2223
847fe791
TT
22241998-12-18 Tom Tromey <tromey@cygnus.com>
2225
2226 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
2227 consistently.
2228
d5ff227d
TT
22291998-12-17 Tom Tromey <tromey@cygnus.com>
2230
fa322ab5
TT
2231 * parse.y (DIR_SEPARATOR): New define.
2232 (check_class_interface_creation): Use it.
2233
d5ff227d
TT
2234 * parse-scan.y (report_main_declaration): Recognize
2235 `java.lang.String' in argument to main.
2236
83a86272
PB
2237Wed Dec 16 16:18:59 1998 Per Bothner <bothner@cygnus.com>
2238
2239 * parse.y (create_interface): Remove bogus test.
2240
f868ca8f
PB
2241Wed Dec 16 14:42:19 1998 Per Bothner <bothner@cygnus.com>
2242
2243 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
2244 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
2245
0252081c
TT
22461998-12-16 Tom Tromey <tromey@cygnus.com>
2247
2248 * parse-scan.y (qualified_name): Use correct sprintf format.
2249
06d84d69
TT
22501998-12-15 Tom Tromey <tromey@cygnus.com>
2251
2252 * gjavah.c (print_field_info): Changed how most negative number is
2253 printed.
2254
659ad450
PB
2255Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com>
2256
2257 * parse.y (fold_constant_for_init): New function.
2258 (resolve_expression_name): Don't replace static final
2259 constant-initialized fields by its value.
2260 (java_complete_lhs): New. Same as java_complete_tree, except does
2261 not replace static final constant-initialized fields by their values.
2262 (register_fields): If there is an initializer, set DECL_INITIAL and
2263 MODIFY_EXPR_FROM_INITIALIZATION_P.
2264 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
2265 Only call patch_initialized_static_field if
2266 MODIFY_EXPR_FROM_INITIALIZATION_P.
2267 (patch_initialized_static_field): If not valid constant, clear
2268 DECL_INITIAL.
2269
2270 * parse.y (lookup_field_wrapper): Fix thinko.
2271
2272 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
2273 set and restore global lineno.
2274
11b89622
TT
22751998-12-14 Tom Tromey <tromey@cygnus.com>
2276
2277 * gjavah.c (print_field_info): If value to print is the smallest
2278 value of its size, then print as hex to avoid later warnings from
2279 C++ compiler.
2280
8c2dfb32
TT
22811998-12-14 Tom Tromey <tromey@cygnus.com>
2282
2283 * gjavah.c (decompile_method): Decompile `return null'.
2284 (process_file): Generate `#pragma interface'.
2285 (method_declared): New global.
2286 (print_method_info): Set it.
2287 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
2288 (print_method_info): Handle abstract methods.
2289
ba02c53a
PB
2290Sun Dec 13 17:31:40 1998 Per Bothner <bothner@cygnus.com>
2291
2292 * parse.y (patch_method_invocation): If class_decl is null
2293 (e.g. an array type), use original type.
2294
2295 * parse.y (check_thrown_exceptions): Temporary hack to suppress
2296 errors about uncaught exception from clone (of array, specifically).
2297
cb975f38
TT
22981998-12-13 Tom Tromey <tromey@cygnus.com>
2299
2300 * gjavah.c (decompile_method): Handle all types of `return'
2301 opcode. Decompile `return this' and `return'.
2302 (method_access): New global.
2303 (print_method_info): Set it.
2304 (decompile_method): Don't decompile a synchronized method.
2305
92c068d1
TT
23061998-12-13 Tom Tromey <tromey@cygnus.com>
2307
2308 * jcf-reader.c (jcf_parse_one_method): Recognize
2309 HANDLE_END_METHOD.
2310 * gjavah.c (HANDLE_END_METHOD): New macro.
2311 (HANDLE_CODE_ATTRIBUTE): New macro.
2312 (decompile_method): New function.
2313 (print_method_info): Don't print `;\n' at end of function decl.
2314 Include java-opcodes.h.
2315 (decompiled): New global.
2316
0b245181
PB
2317Sat Dec 12 20:13:19 1998 Per Bothner <bothner@cygnus.com>
2318
2319 * class.c (build_class_ref): Handle PRIMTYPE.class if
2320 flag_emit_class_files.
2321 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
2322 if flag_emit_class_files.
2323 * parse.y (java_complete_tree): Pre-liminary support for
2324 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
2325
2326 * parse.y (patch_synchronized_statement): Don't call monitorexit
2327 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
2328
2329 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
2330
2331 * zipfile.h (opendir_in_zip): New declaration.
2332 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
2333 (opendir_in_zip): New function, using code from open_in_zip.
2334 (open_in_zip): Call opendir_in_zip.
2335 (find_class): Remove no-longer-used do_class_file parameter,
2336 but add source_ok parameter. Change logic so if we find a .java file,
2337 we don't look for .class in later classpath emtries.
2338 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
2339 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
2340 * gjavah.c: Update call to find_class.
2341 * jcf-dump.c: Likewise.
2342
2343 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
2344 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
2345 nothing if body is empty_stmt_node.
2346 Various little fixes so SP gets correctly adjusted.
2347 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
2348 For CALL_EXPR, test if static first.
2349 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
2350 such as the ones we create for Object and Class.
2351 Set and restore current_function_decl.
2352 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
2353 (note_possible_classname): New function.
2354 (read_import_entry): Removed. Merged with read_import_dir.
2355 (read_import_dir): Don't call find_class - that only gives us
2356 the first classpath entry having the needed package.
2357 Use the struct buffer data structure from buffer.h.
2358 (read_import_dir, find_in_imports_on_demand): The remembered
2359 class names now use '.' (not '/') as package separator.
2360
2361 * parse.y (java_complete_expand_methods): Call write_classfile
2362 here, and not in java_expand_classes (which only gets first class).
2363
9dd939b2 2364Sat Dec 12 19:46:04 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1287b91a
APB
2365
2366 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
2367 (register_fields): If a static fields has an initializer, just
2368 chain it on ctxp->static_initialized, and handle later.
2369 (java_complete_expand_methods): Force <clinit> first.
2370 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
2371 - it's already been completed.
2372 (patch_initialized_static_field): New function.
2373 (java_complete_field): Call it.
2374
05f9acdc
PB
2375Sat Dec 12 19:21:11 1998 Per Bothner <bothner@cygnus.com>
2376
2377 * expr.c (encode_newarray_type, build_new_array): New functions.
2378 * java-tree.h: Declare build_new_array.
2379 * jcf-write.c (patch_newarray): Use build_new_array.
2380
2381 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
2382 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
2383
2384 * parse.y (patch_new_array_init): Re-organize.
2385 Now is passed the actual array (pointer) type of the value.
2386 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
2387 (patch_array_constructor): Removed - merged into patch_new_array_init.
2388 (java_complete_tree): Update patch_new_array_init.
2389
2390 * jcf-write.c (find_constant_index): New function.
2391 (generate_bytecode_insns): Use find_constant_index.
2392 (generate_classfile): Use find_constant_index for ConstantValue.
2393
78857b4e
TT
23941998-12-11 Tom Tromey <tromey@cygnus.com>
2395
2396 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
2397 * decl.c (init_decl_processing): Renamed dtable -> vtable.
2398 * class.c (make_class_data): Renamed dtable -> vtable, and
2399 dtable_method_count -> vtable_method_count.
2400
9dd939b2 2401Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4a5f66c3
APB
2402
2403 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
2404 global variables, initialized.
2405 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
2406 Declared new global variables.
2407 * lex.c (java_lex): Return long_zero_node, float_zero_node,
2408 double_zero_node, integer_zero_node upon direct matching.
2409 * parse.y (purify_type_name): Added function prototype.
2410 (duplicate_declaration_error_p): Consider new_type as potentially
2411 being a incomplete type. Use purify_type_name on type string.
2412 (method_header): saved_type: unused variable removed. Don't figure
2413 return type if method name is invalid.
2414 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
2415 processed by patch_unaryop.
2416 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
2417 increment/decrement node into its original type after binary
2418 numeric promotion on its operands.
2419
1179ebc2
APB
2420Thu Dec 10 11:02:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2421
2422 * parse.y (array_initializer:): Array init operand is NULL_TREE
2423 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
2424 now an error. Fixed indentation problems.
2425 (patch_string): Handle error_mark_node as an argument.
2426 (patch_new_array_init): Fixed indentation problems.
2427 (array_constructor_check_entry): Removed check on null wfl_value.
2428 Return an error if wfl_value's walk returns an error.
2429
f8976021
APB
2430Wed Dec 9 15:37:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2431
2432 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
2433 * lex.c (java_lex): Remember column position before advancing one
2434 token. Retain location information on OCB_TK.
2435 * lex.h (typedef struct java_lc): Added new field.
2436 * parse.h (GET_SKIP_TYPE): New macro.
2437 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
2438 * parse.y (build_new_array_init, patch_new_array_init,
2439 patch_array_constructor, maybe_build_array_element_wfl,
2440 array_constructor_check_entry): New function prototypes.
2441 (switch_block:): Tagged <node>.
2442 (OCB_TK): Tagged <operator>.
2443 (array_initializer:): Installed actions.
2444 (variable_initializer): Build location information on element if
2445 necessary.
2446 (switch_statement:): Fixed indentation typo.
2447 (switch_block:): Redefined default action.
2448 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
2449 (patch_assignment): Removed duplicate code.
2450 (maybe_build_array_element_wfl, build_new_array_init,
2451 patch_new_array_init, patch_array_constructor,
2452 array_constructor_check_entry): New functions.
2453
ac825856
APB
2454Mon Dec 7 15:13:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2455
2456 * parse.y (array_initializer): Tagged <node>.
2457 (variable_initializer:): Use default rule.
2458 (array_initializer:): Defined actions.
2459 (variable_initializers:): Likewise.
2460 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
2461 non-static field accesses.
2462 (patch_invoke): Fixed indentation typo.
2463 (java_complete_tree): Likewise.
2464 (build_labeled_block): Changed leading comment. Generate an error
2465 in case of duplicate loop labels.
2466 (patch_conditional_expr): Patch results of string concatenation
2467 operations.
2468
2dfaf550
PB
2469Sun Dec 6 13:45:00 1998 Per Bothner <bothner@cygnus.com>
2470
2471 * constants.c (find_methodref_index): When the class is an interface,
2472 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
2473
2474 * decl.c (finit_identifier_node): Use "$finit$", rather than
2475 "<finit>" (which Sun's verifier rejects).
2476 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
2477 (generate_field_initialization_code): Removed.
2478 (fix_constructors) Don't add call to $finit$ here (wrong order).
2479 (patch_method_invocation): Add $finit$ call here.
2480
2481 * java-tree.h (CALL_USING_SUPER): New macro.
2482 * parse.y (patch_invoke): Remove im local variable.
2483 (patch_method_invocation, patch_invoke): Don't pass super parameter.
2484 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
2485 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
2486
2487 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
2488
2489 * parse.y (java_complete_tree): Don't complain about unreachable
2490 statement if it is empty_stmt_node.
2491
2492 * jcf-write.c (find_constant_wide): New function.
2493 (push_long_const): Use find_constant_wide.
2494
2495 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
2496 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
2497 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
2498 Emit invokeinterface when calling an interface method.
2499 Emit invokespecial also when calling super or private methods.
2500
2501 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
2502
0f0d3319
PB
2503Sun Dec 6 13:21:18 1998 Per Bothner <bothner@cygnus.com>
2504
2505 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
2506
1886c9d8
APB
2507Thu Dec 3 17:11:12 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2508
2509 * java-tree.h (java_layout_seen_class_methods): New function
2510 prototype.
2511 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
2512 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
2513 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
2514 * parse.y (method_declarator:): Defined action.
2515 (issue_warning_error_from_context): input_filename saved, set to
2516 the appropriate value and restored after java_error is called.
2517 (build_unresolved_array_type): Fixed comment.
2518 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
2519 (method_header): Deal with return type the same way type are
2520 handled for fields and method's parameters and local variables
2521 types are handled.
2522 (check_method_redefinition): Removed extra CR.
2523 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
2524 (java_layout_seen_class_methods): New function.
2525 (java_layout_classes): Call java_layout_seen_class_methods.
2526
52e01aa6
PB
2527Thu Dec 3 15:56:50 1998 Per Bothner <bothner@cygnus.com>
2528
2529 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
2530
66af84e4
PB
2531Thu Dec 3 15:08:30 1998 Per Bothner <bothner@cygnus.com>
2532
2533 * jcf-dump.c (main): Fix error message.
2534 * jcf-path.c (add_entry): Style fix.
2535
c3f2a476
APB
2536Wed Dec 2 15:52:25 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2537
2538 * class.c (layout_class_method): Call build_java_argument_signature
2539 on constructors too.
2540 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
2541 (patch_method_invocation): Define a primary when resolving an
2542 expression name. Augmented comment on code checking illegal `this'
2543 usage. Loosened it test by accepting NEW_CLASS_EXPR.
2544
82371d41
APB
2545Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2546
2547 * class.c (layout_class_method): Don't report error on non-static
2548 overriding static if the method is private.
2549 * java-tree.h (finish_class): Prototype added.
2550 * lex.c (java_get_line_col): Handle col argument -2 value.
2551 * parse.h: All static method declarations moved to parse.y.
2552 * parse.y: Now contains all static method declarations previously
2553 found in parse.h.
2554 (find_expr_with_wfl, missing_return_error,
2555 unreachable_stmt_error): New functions.
2556 (java_get_real_method_name): Identify constructors bearing class
2557 names in source code compiled classes only.
2558 (java_complete_expand_methods): Call missing_return_error.
2559 (invocation_mode): Private methods invoked as static methods.
2560 (java_complete_tree): Call unreachable_stmt_error.
2561
de80f416
TT
25621998-12-01 Tom Tromey <tromey@cygnus.com>
2563
2564 * Makefile.in (+target): Removed.
2565 (+xmake_file): Likewise.
2566 (+tmake_file): Likewise.
2567 (.NOEXPORT): Removed duplicate.
2568
45254bf6
KG
2569Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2570
2571 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
2572
2573 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
2574
2575 * jvgenmain.c: Remove the xmalloc prototype, we get it from
2576 libiberty.h. Provide an xmalloc definition.
2577
2578 * jvspec.c: Remove the xmalloc prototype.
2579
2580 * parse-scan.y: Include config.h and system.h. Don't include
2581 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
2582 Provide an xstrdup definition.
2583
ceff9b14 2584Thu Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
076b41ee 2585
ceff9b14
AO
2586 * jcf-path.c (add_entry): Recognize ".jar" too.
2587 * lang-specs.h: Likewise.
076b41ee 2588
c5941a9f
PB
2589Thu Nov 26 12:44:07 1998 Per Bothner <bothner@cygnus.com>
2590
2591 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
2592 soft_monitorenter_node, soft_monitorexit_node, throw_node.
2593
2594 * jcf-write.c (generate_bytecode_insns):
2595 Handle pre/post-increment/decrement of long.
2596
2597 * jcf-write.c (generate_bytecode_insns):
2598 Handle missing exception handler (finally for synchronized).
2599
00abfc00
PB
2600Wed Nov 25 09:47:15 1998 Per Bothner <bothner@cygnus.com>
2601
df8940cf
PB
2602 * java-tree.h (end_params_node): Declare global.
2603 * decl.c (end_params_node): New global.
2604 (init_decl_processing, start_java_method): Use end_params_node for
2605 end of list of parameter types. Follows correct gcc conventions.
2606 * expr.c (pop_argument_types, pop_arguments): Likewise.
2607 * lang.c (put_decl_node): Likewise.
2608 * typeck.c (various places): Likewise.
2609 * class.y (various places): Likewise.
2610 * parse.y (various places): Likewise.
2611
2612 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
2613 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
2614
2615 * class.c: Add #include flags.h, remove no-longer needed declaration.
2616
2617 * class.c (layout_class_method): Remove commented-out code, re-format.
2618 Don't add vtable entry (or index) for private methods.
2619 * expr.c (expand_invoke): A private method is implicitly final.
2620 * class.c (make_class_data): If inlining or optimizing,
2621 skip private methods.
2622
2623 * class.c (finish_class): New function. Calls existing methods,
2624 but alls emits deferred inline functions.
2625 * jcf-parse.c (parse_class_file): Call finish_class.
2626 * parse.y (java_complete_expand_methods): Likewise.
2627
2628 * expr.c (build_java_binop): Explicit default, to silence -Wall.
2629
00abfc00
PB
2630 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
2631
de7b168e
ME
2632Wed Nov 25 00:50:58 1998 Marc Espie <espie@quatramaran.ens.fr>
2633
2634 * jcf-write.c (generate_bytecode_conditional): Fix typo.
2635
23a79c61
APB
2636Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com>
2637
2638 * (generate_classfile): Always write class access flag with
2639 ACC_SUPER set.
2640
2641Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2642
2643 * class.c (maybe_layout_super_class): New function.
2644 (layout_class): Reorganized. Loop on class methods dispatched into
2645 a new function. Call maybe_layout_super_class.
2646 (layout_class_methods, layout_class_method): New functions.
2647 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
2648 class.
2649 (expand_invoke): Likewise.
2650 * java-tree.h (all_class_list): New global variable declared.
2651 (layout_class_methods, layout_class_method): New function
2652 prototypes.
2653 (LAYOUT_SEEN_CLASS_METHODS): New macro.
2654 * jcf-parse.c (all_class_list): New global variable.
2655 (load_class): Extended what class_or_name can be. Use parser
2656 context mechanism to save globals before calling jcf_parse.
2657 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
2658 is set on the file name.
2659 (jcf_parse): Layout class methods when Object is loaded, otherwise
2660 record class in all_class_list for delayed method layout.
2661 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
2662 * lang.c (put_decl_node): Decode <init> into the decl context
2663 class name.
2664 * lex.c (java_allocate_new_line): Use xmalloc.
2665 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
2666 pointers, not TREE_LIST elements.
2667 (struct parser_ctxt): Fixed comment indentations, added comments
2668 and reordered some fields.
2669 (java_check_methods): Function prototype removed.
2670 * parse.y (java_push_parser_context): Use xmalloc.
2671 (java_parser_context_restore_global): Pop extra pushed ctxp only
2672 when there's nothing next.
2673 (maybe_create_class_interface_decl): Fixed comment, add new
2674 created class decl to all_class_list.
2675 (method_header): Use GET_REAL_TYPE on argument's types.
2676 (method_declarator): Use GET_REAL_TYPE, change type to the real
2677 type in TREE_LIST dependency node. Build argument list with the
2678 real type.
2679 (create_jdep_list): Use xmalloc. Removed allocation error message.
2680 (obtain_incomplete_type): Fixed leading comment. Broadened
2681 incoming argument meaning.
2682 (register_incomplete_type): Use xmalloc. Removed allocation error
2683 message.
2684 (safe_layout_class): Fixed leading comment.
2685 (jdep_resolve_class): Reversed if statement condition and switch
2686 if and else bodies.
2687 (resolve_and_layout): Fixed leading comment. Broadened incoming
2688 argument meaning.
2689 (complete_class_report_errors): New local variable name, for
2690 clarity. purify_type_name used for all error cases.
2691 (java_get_real_method_name): Stricter check on constructors.
2692 (java_check_regular_methods): Reverse methods list only if not
2693 already laid out. Layout artificial constructor.
2694 (java_check_methods): Deleted.
2695 (source_start_java_method): Obtain incomplete type for patchable
2696 method arguments.
2697 (java_layout_classes): Fixed leading comment. Use
2698 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
2699 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
2700 before returning. Fixed comments.
2701 (java_expand_classes): Check for errors up front.
2702 (patch_method_invocation): Class to search is resolved and laid
2703 out.
2704
818347b4
PB
2705Tue Nov 24 12:57:13 1998 Per Bothner <bothner@cygnus.com>
2706
2707 * expr.c (java_lang_expand_expr): Add missing emit_queue.
2708
2709 * javaop.h (int8): Removed - not used.
2710 (jbyte): Redefine portably with correct signedness.
2711
2712 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
2713
2714 * jcf-write.c (generate_bytecode_insns): Fix typo
2715 OPCODE_getstatic to OPCODE_getfield.
2716
2717 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
2718 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
2719 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
2720
1c7f3673
APB
2721Thu Nov 19 11:16:55 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2722
2723 * jcf-parse.c (jcf_parse_source): Function returned type is
2724 void. Added prototype.
2725 (jcf_parse): Function returned type is void.
2726 (yyparse): Remove call to fclose on the last parsed file.
2727
2728 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
2729
c877974e
APB
2730Wed Nov 18 23:54:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2731
2732 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
2733 (layout_class): Cope with methods featuring WFL in decl names.
2734 * decl.c (unqualified_object_id_node): New global variable,
2735 initialized.
2736 (build_decl_no_layout): Removed.
2737 * expr.c (build_primtype_type_ref): Handle Double.
2738 (java_lang_expand_expr): Fixed indentations.
2739 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
2740 (flag_wall, flag_redundant, flag_not_overriding,
2741 flag_static_local_jdk1_1, unqualified_object_id_node): Global
2742 variable declarations.
2743 (build_decl_no_layout): Removed prototype.
2744 (java_get_real_method_name): Added prototype.
2745 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
2746 (java_parse_abort_on_error): Macro now just returns.
2747 * jcf-parse.c (jcf_parse_source): Check fclose returned
2748 value. Call emit_register_classes if java_report_errors returns
2749 zero.
2750 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
2751 flag_static_local_jdk1_1): New integer flags.
2752 (lang_decode_option): New flags set here.
2753 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
2754 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
2755 the flag_redundant variable.
2756 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
2757 when parsing java.lang.Object class.
2758 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
2759 NULL_TREE to build.
2760 (resolve_qualified_expression_name): Fixed indentation.
2761 (patch_array_ref): Changed prototype.
2762 (not_initialized_as_it_should_p): Prototype removed.
2763 (java_report_errors): Added function prototype.
2764 * parse.y (formal_parameter:): Changed error message for not yet
2765 supported final parameters.
2766 (class_type_list:): Set both PURPOSE and VALUE of created
2767 TREE_LIST to be class_type.
2768 (primary_no_new_array:): Handle class literals on primitive types.
2769 (parse_warning_context): Reinstalled correct force_error and
2770 do_warning flags setups.
2771 (java_report_errors): Changed prototype. Return java_error_count
2772 value.
2773 (variable_redefinition_error): Consider treating variable type as
2774 a fake pointer.
2775 (create_interface): Warn about redundant abstract modifier if
2776 flag_redundant is set. Changed error message.
2777 (lookup_field_wrapper): Save/restore globals before/after looking
2778 up field.
2779 (duplicate_declaration_error_p): Consider treating declaration
2780 type as a fake pointer.
2781 (register_fields): Extract real type from dependency node. Check
2782 for duplicate field declaration after type adjustment. Use
2783 DECL_INITIAL to store static final initialized values.
2784 (method_header): Extract real function type from dependency node.
2785 (check_abstract_method_header): Use GET_METHOD_NAME.
2786 (obtain_incomplete_type): Layout fake pointer type.
2787 (safe_layout_class): Don't try to check for methods before layout.
2788 (java_complete_class): Don't check for correct throws clause
2789 elements inheritance here.
2790 (resolve_and_layout): Broadened name parameter meaning.
2791 (reset_method_name): Use GET_METHOD_NAME.
2792 (java_get_real_method_name): New function.
2793 (java_check_regular_methods): Don't check methods in
2794 java.lang.Object. Verify lineage of throws clause elements. Use
2795 flag_no_overriding in warning report.
2796 (check_throws_clauses): Don't check if class was from
2797 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
2798 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
2799 (declare_local_variables): Use flag_static_local_jdk1_1 to report
2800 warning on unsupported final local variables. Use build_decl
2801 instead of build_decl_no_layout. Get real local variable type from
2802 dependency node.
2803 (source_start_java_method): Get real parameter type from
2804 dependency node. Call build_decl instead of build_decl_no_layout.
2805 (java_layout_classes): Reverse tree and layout type and class as
2806 required. Mark class as loaded when done.
2807 (resolve_field_access): Fixed indentation. Restricted condition
2808 leading to static field access code generation. Set field_type
2809 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
2810 (resolve_qualified_expression_name): Initialize type_found to
2811 null. Handle static field resolved during qualification. Fixed
2812 layout on non primitive field decl types.
2813 (not_accessible_p): Fixed typo in comment.
2814 (patch_method_invocation): Resolve and layout class to search from
2815 type.
2816 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
2817 layout non primitive type, if necessary. Make method node only to
2818 report errors.
2819 (find_applicable_accessible_methods_list): Consider WFL'ed method
2820 decl names. Fixed indentation.
2821 (argument_types_convertible): Resolve and layout target type if
2822 necessary.
2823 (java_complete_tree): Fixed indentation problems. Rewrote
2824 CALL_EXPR thrown exceptions check. Re-installed further processing
2825 of the assignment in certain cases.
2826 (patch_assignment): Call maybe_build_primttype_type_ref to perform
2827 inlining on class literals.
2828 (valid_builtin_assignconv_identity_widening_p): Cope with constant
2829 0 literal.
2830 (valid_method_invocation_conversion_p): Likewise.
2831 (patch_string): Temporary disable forbidden use of `this' in
2832 explicit constructor invocations when doing string concatenation
2833 within their scope.
2834 (patch_unaryop): Added comment. Reinstalled code to disable
2835 further check on assignment operation with cast expression RHS.
2836 (patch_switch_statement): Fixed indentation.
2837 (build_try_statement): Call build_decl instead of
2838 build_decl_no_layout.
2839 (patch_synchronized_statement): Likewise.
2840 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
2841 IS_UNCHECKED_EXPRESSION_P.
2842 (check_thrown_exceptions_do): Changed leading comment. Resolve and
2843 layout argument exception type.
2844 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
2845 of IS_UNCHECKED_EXPRESSION_P.
2846
1c7f3673
APB
2847Wed Nov 18 14:21:48 1998 Anthony Green <green@cygnus.com>
2848
2849 * jcf-parse.c (yyparse): Open class file in binary mode.
2850
411efd21
PB
2851Sun Nov 15 17:14:17 1998 Per Bothner <bothner@cygnus.com>
2852
2853 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
2854
2855 * jcf-write.c (perform_relocations): Move check out one loop.
2856
8773d9d5
AG
2857Sun Nov 15 15:09:56 1998 Anthony Green <green@hoser.cygnus.com>
2858
2859 * Make-lang.in: Fix reference to srcdir.
2860 * jv-scan.c: Add missing xmalloc prototype.
2861 * jvgenmain.c: Ditto.
2862
9bbc7d9f
PB
2863Sun Nov 15 14:36:29 1998 Per Bothner <bothner@cygnus.com>
2864
2865 * decl.c (error_mark_node), java-tree.h: New global.
2866 * parse.y: Use empty_stmt_node instead of size_zero_node.
2867 (build_if_else_statement): If missing else, use empty_stmt_node.
2868
2869 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
2870 (java_complete_expand_method): Complain if return is missing.
2871 (java_check_regular_methods): Comment out incorrect error check.
2872 (not_accessible_p): Fix incorrect handling of protected methods.
2873 (patch_method_invocation): Pass correct context to not_accessible_p.
2874 (find_applicable_accessible_methods_list): Likewise.
2875 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
2876 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
2877 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
2878 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
2879
2880 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
2881 (push_int_const): Remove reundant NOTE_PUSH.
2882 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
2883 (- case SWITCH_EXPR): Fix code generation bug.
2884 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
2885 (generate_classfile): More robust for abstract methods.
2886
175135a6
AG
2887Sun Nov 15 13:52:39 1998 Anthony Green <green@cygnus.com>
2888
2889 * Makefile.in: jv-scan and jvgenmain all require libiberty.
2890 * Make-lang.in: Ditto.
2891
2892 * jv-scan.c: Remove xmalloc and xstrdup definitions.
2893 * jvgenmain: Ditto.
2894
0ef38928
PB
2895Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
2896
2897 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
2898
2899 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
2900
a2f44beb
PB
2901Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
2902
2903 Allow uses of interface types to verify. This is not really
2904 type-safe, but it matches what Sun does, and is OK as long as
2905 there are appropriate run-time checks.
2906 * verify.c (merge_types): If merging two interface types,
2907 just set the result to java.lang.Object.
2908 * expr.c (pop_type): Any interface is matches by java.lang.Object.
2909
928962ae
TT
29101998-11-13 Tom Tromey <tromey@cygnus.com>
2911
df66b566
TT
2912 * gjavah.c (main): Handle --output-class-directory argument.
2913 * jvspec.c (lang_specific_driver): Translate `-d' into
2914 -foutput-class-dir.
2915 * jcf.h (jcf_write_base_directory): Declare.
2916 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
2917 * lang-options.h: Mention -foutput-class-dir.
2918 * jcf-write.c (jcf_write_base_directory): New global.
2919 (make_class_file_name): Put generated .class file into `-d'
2920 directory, or into source directory if -d not given. Function now
2921 static.
2922 (write_classfile): Free class file name. Handle case where class
2923 file name is NULL.
2924 (DIR_SEPARATOR): New macro.
2925 Include <sys/stat.h>
2926
928962ae
TT
2927 * Makefile.in (prefix): New macro.
2928
14dd5b38
PB
2929Thu Nov 12 14:15:07 1998 Per Bothner <bothner@cygnus.com>
2930
421fb085
PB
2931 * parse.y (patch_invoke): Do less if flag_emit_class_files.
2932 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
2933 here (done in patch_invoke instead).
2934 (case_identity): Moved here from parse.y.
2935
2936 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
2937 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
2938 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
2939 so they can be efficiently scanned without recursion.
2940 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
2941 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
2942 in BLOCK iteratively, rather than recursively.
2943
2944 * parse.y (do_unary_numeric_promotion): New function.
2945 (patch_unaryop, patch_binop, patch_array_ref): Use it.
2946
2947 * parse.y (patch_newarray): Various fixes.
2948
2949 Re-do handling of switch statements (for proper block scoping).
2950 * parse.y: Add just a single block for the enture switch block,
2951 but don't create any "case blocks".
2952 (group_of_labels): Rmeoved unneeded non-terminal.
2953 CASE_EXPR and DEFAULT_EXPR are added to current block.
2954 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
2955 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
2956 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
2957 * parse.y (wfl_operator, print_int_node): Make non-static.
2958 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
2959 as part of recursive scan of block.
2960 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
2961 (patch_switch_statement): Most tests move dinto java_complete_tree.
2962
2963 * parse.y: Make various production be non-typed (void).
2964 * parse.y (parse_error): Merged into issue_warning_error_from_context.
2965 * parse.y (add_stmt_to_compound): Don't create/change extra node.
2966 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
2967
2968 * jcf-write.c (struct jcf_handler): New type.
2969 (struct jcf_switch_state): New type.
2970 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
2971 (alloc_handler, emit_unop, emit_reloc): New functions.
2972 (adjust_typed_op): Add extra parameter ("max type" offset).
2973 (emit_switch_reloc, emit_case-reloc): New function.
2974 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
2975 (generate_bytecode_insns): Support REAL_CST, switch statements,
2976 exception handling, method calls, object/array creation, and more.
2977
14dd5b38
PB
2978 * class.c: Remove some unused variables.
2979 * constants.c (find_string_constant): New function.
2980 (count_constant_pool_bytes): Fix to correctly handle wide constants.
2981 * decl.c (complete_start_java_method): Don't _Jv_InitClass
2982 if flag_emit_class_files.
421fb085 2983
dfded5c3
TT
29841998-11-12 Tom Tromey <tromey@cygnus.com>
2985
733b3a87
TT
2986 * jcf-io.c (find_class): Added explanatory comment.
2987
2988 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
2989 trailing slash to `.zip' entries.
2990
dfded5c3
TT
2991 * jvspec.c (lang_specific_driver): Correctly handle case where
2992 GC_NAME not defined.
2993
aaff4ee4
TT
29941998-11-11 Tom Tromey <tromey@cygnus.com>
2995
2996 * jvspec.c (GC_NAME): New define.
2997 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
2998 if required.
2999 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
3000
b62d42fe
PB
3001Wed Nov 11 19:08:52 1998 Per Bothner <bothner@cygnus.com>
3002
3003 * jcf-dump.c (TABLE_SWITCH): Fix typos.
3004
233f10d3
TT
30051998-11-11 Tom Tromey <tromey@cygnus.com>
3006
3007 * jcf-dump.c (main): Correctly recognize `--'-style long options.
3008
5e942c50
APB
3009Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3010
3011 * class.c (is_compiled_class): Call safe_layout_class for class
3012 compiled from source.
3013 * conver.h (convert_to_integer, convert_to_real,
3014 convert_to_pointer): Added prototypes.
3015 * decl.c (init_decl_processing): Non longer push the decls of
3016 `methodtable', `constants', `Class', `Field', `dispatchTable'
3017 `jexception' and `Method'.
3018 * expr.c (build_invokeinterface): New function.
3019 (expand_invoke): static variable CLASS_IDENT now in
3020 build_invokeinterface. Use build_invokeinterface.
3021 (expand_java_field_op): Moved code to inline
3022 java.lang.PRIMTYPE.TYPE into a function.
3023 (build_primtype_type_ref): New function.
3024 * java-tree.def (INSTANCEOF_EXPR): New tree code.
3025 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
3026 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
3027 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
3028 (DECL_LOCAL_STATIC_VALUE): New macro.
3029 (build_invokeinterface, build_primtype_type_ref): New function
3030 prototypes.
3031 (java_parse_abort_on_error): Macro rewritten.
3032 * jcf-parse.c (current_method): Add comment to declaration.
3033 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
3034 Function prototypes fixed.
3035 (jcf_parse_source): push/pop parser context. save/restore global.
3036 (parse_source_file): Fixed leading comment. Now take a
3037 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
3038 classes and pop the parser context anymore.
3039 (yyparse): Push parser context, save globals, parse the source
3040 file, restore globals and pop the parser context when processing a
3041 source file.
3042 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
3043 * lex.c (java_parse_doc_section): New function.
3044 (java_lex): Call java_parse_doc_section when appropriate. Build an
3045 operator around INSTANCEOF_TK.
3046 * lex.h (java_lineterminator, java_sprint_unicode,
3047 java_unicode_2_utf8, java_lex_error, java_store_unicode):
3048 Prototypes rewritten.
3049 (java_parse_escape_sequence, java_letter_or_digit_p,
3050 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
3051 java_read_unicode, java_store_unicode, java_read_char,
3052 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
3053 Added function prototypes.
3054 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
3055 define.
3056 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
3057 New macros
3058 (struct parser_ctxt): New fields: deprecated,
3059 current_parsed_class_un, gclass_list.
3060 (fix_method_argument_names, issue_warning_error_from_context,
3061 resolve_package, lookup_package_type): New function prototypes.
3062 (resolve_expression_name): Fixed function prototype.
3063 (find_applicable_accessible_methods_list): Fixed indentation, added
3064 extra argument in prototype.
3065 (check_final_assignment, build_null_of_type, check_deprecation,
3066 check_method_redefinition, reset_method_name,
3067 java_check_regular_methods, java_check_abstract_methods,
3068 maybe_build_primttype_type_ref): New function prototype.
3069 * parse.y (conver.h): Include.
3070 (INSTANCEOF_TK): Tagged <operator>.
3071 (single_type_import_declaration): Use REGISTER_IMPORT macro.
3072 (relational_expression:): Build binop for instanceof.
3073 (java_push_parser_context): Remember ctxp->gclass_list across
3074 contexts.
3075 (java_pop_parser_context): Simply return if no context
3076 exists. Remember gclass_list across contexts.
3077 (issue_warning_error_from_context): New function.
3078 (parse_error_context): Don't setup ctxp->elc here. Call
3079 issue_warning_error_from_context instead.
3080 (parse_warning_context): Likewise.
3081 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
3082 setup. Link new class/interface to ctxp->gclass_list.
3083 (add_superinterfaces): Register interface as incomplete if not
3084 loaded.
3085 (create_class): Remember class unqualified name in
3086 ctxp->current_parsed_class_un. Check class deprecation.
3087 (register_fields): Check field deprecation. Remember static final
3088 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
3089 processing INIT.
3090 (method_header): New local variable ORIG_ARG. Use unqualified
3091 current class name for check on constructor errors. Promote return
3092 type if of record type. Argument list fix moved in
3093 fix_method_argument_names, called here. Check method deprecation.
3094 (fix_method_argument_names): New function.
3095 (method_declarator): Promote record typed arguments.
3096 (safe_layout_class): Check class methods before layout.
3097 (java_complete_class): Compute field layout when patched.
3098 (do_resolve_class): Try to load class after having it renamed
3099 after the package name.
3100 (get_printable_method_name): Use DECL_CONTEXT.
3101 (reset_method_name): New function.
3102 (check_method_redefinition): Use reset_method_name.
3103 (java_check_regular_methods): New local variable
3104 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
3105 names for error report. Check for compile-time error when method
3106 found has default (package) access.
3107 (java_check_abstract_methods): Now takes an interface DECL node as
3108 an argument. Also reinstall real name on unchecked
3109 overriding/hiding methods for error report.
3110 (java_check_methods): Fixed leading comment. Get classes to verify
3111 from ctxp->gclass_list. Use CHECK_METHODS macro and set
3112 CLASS_METHOD_CHECKED_P on class verification.
3113 (lookup_java_method2): Get real method name if necessary.
3114 (find_in_imports): Don't check package class access here.
3115 (resolve_package, lookup_package_type): New functions.
3116 (java_layout_classes): Fixed leading comment. Take classes to be
3117 laid out from ctxp->gclass_list.
3118 (java_complete_expand_methods): Don't expand native and abstract
3119 methods.
3120 (java_expand_classes): New function.
3121 (resolve_expression_name): Use additional argument ORIG. Retrieve
3122 values of static final field of primitive types.
3123 (resolve_field_access): Handles static final field of promotive
3124 type.
3125 (resolve_qualified_expression_name): Handle STRING_CST as
3126 primaries and package name resolution. Check deprecation on found
3127 decls. Set where_found and type_found on non static field resolved
3128 during qualification. Layout non primitive field decl types.
3129 (check_deprecation): New function.
3130 (maybe_access_field): Simplified.
3131 (patch_method_invocation_stmt): Local variable CLASS_TYPE
3132 removed. Reverse method's argument when primary is a type. Don't
3133 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
3134 instead. Include abstract class in the list of class searchable
3135 for constructors. Use DECL_CONTEXT of found method for access
3136 checks. Check method deprecation.
3137 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
3138 converting arguments. Handle INVOKE_INTERFACE.
3139 (lookup_method_invoke): Search constructor using existing
3140 infrastructure (don't rely on lookup_java_constructor anymore).
3141 (find_applicable_accessible_methods_list): Extra argument flag
3142 LC. Now include constructor in the search.
3143 (qualify_ambiguous_name): Conditional expression are primaries.
3144 (not_initialized_as_it_should_p): static final are always
3145 initialized.
3146 (java_complete_tree): Pass extra NULL argument to
3147 resolve_expression_name. Stricter test to carry on patching
3148 assignments. New case for INSTANCEOF_EXPR.
3149 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
3150 (check_final_assignment, maybe_build_primttype_type_ref): New
3151 functions.
3152 (patch_assignment): Detect resolved static finals and carry normal
3153 assignment error check on them. Inline PRIMTYPE.TYPE read access.
3154 (try_builtin_assignconv): Access constant 0 on all primitive
3155 types.
3156 (valid_builtin_assignconv_identity_widening_p): Accept identical
3157 types. Accept all promoted type on int type.
3158 (valid_ref_assignconv_cast_p): Accept a null pointer to be
3159 assigned to a reference.
3160 (valid_method_invocation_conversion_p): Accept to check null
3161 pointers.
3162 (build_binop): Merge declaration and initialization of local
3163 variable BINOP.
3164 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
3165 numeric types. Improved validity test for qualify operators on
3166 references.
3167 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
3168 and PREINCREMENT_EXPR. Also detect resolved static finals of a
3169 primitive type and issue the appropriate error message.
3170 (resolve_type_during_patch): Mark class loaded when resolved.
3171 (patch_cast): Allow null to be cased to reference types.
3172 (build_null_of_type): New function.
3173 (patch_array_ref): Handle array on references correctly.
3174 (patch_return): Removed unused local variable MODIFY. Force
3175 boolean to be returned as integers. Allows null to be returned by
3176 a function returning a reference.
3177 * typeck.c (convert_to_integer, convert_to_real,
3178 convert_to_pointer): Prototypes moved to convert.h
3179 (lookup_argument_method): Use method real name, if necessary.
3180
9cfceb60
TT
31811998-10-30 Tom Tromey <tromey@cygnus.com>
3182
66d88624
TT
3183 * class.c (build_class_ref): Changed name of primitive classes to
3184 start with `_Jv_'.
3185
9cfceb60
TT
3186 * class.c (make_class_data): Renamed fields: nmethods to
3187 method_count, method_count to dtable_method_count. Always set
3188 `state' field to 0.
3189 * decl.c (init_decl_processing): Likewise.
3190
22eed1e6
APB
3191Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3192
3193 * class.c (layout_class): Don't mangle <finit>, produce
3194 __finit<class> instead. Don't verify artificial methods.
3195 * decl.c (finit_identifier_node): New declared global.
3196 (init_decl_processing): finit_identifier_node initialized.
3197 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
3198 * java-tree.h (finit_identifier_node): Declared as extern.
3199 (struct lang_decl): New field called_constructor.
3200 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
3201 (CLASS_HAS_FINIT_P): New macro.
3202 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
3203 explicit constructor invocation.
3204 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
3205 CALL_SUPER_CONSTRUCTOR_P): New macros.
3206 (write_classfile): Added prototype.
3207 * jcf-parse.c (jcf_parse_source): Parse and remember for
3208 generation if the file was seen on the command line.
3209 (parse_source_file): Don't write the class file here.
3210 (yyparse): Loop on files rewritten. Set current_jcf.
3211 (parse_zip_file_entries): Parse class file only if it was found.
3212 * lang.c (init_parse): Don't open command line provided filename
3213 here.
3214 (lang_parse): Don't set main_jcf anymore.
3215 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
3216 (JCONSTRUCTOR_CHECK): New macro.
3217 (JBSC_TYPE_P): New macro.
3218 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
3219 (COMPLETE_CHECK_OP_2): New macro.
3220 (struct parse_ctxt): New field explicit_constructor_p.
3221 (check_class_interface_creation): Fixed prototype indentation.
3222 (patch_method_invocation_stmt): Prototype reflects added argument.
3223 (patch_invoke): Likewise.
3224 (complete_method_declaration, build_super_invocation,
3225 verify_constructor_circularity,
3226 build_this_super_qualified_invocation, get_printable_method_name,
3227 patch_conditional_expr, maybe_generate_finit, fix_constructors,
3228 verify_constructor_super, create_artificial_method,
3229 start_artificial_method_body, end_artificial_method_body,
3230 generate_field_initialization_code): New function prototypes.
3231 * parse.y: Fixed leading comment
3232 (constructor_header:, constructor_body:, block_end:): Rules tagged
3233 <node>.
3234 (type_declaration:): Call maybe_generate_finit.
3235 (method_declaration:): Action for method_body: placed in new
3236 function complete_method_declaration, called here.
3237 (constructor_declaration:): Defined actions. Removed leading
3238 FIXME.
3239 (constructor_header:): New rule with action.
3240 (constructor_body:): Rule rewritten using block_begin: and
3241 block_end:. Defined actions.
3242 (constructor_declarator:, explicit_constructor_invocation:):
3243 Defined actions.
3244 (block:): Use new rules block_begin: block_end:.
3245 (block_begin:, block_end:): New rules and actions.
3246 (block_statements:): Fixed error message for explicit
3247 constructors.
3248 (method_invocation:): Call build_this_super_qualified_invocation
3249 if primary is `this' or `super' was seen.
3250 (conditional_expression:): Action defined.
3251 (extra_ctxp_pushed_p): New static global flag.
3252 (java_parser_context_save_global): Create parser context if
3253 necessary. Use extra_ctxp_pushed_p to remember it.
3254 (java_parser_context_restore_global): Pop extra parser context if
3255 one exists.
3256 (build_array_from_name): Array on primitive types are marked
3257 loaded.
3258 (register_fields): Restore new name in field initializer
3259 expression if type was altered. Non static fields initialized upon
3260 declaration marked initialized.
3261 (maybe_generate_finit): New function.
3262 (maybe_generate_clinit): Use create_artificial_method,
3263 start_artificial_method_body, end_artificial_method_body. Generate
3264 debug info for enclosed initialization statements.
3265 (method_header): Fixed leading comment. Check constructor
3266 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
3267 accordingly.
3268 (complete_method_declaration, constructor_circularity_msg,
3269 verify_constructor_circularity): New functions.
3270 (get_printable_method_name): New function.
3271 (check_method_redefinition): Don't rename <finit> methods. Fix
3272 declared constructor names. Error message for
3273 constructors modified.
3274 (java_check_regular_methods): Local variable seen_constructor
3275 renamed saw_constructor. Skip verification on constructors. Create
3276 default constructor with create_artificial_method.
3277 (java_check_methods): Removed unnecessary empty line.
3278 (create_artificial_method, start_artificial_method_body,
3279 end_artificial_method_body): New functions.
3280 (java_layout_classes): Changed leading comment. Reverse fields
3281 list if necessary. Always layout java.lang.Object if being
3282 defined.
3283 (java_complete_expand_methods): Verify constructor circularity.
3284 (java_complete_expand_method): Call fix_constructor on
3285 constructors. Local variable no_ac_found removed. Restore
3286 bindings if method body expansion failed.
3287 (fix_constructors, verify_constructor_super,
3288 generate_field_initialization_code): New function.
3289 (java_expand_classes): Fixed leading comment. Write class file
3290 here.
3291 (resolve_expression_name): Check for illegal instance variable
3292 usage within the argument scope of an explicit constructor
3293 invocation.
3294 (resolve_qualified_expression_name): Pass extra from_super flag
3295 when invoking patch_method_invocation_stmt. New case for
3296 conditional expression when used as a primary. Check for error
3297 when acquiring super.
3298 (patch_method_invocation_stmt): Added extra argument super. New
3299 local variable is_static_flag. Set class_to_search according to
3300 the nature of the constructor invocation. Don't add `this'
3301 argument when expanding NEW_CLASS_EXPR. Check for illegal method
3302 invocation within the argument scope of explicit constructor
3303 invocation. Set is_static according to is_static_flag. Provide
3304 extra `super' argument to patch_invoke invocation.
3305 (patch_invoke): New argument from_super. Loop on arguments
3306 indentation fixed. Pass from_super to invocation_mode. New switch
3307 case INVOKE_SUPER. Fixed error message in switch default case.
3308 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
3309 value.
3310 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
3311 (lookup_method_invoke): Fixed prototypes in candidates list. Error
3312 message takes constructors into account.
3313 (find_applicable_accessible_methods_list): Fixed indentation.
3314 (qualify_ambiguous_name): Take explicit constructor invocation
3315 into account. Deal with a conditional expression as a primary to
3316 a method call.
3317 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
3318 case. Added extra argument to patch_method_invocation_stmt.
3319 Register calls made to explicit constructor `this'. Don't call
3320 save_expr in ARRAY_REF case when emitting class files. Check for
3321 illegal use of this when expanding explicit constructor invocation
3322 arguments.
3323 (complete_function_arguments): Set and reset parser context
3324 explicit_constructor_p field value when appropriate.
3325 (build_super_invocation, build_this_super_qualified_invocation):
3326 New functions.
3327 (patch_assignment): Fixed typo.
3328 (patch_unaryop): Check on final fields occurs only when a decl
3329 exits.
3330 (patch_return): Take constructors into account.
3331 (patch_conditional_expr): New function.
3332 * typeck.c (build_java_signature): Removed unnecessary empty line.
3333
e626b840
JL
3334Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
3335
3336 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
3337
571d54d5
TT
33381998-10-28 Tom Tromey <tromey@cygnus.com>
3339
3340 * decl.c (init_decl_processing): Renamed fields.
3341 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
3342 interface_len, msize fields.
3343
3344 * class.c (make_class_data): Removed subclass_head and
3345 subclass_next fields.
3346 * decl.c (init_decl_processing): Removed subclass_head and
3347 subclass_next fields.
3348
5ed948ce
JL
3349Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
3350
3351 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
3352 * mangle.c (emit_unicode_mangled_name): Similarly.
571d54d5 3353
0d17a080
NC
3354Mon Oct 26 12:17:23 1998 Nick Clifton <nickc@cygnus.com>
3355
3356 * jcf-parse.c (get_constant): Place braces around code to compute
3357 'd' when REAL_ARITHMETIC is not defined.
3358
937293e9
L
3359Sun Oct 25 14:58:05 1998 H.J. Lu (hjl@gnu.org)
3360
3361 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
3362 dependency.
3363
45ae5597
TT
33641998-10-23 Tom Tromey <tromey@cygnus.com>
3365
3366 * lang-specs.h: `.zip' files are input to jc1.
3367
172b2240
PB
3368Thu Oct 22 23:01:54 1998 Per Bothner <bothner@cygnus.com>
3369
3370 * jvspecs.c: Add (but don't enable) support for combining multiple
3371 .class and .java input filenames to a single jc1 invocation.
3372 Add support for -C flag (copile to .class files).
3373 Translate -classpath and -CLASSPATH arguments.
3374 * lang-specs.h: Don't set %2 spec.
3375
8603f9c5
TT
33761998-10-22 Tom Tromey <tromey@cygnus.com>
3377
71f6a8e2
TT
3378 * jcf-path.c (add_entry): Don't add trailing separator if entry is
3379 a .zip file.
3380 (add_path): Don't add trailing separator to non-empty path
3381 elements.
3382
3383 * lang.c (lang_decode_option): Check for -fclasspath and
3384 -fCLASSPATH before examining other `-f' options.
3385
f7670760
TT
3386 * java-tree.h (finalize_identifier_node): Don't declare.
3387 * class.c (make_class_data): Don't push "final" field.
3388 * decl.c (init_decl_processing): Don't push "final" field.
3389 (finalize_identifier_node): Removed.
3390 (init_decl_processing): Don't set finalize_identifier_node.
3391
257fafbb
TT
3392 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
3393
3394Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
3395
3396 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
3397 (JV_SCAN_SOURCES): New macro.
3398 (JCF_DUMP_SOURCES): Likewise.
3399 (jcf-dump$(exeext)): New target.
3400 (jv-scan$(exeext)): New target.
3401
34021998-10-22 Tom Tromey <tromey@cygnus.com>
3403
3404 * Makefile.in (LEX): Removed.
3405 (LEXFLAGS): Likewise.
3406 (SET_BISON): New macro.
3407 (BISON): Removed.
3408 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
3409 spurious diffs in parse.c.
3410 ($(PARSE_SCAN_C)): Likewise.
3411 (PARSE_DIR): New macro.
3412 (PARSE_C): Use it.
3413 (PARSE_SCAN_C): Likewise.
3414 (PARSE_RELDIR): New macro.
3415
3416 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
3417
8603f9c5
TT
3418 * jcf-io.c (find_class): Use saw_java_source to determine when to
3419 look for `.java' file.
3420 * jcf-parse.c (saw_java_source): New global.
3421 (yyparse): Set it if `.java' file seen.
3422
3423 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
3424 (GCJH_SOURCES): Likewise.
3425 * Makefile.in (datadir): New macro.
3426 (libjava_zip): Likewise.
3427 (JAVA_OBJS): Added jcf-path.o.
3428 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
3429 (../gcjh$(exeext)): Likewise.
3430 (jcf-path.o): New target.
3431 * java-tree.h (fix_classpath): Removed decl.
3432 * jcf-parse.c (fix_classpath): Removed.
3433 (load_class): Don't call fix_classpath.
3434 * parse.y (read_import_dir): Don't call fix_classpath.
3435 * lex.h: Don't mention classpath.
3436 * lex.c (java_init_lex): Don't initialize classpath.
3437 * jcf-io.c (classpath): Removed global.
3438 (find_class): Use jcf_path iteration functions. Correctly search
3439 class path for .java file.
3440 (open_in_zip): New argument `is_system'.
3441 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
3442 classpath-related options.
3443 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
3444 and -I.
3445 (lang_init): Call jcf_path_init.
3446 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
3447 * lang-specs.h: Handle -I. Minor cleanup to -M options.
3448 Correctly put braces around second string in each entry.
3449 * gjavah.c (main): Call jcf_path_init. Recognize all the new
3450 classpath-related options.
3451 (help): Updated for new options.
3452 * jcf.h: Declare functions from jcf-path.c. Don't mention
3453 `classpath' global.
3454 * jcf-path.c: New file.
3455
3456 * jcf-depend.c: Include jcf.h.
3457
3458 * jcf-write.c (localvar_alloc): Returns `void'.
3459 (localvar_free): Removed unused variable.
3460
3461 * lang.c (OBJECT_SUFFIX): Define if not already defined.
3462 (init_parse): Use OBJECT_SUFFIX, not ".o".
3463
866e9df8
APB
3464Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3465
3466 * class.c (emit_register_classes): Renamed from
3467 emit_register_class.
3468 * java-tree.h (emit_register_classes): Prototype renamed from
3469 emit_register_class.
3470 * jcf-parse.c (yyparse): Call emit_register_classes once before
3471 returning.
3472 * parse.y (java_expand_classes): No longer register classes.
3473
b351b287
APB
3474Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3475
3476 * class.c (is_compiled_class): New local variable
3477 seen_in_zip. Identify classes found in currently compiled source
3478 file(s).
3479 * decl.c (complete_start_java_method): Fixed typo.
3480 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
3481 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
3482 (CLASS_P): Moved around.
3483 (java_parse_abort_on_error): Macro moved from jcf-parse.c
3484 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
3485 java-parse.h
3486 (jcf_parse_source): Changed leading comment. Removed unnecessary
3487 fclose and CLASS_FROM_SOURCE_P marking.
3488 (parse_source_file): New local variables remember_for_generation
3489 and filename. Mark parsed file name identifier node. Removed block
3490 executed when parse_only was null. Set remember_for_generation.
3491 Use it as an argument to java_pop_parser_context.
3492 (yyparse): New local variables several_files, list, next node and
3493 current_file_list. Split ampersand separated file names into
3494 current_file_list. Iterate through the list and parse accordingly.
3495 * parse.h (java_pop_parser_context): New function prototype.
3496 * parse.y (ctxp_for_generation): New static global variable.
3497 (java_pop_parser_context): New argument generate. Link popped ctxp
3498 to ctxp_for_generation list accordingly.
3499 (java_complete_expand_methods): Fixed indentation.
3500 (java_expand_classes): New function.
3501
f9d48c82
PB
3502Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
3503
3504 * Makefile.in: Link with libiberty.a instead of memmove.o.
3505
c583dd46
APB
3506Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3507
3508 * lex.c (setjmp.h): No longer included.
3509 * lex.h (setjmp.h): Included.
3510 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
3511 (duplicate_declaration_error_p): Renamed from
3512 duplicate_declaration_error.
3513 (build_array_from_name): New function prototype.
3514 * parse.y (setjmp.h): No longer included.
3515 (variable_declarator_id): Define action.
3516 (build_array_from_name): New function.
3517 (duplicate_declaration_error_p): Renamed from
3518 duplicate_declaration_error. Fixed leading comment.
3519 (register_fields): Main `for' loop reorganized. Uses
3520 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
3521 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
3522 build_array_from_name.
3523 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
3524 types.
3525 (read_import_dir): Don't try to skip `.' and `..'.
3526 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
3527 build_array_from_name. Main `for' loop reorganized.
3528 (resolve_qualified_expression_name): When building access to a
3529 field, use the type where the field was found, not its own type.
3530 (maybe_access_field): Use field DECL_CONTEXT if the type where the
3531 field was found is null.
3532 (qualify_ambiguous_name): Sweep through all successive array
3533 dimensions.
3534
0a2138e2
APB
3535Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3536
3537 * java-tree.h (pop_labeled_block, lang_printable_name,
3538 maybe_add_interface, set_super_info, get_access_flags_from_decl,
3539 interface_of_p, inherits_from_p, fix_classpath,
3540 complete_start_java_method, emit_handlers, init_outgoing_cpool,
3541 make_class_data, register_class, alloc_name_constant): New
3542 function prototypes.
3543 * lang.c (lang_decode_option): Set argc argument unused. Fixed
3544 indentation. Added cast to remove warning.
3545 (lang_printable_name): Set v argument unused.
3546 (lang_print_error): Added argument to lang_printable_name call.
3547 (java_dummy_print, print_lang_decl, print_lang_type,
3548 print_lang_identifier, lang_print_xnode): All argument marked
3549 unused.
3550 * lex.c (java_unget_unicode): Removed unnecessary argument.
3551 (java_allocate_new_line): Unused local variable is gone.
3552 (java_read_char): Added parenthesis in expressions to remove
3553 warnings. Added final return statement.
3554 (java_read_unicode): Added parenthesis in expression to remove
3555 warning.
3556 (java_parse_end_comment): Fixed java_unget_unicode invocation.
3557 (java_parse_escape_sequence): Likewise.
3558 (java_lex): Unused local variables are gone. Fixed
3559 java_unget_unicode invocation.
3560 * lex.h (set_float_handler): Prototype added when JC1_LITE not
3561 defined.
3562 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
3563 lang_printable_name invocation in macro.
3564 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
3565 Likewise.
3566 (duplicate_declaration_error): Suppressed unused argument in
3567 prototype.
3568 (identical_subpath_p): Function declaration is gone.
3569 (patch_invoke): Suppressed unused argument in prototype.
3570 (patch_cast, build_labeled_block, check_thrown_exceptions):
3571 Likewise.
3572 * parse.y (setjmp.h): Included
3573 (toplev.h): Likewise.
3574 (field_declaration:): Suppressed unused local
3575 (label_decl:): Fixed build_labeled_block invocation.
3576 (java_pop_parser_context): Put extra parenthesis around assignment
3577 in if.
3578 (yyerror): Suppressed unused local variables.
3579 (variable_redefinition_error): Fixed lang_printable_name
3580 invocation.
3581 (create_interface): Suppressed unused local variables.
3582 (create_class): Likewise.
3583 (duplicate_declaration_error): Suppressed unused argument. Fixed
3584 lang_printable_name invocation.
3585 (register_fields): Suppressed unused local variable. Fixed
3586 duplicate_declaration_error invocation.
3587 (method_header): Suppressed unused local variable.
3588 (method_declarator, parser_check_super): Likewise.
3589 (java_complete_class): Suppressed unused local variable. Fixed
3590 fatal error message.
3591 (complete_class_report_errors): Added default: in switch.
3592 (java_check_regular_methods): Fixed lang_printable_name
3593 invocations.
3594 (check_throws_clauses): Likewise.
3595 (java_check_abstract_methods): Suppressed unused local
3596 variable. Fixed lang_printable_name invocation.
3597 (read_import_entry): Added supplemental return statement.
3598 (read_import_dir): Suppressed unused local variables.
3599 (check_pkg_class_access, declare_local_variables): Likewise.
3600 (source_start_java_method): Suppressed unused extern variable
3601 declarations
3602 (expand_start_java_method): Suppressed unused extern and local
3603 variable declarations.
3604 (java_complete_expand_methods): Likewise.
3605 (java_complete_expand_method): Suppressed unused local variables.
3606 (make_qualified_name): Likewise.
3607 (resolve_qualified_expression_name): Added default: in
3608 switch. Fixed lang_printable_name invocation.
3609 (class_instance_creation_expression): Added parenthesis around
3610 expressions.
3611 (patch_method_invocation_stmt): Fixed lang_printable_name and
3612 patch_invoke invocations.
3613 (check_for_static_method_reference): Fixed lang_printable_name
3614 invocation.
3615 (patch_invoke): Suppressed unused arguments and local variables.
3616 (lookup_method_invoke): Suppressed unused local variables.
3617 (qualify_ambiguous_name): Added default: in switch.
3618 (identical_subpath_p): Function removed.
3619 (patch_assignment): Suppressed unused local variables. Suppressed
3620 unnecessary if statement. Fixed lang_printable_name invocations.
3621 (try_builtin_assignconv): Fixed lang_printable_name invocations.
3622 (valid_ref_assignconv_cast_p): Parenthesis around
3623 expression. Suppressed unused local variables.
3624 (build_binop): Suppressed unused local variables. fixed
3625 lang_printable_name invocations.
3626 (string_constant_concatenation): Suppressed unused local
3627 variables.
3628 (patch_unaryop): Fixed lang_printable_name invocation.
3629 (patch_cast): Suppressed unnecessary argument. Fixed
3630 lang_printable_name invocation.
3631 (patch_array_ref): Fixed lang_printable_name invocation.
3632 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
3633 (build_labeled_block): Suppressed unused argument.
3634 (generate_labeled_block): Fixed build_labeled_block invocation.
3635 (build_loop_body): Suppressed unused local variables.
3636 (patch_loop_statement): Likewise.
3637 (patch_exit): Fixed lang_printable_name invocation.
3638 (patch_switch_statement): Likewise.
3639 (case_identity): First argument marked unused.
3640 (patch_try_statement): Fixed lang_printable_name invocations.
3641 (patch_synchronized_statement, patch_throw_statement): Likewise.
3642 (check_thrown_exceptions): Fixed check_thrown_exceptions and
3643 lang_printable_name invocations.
3644 (check_thrown_exceptions_do): Suppressed unused argument.
3645
fc45c7ef
TT
36461998-10-14 Tom Tromey <tromey@cygnus.com>
3647
3648 * jcf-write.c (write_classfile): Add output class file as target.
3649 * lang-options.h: Added -MD, -MMD, -M, and -MM.
3650 * jcf.h: Added declarations for dependency-tracking functions.
3651 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
3652 * lang.c (lang_decode_option): Recognize -MD and -MMD.
3653 (finish_parse): Call jcf_dependency_write.
3654 (dependency_tracking): New global.
3655 (DEPEND_SET_FILE): New define.
3656 (DEPEND_ENABLE): New define.
3657 (init_parse): Enable dependency tracking if required.
3658 Include "flags.h".
3659 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
3660 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
3661 (../gcjh$(exeext)): Likewise.
3662 (jcf-depend.o): New target.
3663 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
3664 (GCJH_SOURCES): Likewise.
3665 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
3666 dep_name argument.
3667 (find_classfile): Added dep_name argument.
3668 (find_class): Compute name of dependency.
3669 (open_in_zip): Call jcf_dependency_add_file.
3670 * gjavah.c (output_file): No longer global.
3671 (usage): Don't mention "gjavah".
3672 (help): Likewise.
3673 (java_no_argument): Likewise.
3674 (version): Likewise.
3675 (main): Recognize and handle -M family of options.
3676 (print_mangled_classname): Return is void.
3677 (process_file): Handle case where output is suppressed.
3678 (HANDLE_END_FIELD): Likewise.
3679 (HANDLE_METHOD): Likewise.
3680 * jcf-depend.c: New file.
3681
bcf6c7e3
JL
3682Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
3683
3684 * java-tree.def: Add missing newline at EOF.
3685
0a65887a
TT
36861998-10-13 Tom Tromey <tromey@cygnus.com>
3687
3688 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
3689 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
3690 function.
3691 Include <config.h> and "system.h".
3692 (disassemble_method): Undefine RET to avoid clash with
3693 config/i386/i386.h.
3694
b9f7e36c
APB
3695Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3696
3697 * decl.c (runtime_exception_type_node, error_exception_type_node):
3698 New global variables.
3699 (init_decl_processing): Initialized.
3700 * expr.c (java_lang_expand_expr): Set caught exception type to
3701 null if catch handler argument doesn't exit.
3702 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
3703 tree codes.
3704 * java-tree.h (runtime_exception_type_node,
3705 error_exception_type_node): Global variables declared.
3706 (DECL_FUNCTION_THROWS): New macro.
3707 (DECL_FUNCTION_BODY): Modified comment.
3708 (DECL_SPECIFIC_COUNT): Likewise.
3709 (struct lang_decl): New field throws_list.
3710 (IS_UNCHECKED_EXPRESSION_P): New macro.
3711 * lex.c (java_lex): Generate location information for THROW_TK.
3712 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
3713 EXCEPTIONS_P): New macros.
3714 (enum jdep_code): New value JDEP_EXCEPTION.
3715 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
3716 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
3717 PATCH_METHOD_RETURN_ERROR): New macros.
3718 (patch_method_invocation_stmt): Added new argument to prototype.
3719 (patch_synchronized_statement, patch_throw_statement,
3720 check_thrown_exceptions, check_thrown_exceptions_do,
3721 purge_unchecked_exceptions, check_throws_clauses): New function
3722 prototypes.
3723 * parse.y Fixed typo in keyword section.
3724 (throw:): Rule tagged <node>.
3725 (THROW_TK): Keyword tagged <operator>.
3726 (method_header:): Last argument to call to method_header passed
3727 from throws: rule.
3728 (throws:, class_type_list:, throw_statement:,
3729 synchronized_statement:, synchronized:): Defined actions.
3730 (method_header): New local variable current. Register exceptions
3731 from throws clause.
3732 (java_complete_tree): Complete and verify exceptions from throws
3733 clause.
3734 (complete_class_report_errors): Error message on exceptions not
3735 found
3736 (java_check_regular_methods): Fixed typo. Shortcut on private
3737 overriding methods. Changed error message on method
3738 redefinition. Check for throws clause compatibility.
3739 (check_throws_clauses): New function.
3740 (java_check_abstract_methods): Use DECL_NAME for wfl or current
3741 method. Changed error message on method redefinition.
3742 (currently_caught_type_list): New static variable.
3743 (java_complete_expand_methods): Purge unchecked exceptions from
3744 throws clause list. Call PUSH_EXCEPTIONS before walk and
3745 POP_EXCEPTIONS after.
3746 (resolve_qualified_expression_name): Pass new argument as NULL to
3747 patch_method_invocation_stmt.
3748 (patch_method_invocation_stmt): New argument ref_decl. Invoke
3749 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
3750 argument list when appropriate. Use new argument if non null to
3751 store selected method decl.
3752 (patch_invoke): Convert if necessary args of builtin types before
3753 forming CALL_EXPR. Argument list no longer reversed here.
3754 (invocation_mode): Treat final methods as static methods.
3755 (java_complete_tree): New cases for THROW_EXPR: and
3756 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
3757 function call.
3758 (complete_function_arguments): No more RECORD_TYPE
3759 conversion. Function parameter nodes no longer saved.
3760 (valid_ref_assignconv_cast_p): Avoid handling null type.
3761 (patch_binop): Fixed null constant reference handling.
3762 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
3763 BUILD_THROW macros.
3764 (patch_try_statement): Fixed comments. Record caught types in
3765 list, push the list, expand try block and pop the list.
3766 (patch_synchronized_statement, patch_throw_statement,
3767 check_thrown_exceptions, check_thrown_exceptions_do,
3768 purge_unchecked_exceptions): New functions.
3769 * typeck.c (lookup_argument_method): Allow WFL in place of method
3770 DECL_NAME during method definition check
3771
6d6044b0
PB
37721998-10-09 Tom Tromey <tromey@cygnus.com>
3773
3774 * gjavah.c (decode_signature_piece): New function.
3775 (print_c_decl): Use it. Added `name_override' argument.
3776 (print_method_info): Use name_override argument to print_c_decl.
3777 (seen_fields): Removed.
3778 (print_field_info): Don't update seen_fields.
3779 (struct method_name): New structure.
3780 (method_name_list): New global.
3781 (print_method_info): Add new method to list of methods.
3782 (name_is_method_p): New function.
3783 (print_field_info): If field name has same name as method, then
3784 change field name.
3785 (process_file): Parse methods before fields.
3786 (field_pass): New global.
3787 (HANDLE_END_FIELD): Take field_pass into account.
3788
13abbf47
KG
3789Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3790
3791 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
3792 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
3793
6d6044b0
PB
3794Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
3795
3796 * jvspec.c: Fix bug in jvgenmain_spec patch.
3797
3798Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3799
3800 * Makefile.in (lang.o:): Install dependency on java-tree.def.
3801 * decl.c (soft_exceptioninfo_call_node): New global variable.
3802 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
3803 takes extra integer argument. soft_exceptioninfo_call_node
3804 initialized.
3805 * except.c (java_set_exception_lang_code): New function
3806 (method_init_exceptions): Called here.
3807 (prepare_eh_table_type): New function.
3808 (expand_end_java_handler): Called here.
3809 * expr.c (build_java_throw_out_of_bounds_exception): Now features
3810 one argument. Modified generation of call to
3811 soft_badarrayindex_node to use new argument.
3812 (build_java_arrayaccess): Pass faulty index value to
3813 build_java_throw_out_of_bounds_exception.
3814 (generate_name): New function.
3815 (java_lang_expand_expr): New local variables node, current,
3816 has_finally_p. Expand TRY_EXPR node.
3817 (process_jvm_instruction): Replace top of the stack with thrown
3818 object reference when entering exception handler.
3819 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
3820 specific tree codes.
3821 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
3822 global.
3823 (DECL_SPECIFIC_COUNT): New macro.
3824 (prepare_eh_table_type, java_set_exception_lang_code,
3825 generate_name): New function declarations.
3826 (match_java_method): Declaration deleted.
3827 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
3828 macros.
3829 * lex.c (TRY_TK, CATCH_TK): Generate location information.
3830 * parse.h (redefinition_error, refine_accessible_methods_list,
3831 can_cast_to_p): Function declaration removed.
3832 (classitf_redefinition_error, variable_redefinition_error,
3833 parse_jdk1_1_error, find_applicable_accessible_methods_list,
3834 find_most_specific_methods_list, argument_types_convertible,
3835 enter_a_block, valid_builtin_assignconv_identity_widening_p,
3836 valid_cast_to_p, valid_method_invocation_conversion_p,
3837 try_reference_assignconv, add_stmt_to_compound,
3838 build_jump_to_finally, build_tree_list, patch_try_statement,
3839 java_get_catch_block): New function declarations.
3840 * parse.y (string_buffer_type): Global variable deleted.
3841 (group_of_labels, catches, catch_clause, catch_clause_parameter,
3842 finally): Rules tagged <node>.
3843 (TRY_TK, CATCH_TK): Token tagged <operator>.
3844 (class_body_declaration:, class_member_declaration:,
3845 formal_parameter:, explicit_constructor_invocation:,
3846 interface_member_declaration:, constant_declaration:,
3847 primary_no_new_array:, class_instance_creation_expression:,
3848 array_creation_expression:): Issue error on unsuported JDK1.1
3849 features.
3850 (try_statement:, catches:, finally:): Define actions.
3851 (catch_clause_parameter): New rule.
3852 (catch_clause:): Use new rule catch_clause_parameter.
3853 (parse_jdk1_1_error): New function.
3854 (redefinition_error): Renamed classitf_redefinition_error.
3855 (variable_redefinition_error): New function.
3856 (check_class_interface_creation): Call
3857 classitf_redefinition_error.
3858 (java_complete_tree): Added error message on JDEP_TYPE: case.
3859 (complete_class_report_errors): Fixed indentation.
3860 (declare_local_variables): Call variable_redefinition_error.
3861 (source_end_java_method): Call java_set_exception_lang_code and
3862 emit_handlers where appropriate.
3863 (java_method_add_stmt): Call add_stmt_to_block.
3864 (add_stmt_to_block): New function.
3865 (lookup_method_invoke): Fixed outside comment. new local variable
3866 candicates. Call find_applicable_accessible_methods_list and
3867 find_most_specific_methods_list when searching for a
3868 method. Modified error report to list possible candidates when
3869 applicable.
3870 (find_applicable_accessible_methods_list,
3871 find_most_specific_methods_list, argument_types_convertible): New
3872 function.
3873 (refine_accessible_methods_list): Function deleted.
3874 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
3875 expr (if applicable) before calling patch_array_ref.
3876 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
3877 (enter_block): Fixed comment.
3878 (enter_a_block): New function.
3879 (patch_assignment): Reorganized. Call try_reference_assignconv for
3880 references. Call valid_cast_to_p instead of can_cast_to_p.
3881 (try_reference_assignconv,
3882 valid_builtin_assignconv_identity_widening_p): New functions.
3883 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
3884 (valid_cast_to_p, valid_method_invocation_conversion_p): New
3885 functions.
3886 (build_string_concatenation): Don't resolve StringBuffer.
3887 (patch_cast): Fixed inverted arguments.
3888 (patch_array_ref): Code to save array expr deleted. Call
3889 valid_cast_to_p instead of can_cast_to_p.
3890 (generate_labeled_block): Call generate_name.
3891 (build_jump_to_finally, build_try_statement, java_get_catch_block,
3892 patch_try_statement): New functions.
3893 * typeck.c (match_java_method): Function deleted.
3894
3895Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
3896
3897 * jvspec.c: jvgenmain_spec uses different temporary file names.
3898
3899Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
3900
3901 * jvspec.c (lang_specific_driver): Fail if user specifies
3902 --main= when not linking.
3903
3904Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
3905
3906 * class.c (make_class_data): Push value for `thread' field.
3907 * decl.c (init_decl_processing): Added `thread' field to class.
3908
3909 * class.c (add_field): Always make static fields externally
3910 visible.
3911
3912Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
3913
3914 * expr.c (build_java_athrow,
3915 build_java_throw_out_of_bounds_exception, expand_invoke,
3916 build_newarray, expand_java_multianewarray, build_java_monitor):
3917 Update comments to reflect _Jv_* function names.
3918
3919Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
3920
3921 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
3922 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
3923 * parse.y (expand_start_java_method): Likewise.
3924
3925Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
3926
3927 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
3928
3929 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
3930 (add_field): No longer need to convert from RECORD_TYPE to pointer,
3931 * expr.c: Remove no-longer-needed calls to promote_type.
3932 * decl.c (give_name_to_locals): Liekwise.
3933 * jcf-parse.c (get_class_constant): Compensate for new signatures.
3934 * parse.y: Add/remove promote_type calls as appropriate.
3935 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
3936 (parse_signature_string): Likewise.
3937 (build_java_array_type): Fix for now signature convenions.
3938
3939 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
3940
3941Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
3942
3943 * class.c (init_class_processing): libjava function renamed to
3944 _Jv_RegisterClass.
3945
3946Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3947
3948 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
3949 * java-tree.def: Fixed DEFTREECODE third argument.
3950 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
3951 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
3952 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
3953 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
3954 JAVA_THIS_EXPR): Now replaced by tree code definitions.
3955 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
3956 * lang.c (java_tree_code_type, java_tree_code_length,
3957 java_tree_code_name): New arrays.
3958 (lang_init): Append Java tree node definitions to Gcc ones.
3959 * lex.c (expression_obstack): Declared as extern when JC1_LITE
3960 defined.
3961 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
3962 wfl_to_string.
3963 (java_lex): Allow declaration of empty string constants. Retain
3964 location information on CASE_TK and DEFAULT_TK.
3965 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
3966 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
3967 Modified to be more robust.
3968 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
3969 (build_new_invocation, try_builtin_assignconv,
3970 patch_switch_statement, string_constant_concatenation,
3971 build_string_concatenation, patch_string_cst, patch_string,
3972 java_expand_switch): New function declarations.
3973 * parse.y: Rules related to switch and EH tagged <node>.
3974 (label_id): Set to NULL_TREE
3975 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
3976 tree nodes.
3977 (this_or_super:): Fixed indentation.
3978 (statement:, statement_nsi:, statement_without_trailing_substatement:,
3979 statement_expression:): Removed call to RULE on all sub-rules.
3980 (switch_expression:, switch_labels:): New rules.
3981 (switch_statement:, switch_block:, switch_block_statement_groups:,
3982 switch_block_statement_group:, switch_labels:, switch_label:):
3983 Defined actions.
3984 (throw_statement:, synchronized_statement:, try_statement:):
3985 Defined temporary actions.
3986 (class_instance_creation_expression:): Call
3987 build_new_invocation. Fixed indentation.
3988 (field_access): Fixed indentation.
3989 (method_invocation): Likewise.
3990 (make_qualified_primary): Use THIS_EXPR.
3991 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
3992 resolving from SUPER, set *type_found.
3993 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
3994 (java_complete_tree): Removed unused local variable `location'. Case
3995 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
3996 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
3997 on MODIFY_EXPR: and all binary operator tree code cases. Removed
3998 STRING_CST: case. default: checks for patchable strings.
3999 (complete_function_arguments): Transform string constant or
4000 crafted StringBuffer if necessary.
4001 (build_method_invocation): Fixed comments.
4002 (build_new_invocation): New function.
4003 (patch_assignment): Call try_builtin_assignconv to figure a valid
4004 assignment conversion between builtin types.
4005 (try_builtin_assignconv): New function.
4006 (build_binop): Use URSHIFT_EXPR directly to call build.
4007 (operator_string): Use UNARY_PLUS_EXPR.
4008 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
4009 operator.
4010 (do_merge_string_cste, merge_string_cste,
4011 string_constant_concatenation, build_string_concatenation,
4012 patch_string, patch_string_cst): New function.
4013 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
4014 (patch_unaryop): Likewise. New test of valid ++/-- operands.
4015 (build_newarray_node): Use NEW_ARRAY_EXPR.
4016 (build_this): Use THIS_EXPR.
4017 (build_return): Enable debug information on return statement.
4018 (build_if_else_statement): Likewise.
4019 (complete_labeled_statement): Fixed related comment.
4020 (build_loop_body): Fixed comment.
4021 (build_bc_statement): Enable debug information on break/continue
4022 statements.
4023 (patch_bc_statement): Fixed typos. Handle SWITCH statement
4024 context.
4025 (patch_switch_statement, case_identity, java_expand_switch): New
4026 functions.
4027
4028Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
4029
4030 * buffer.h (BUFFER_INIT): New macro.
4031 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
4032 Pass (struct jcf_partial *state) to most functions.
4033 (jcf_block, jcf_relocation): New types.
4034 Support labels, branches, conditionals, loops.
4035
4036Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
4037
4038 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
4039
4040Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
4041
4042 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
4043 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
4044 not integer_type_node (INT_TYPE_SIZ bits).
4045
4046 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
4047
4048 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
4049 * jcf-dump.c (print_exception_table): New function.
4050 (disassemble_method): Better handling of wide instructions.
4051 Make more robust for bad input.
4052
4f01de5c
JL
4053Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
4054
4055 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
4056 FreeBSD.
4057
da4f7dc1
JL
4058Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
4059
4060 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
4061
4a4a4682
TT
4062Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
4063
4064 * Makefile.in ($(PARSE_H)): Removed target.
4065
e6a480d3
JL
4066Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
4067
4068 * Makefile.in (JAVA_OBJS): Add memmove.o
4069 (memmove.o): New target & rules.
4070
6d6044b0
PB
4071Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
4072
4073 * expr.c (expand_invoke): Don't generate a call to the class init
4074 code.
4075
1f43f4b4
JL
4076Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
4077
4078 * Makefile.in: Add many missing dependencies.
4079 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
4080 as appropriate.
4081 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
4082 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
4083
6d6044b0
PB
4084Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
4085
4086 * decl.c (complete_start_java_method): If method is static (and
4087 not private) call _Jv_InitClass.
4088 * expr.c (expand_invoke): Don't call build_class_init.
4089
4090 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
4091
76f42086
JL
4092Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
4093
4094 * Make-lang.in (GCJ): Define before using.
4095
71d05349
JL
4096Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
4097
4098 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
4099 losing due to namespace pollution in GNU getopt.h
4100
232e6c7c
TT
4101Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
4102
4103 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
4104 (java.all.cross): Likewise.
4105 (java.rest.encap): Likewise.
4106
e742fecc
JL
4107Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
4108
4109 * gjavah.c (print_class_decls): Fix thinko in arglist
4110 * jcv-io.c (find_classfile): Similarly.
4111
5db17173
JL
4112Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
4113
4114 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
4115
6d6044b0
PB
4116Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
4117
4118 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
4119 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
4120 * Makefile.in (PARSE_C): New macro.
4121 (PARSE_H): Likewise.
4122 (PARSE_SCAN_C): Likewise.
4123 ($(PARSE_C)): Target renamed from parse.c.
4124 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
4125 (clean): Remove parse-scan.c as well.
4126 (parse.o): Depend on $(PARSE_C).
4127
4128Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
4129
4130 * README, license.terms: Removed.
4131
4132 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
4133 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
4134 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
4135 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
4136 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
4137 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
4138 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
4139 and Java trademark attribution.
4140
4141Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
4142
4143 * Makefile.in: Use gcjh, not gjavah.
4144 * config-lang.in (stagestuff): Use gcjh, not gjavah.
4145 * Make-lang.in: Changed gjavah to gcjh everywhere.
4146
4147Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
4148
4149 * gjavah.c: Support new -prepend -add -append flags.
4150 (print_method_info): Method is not virtual if class is final.
4151
9dd939b2 4152Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6d6044b0
PB
4153
4154 * jv-scan.c: Fixed copyright assignment.
4155 * keyword.gperf: Likewise.
4156 * keyword.h: Likewise.
4157 * lex.c: Fixed copyright assignment.
4158 (java_lex): Push unicode back when parsing '<'.
4159 * lex.h: Fixed copyright assignment.
4160 * parse-scan.y: Likewise.
4161 * parse.h: Fixed copyright assignment.
4162 (build_debugable_stmt, complete_for_loop): New function prototypes.
4163 * parse.y: Fixed copyright assignment.
4164 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
4165 size_zero_node when completing a loop with no exit condition.
4166 (for_statement_nsi:): Define action.
4167 (for_init:, for_update:): Return size_zero_node when empty.
4168 (declare_local_variables): Call build_debugable_stmt.
4169 (build_debugable_stmt): New function.
4170 (build_loop_body): Build debugable statement around loop
4171 condition part.
4172 (complete_loop_body): Take into account the debugable statement
4173 around the EXIT_EXPR.
4174 (complete_loop_body): New function.
4175 (patch_exit_expr): Fixed condition inversion.
4176
4177Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
4178
4179 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
4180 name of thread define.
4181 * jvspec.c (THREAD_NAME): New macro.
4182 (GCLIB): Likewise.
4183 (THREADLIB): Likewise.
4184 (lang_specific_driver): Recognize attempt to link with thread
4185 library or gc library. Recognize -ljava on command line so it
4186 isn't linked against more than once.
4187
4188Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4189
4190 * parse-scan.y (report_main_declaration): Name of the class
4191 containing `main' can be a qualified name.
4192
4193Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
4194
4195 * config-lang.in: Changed gjavac to gjc everywhere.
4196 * Make-lang.in: Changed gjavac to gjc everywhere.
4197
4198Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4199
4200 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
4201 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
4202 and install the files.
4203 * Makefile.in (JAVA_OBJS_LITE): New variable.
4204 (compiler:): Now include jv-scan as a dependency.
4205 (../jv-scan$(exeext), parse-scan.c): New targets.
4206 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
4207 * config-lang.in (compilers): Removed gcj, gjavah from the list.
4208 * jcf-parse.c (parse_source_file): Call java_layout_classes and
4209 check for errors even if parse_only.
4210 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
4211 defined.
4212 (yylex): New function. Uses java_lex body.
4213 (java_lex): Removed commented out statement. Remove local variable
4214 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
4215 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
4216 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
4217 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
4218 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
4219 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
4220 where appropriate.
4221 (java_lex_error): Empty if JC1_LITE is defined.
4222 (java_get_line_col): Return 0 if JC1_LITE is defined.
4223 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
4224 SET_MODIFIER_CTX): Moved into the section containing the macros
4225 conditionally defined by JC1_LITE.
4226 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
4227 argument if JC1_LITE is defined.
4228 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
4229 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
4230 is defined.
4231 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
4232 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
4233 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
4234 to different values according to JC1_LITE.
4235 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
4236 declared if JC1_LITE set.
4237 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
4238 defined if JC1_LITE not set.
4239 (struct parser_ctx): Reorganized and skip the jc1 front end part
4240 if JC1_LITE set.
4241 (java_layout_classes): New function definition.
4242 (java_push_parser_context, java_init_lex, yyparse, yylex,
4243 yyerror): Prototype always declared. All other static function
4244 prototypes declared only if JC1_LITE is not set.
4245 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
4246 declared in parse.h.
4247 (java_layout_classes): New function.
4248 (java_complete_expand_methods): No longer layout the class here.
4249 * parse-scan.y: New file.
4250 * jv-scan.c: New file.
4251
4252Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
4253
4254 * gjavah.c (main): Handle -friend option.
4255 (friend_specs): New global.
4256 (generate_access): Handle friend_specs.
4257 (process_file): Likewise.
4258 (MAX_FRIENDS): New macro.
4259 (friend_count): New global.
4260 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
4261 Changed all callers.
4262
4263Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
4264
4265 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
4266 (main): Handle processing all the entries of a named .zip archive.
4267 * jcf-io.c (jcf_trim_old_input): New function.
4268 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
4269
4270Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
4271
4272 * lang.c (flag_assume_compiled): Make default be on.
4273
4274Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
4275
4276 * jcf-dump.c: Add bunches of flags to control output more.
4277 (process_class): New function; support printing more than one class.
4278 (main): Support new --print-main and --javap flags.
4279 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
4280 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
4281
4282Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
4283
4284 Change mangling of dispatch table to match C++ vtable (w/thunks).
4285 * class.c (build_dtable_decl), java-tree.h: New function.
4286 (make_class_data): Call it.
4287 * decl.c (init_decl_processing): Likewise.
4288
4289Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
4290
4291 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
4292 soft_anewarray; adjust args passed.
4293 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
4294 match _Jv_NewObjectArray.
4295
4296Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4297
4298 * decl.c (push_labeled_block, pop_labeled_block): New functions.
4299 * expr.c (loopup_label): Call create_label_decl.
4300 (create_label_decl): New function.
4301 (java_lang_expand_expr): Call expand_start_bindings with argument
4302 set to zero.
4303 * java-tree.h Added space after PROTO in function declarations
4304 when necessary.
4305 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
4306 (create_label_decl, push_labeled_block): New function
4307 declarations.
4308 * lex.c (label_id): Initialize.
4309 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
4310 switch.
4311 * parse.h Added space after PROTO in function declarations when
4312 necessary.
4313 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
4314 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
4315 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
4316 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
4317 macros.
4318 (struct parser_ctxt): New fields current_loop,
4319 current_labeled_block.
4320 (build_if_else_statement, patch_if_else_statement,
4321 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
4322 generate_labeled_block, complete_labeled_statement,
4323 build_bc_statement, patch_bc_statement, patch_loop_statement,
4324 build_new_loop, build_loop_body, complete_loop_body): New function
4325 declarations.
4326 * parse.y (java_warning_count): New global variable.
4327 (label_id): New static variable.
4328 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
4329 (block:): Return size_zero_node when block is empty.
4330 (empty_statement:): Return size_zero_node.
4331 (statement:): Implement supplemental action when for_statement: is
4332 reduced.
4333 (label_decl:): New rule.
4334 (labeled_statement:): Rewritten using label_decl. Actions
4335 implemented.
4336 (labeled_statement_nsi:): Likewise.
4337 (if_then_statement): Actions implemented.
4338 (while_expression): New rule.
4339 (while_statement:): Rewritten using while_expression. Actions
4340 implemented.
4341 (while_statement_nsi:): Likewise.
4342 (do_statement_begin:): New rule.
4343 (do_statement:): Rewritten using do_statement_begin. Actions
4344 implemented.
4345 (for_statement:): Rewritten using for_begin. Actions implemented.
4346 (for_statement_nsi:): Likewise.
4347 (for_header:, for_begin:): New rules.
4348 (for_init:): Actions implemented.
4349 (statement_expression_list:, break_statement:,
4350 continue_statement:): Likewise.
4351 (yyerror): Count number of issued warning(s).
4352 (java_report_errors): Report error(s) and/or warning(s).
4353 (java_complete_class): Use build_java_argument_signature to
4354 recompute completed method signature.
4355 (java_check_regular_methods): New locals method_wfl and aflags.
4356 Use method_wfl instead of lookup_cl during error reports. Fixed
4357 indentation and modified some error messages. Use
4358 lang_printable_name in method instead of the DECL_NAME. New code
4359 to issue warnings on methods not overriding corresponding methods
4360 private to a different package.
4361 (java_method_add_stmt): Call add_stmt_to_compound.
4362 (add_stmt_to_compound): New function.
4363 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
4364 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
4365 (build_if_else_statement, patch_if_else_statement,
4366 build_labeled_block, generate_labeled_block,
4367 complete_labeled_statement, build_new_loop, build_loop_body,
4368 complete_loop_body, patch_loop_statement, build_bc_statement,
4369 patch_bc_statement, patch_exit_expr): New functions.
4370 * typeck.c (build_java_signature): Build argument signature before
4371 enclosing it in between parenthesis.
4372
4373Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
4374
4375 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
4376 (JAVA_OBJS): Added reminder comment
4377
4378Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
4379
4380 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
4381 be interpreted as a long long.
4382
4383Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
4384
4385 * decl.c (init_decl_processing): Use _Jv_InitClass, not
4386 soft_initialise_class. Use _Jv_NewMultiArray, not
4387 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
4388 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
4389 _Jv_CheckArrayStore, not soft_checkarraystore. Use
4390 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
4391
4392Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
4393
4394 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
4395 length_identifier_node): New global tree node constants.
4396 * parse.y (kw_super, kw_this, kw_length): Removed globals.
4397 Replace uses by super_identifier_node etc.
4398 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
4399
4400 * parse.y (resolve_field_access): Don't special-case ".length" if
4401 flag_emit_class_files.
4402 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
4403 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
4404 and ARRAY.length.
4405
4406Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
4407
4408 * decl.c (init_decl_processing): Remove unused method_type_node fields.
4409 * class.c (make_method_value): Remove init for removed fields.
4410
4411 * class.c (layout_class): Use build_java_argument_signature.
4412 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
4413
4414 * typeck.c (push_java_argument_signature): Removed. Merged into ...
4415 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
4416 (build_java_signature): Don't use push_java_argument_signature.
4417
4418 * typeck.c (lookup_argument_method): New function.
4419 * parse.y (java_check_regular_methods): Use lookup_argument_method
4420 instead of lookup_java_method2 followed by lookup_java_method.
4421
4422 * parse.y (check_method_redefinition): Minor optimization.
4423
4424 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
4425 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
4426
4427Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
4428
4429 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
4430 c-pragma.o.
4431
4432 * gjavah.c (java_float_finite): Use K&R-style definition.
4433 (java_double_finite): Likewise.
4434 (generate_access): Now returns void. Changed all callers.
4435 (last_access_generated): Removed.
4436 (process_file): Only make a single pass over the .class file.
4437
4438Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
4439
4440 * class.c (get_dispatch_table): Add extra dummy vtable entry,
4441 for compatibility for G++ (with -fvtable-thunks).
4442 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
4443
4444 * gjavah.c (process_file): Use public inheritance for super-class.
4445
4446Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4447
4448 * lex.c (java_init_lex): Initialize ctxp->package.
4449 * parse.h (struct parser_ctxt): package and package_len replaced
4450 by tree package, an identifier node. Field method_decl_list is
4451 gone. Fixed comments.
4452 (lookup_field_wrapper, merge_qualified_name, not_accessible,
4453 class_in_current_package): New function prototypes.
4454 * parse.y (array_type:): Set class loaded flag on primitive type
4455 arrays.
4456 (package_declaration:): Assign ctxp->package to the
4457 identifier node.
4458 (method_invocation:): Handle invocation of method qualified by
4459 `super'.
4460 (single_type_import_declaration:): Removed ambiguity check.
4461 (java_pop_parser_context): New local variable `next'. Reset and
4462 set IMPORT_CLASSFILE_NAME flags on current and previous import
4463 list.
4464 (java_accstring_lookup): Use new local macro COPY_RETURN.
4465 (lookup_field_wrapper): New function.
4466 (parser_qualified_classname): Use merge_qualified_name.
4467 (parser_check_super_interface): Broaden error message.
4468 (do_resolve_class): Check for qualified class name in the current
4469 compilation unit if appropriate.
4470 (process_imports): Check for already defined classes.
4471 (check_pkg_class_access): Got rid of call to
4472 get_access_flags_from_decl.
4473 (java_complete_expand_methods): Call safe_layout_class based on
4474 the current class size.
4475 (make_qualified_primary): Build a WFL qualification on primary if
4476 none exists.
4477 (merge_qualified_name): New function.
4478 (make_qualified_name): Use merge_qualified_name.
4479 (resolve_expression_name): Use safe_lookup_field.
4480 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
4481 (resolve_qualified_expression_name): Likewise. Check on resolved
4482 element accessibility.
4483 (not_accessible_p, class_in_current_package): New functions.
4484 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
4485 (patch_method_invocation_stmt): Merged common pieces. Check
4486 accessibility of invoked method.
4487 (check_for_static_method_reference): Add returned type in error
4488 message.
4489 (invocation_mode): Get rid of bogus check on PRIVATE methods.
4490 (refine_accessible_methods_list): Merged two conditions in test.
4491 (java_complete_class): Sanity check on stabilize_ref gone.
4492 * zextract.c (read_zip_archive): Cast lseek second argument to long.
4493
4494Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
4495
4496 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
4497
4498Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
4499
4500 * gjavah.c (F_NAN): Removed.
4501 (F_NAN_MASK): New macro.
4502 (F_POSITIVE_INFINITY): Removed.
4503 (F_NEGATIVE_INFINITY): Likewise.
4504 (java_float_finite): Rewrote.
4505 (D_NAN_MASK): Renamed.
4506 (java_double_finite): Rewrote.
4507 (D_POSITIVE_INFINITY): Removed.
4508 (D_NEGATIVE_INFINITY): Likewise.
4509
4510 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
4511 If verbose, print underlying representation of value in hex.
4512
4513Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
4514
4515 * buffer.h, buffer.c: New files.
4516 * Makefile.in (JAVA_OBJS): Add buffer.o.
4517
4518 Support locals variables and writing their debug entries to .class.
4519 * jcf-write.c: Simplify some by user new buffer type.
4520 (vode_buffer_grow): Removed.
4521 (struct localvar_info): New type.
4522 (localsvars, localvartable): New buffers.
4523 (localvar_alloc, localvar_free): New functions.
4524 (generate_bytecode_insns): Handle local variables.
4525 (generate_classfile): Write LocalVariableTable attribute.
4526
4527Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4528
4529 * jcf-io.c (open_in_zip): Check the zipfile magic number.
4530 * zipfile.h (ZIPMAGIC): New macro.
4531
4532Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
4533
4534 * Makefile.in (gjavah.o): Updated dependencies.
4535 (jcf-dump.o): Likewise.
4536 (all.indirect): Use ../gjavah.
4537 (../gjavah$(exeext)): Likewise.
4538 (clean): Don't remove gjavah.
4539 (clean): Remove parse.c, not java/parse.c.
4540 * Make-lang.in (java): Added gjavah.
4541 (gjavah$(exeext)): New target.
4542 (GJAVAH_SOURCES): New macro.
4543 (java.all.build): Added gjavah.
4544 (java.all.cross): Likewise.
4545 (java.rest.encap): Likewise.
4546 * config-lang.in (compilers, stagestuff): Added gjavah.
4547
4548Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
4549
4550 * gjavah.c (java_float_finite): New function.
4551 (java_double_finite): Likewise.
4552 (F_POSITIVE_INFINITY): New macro.
4553 (F_NEGATIVE_INFINITY): Likewise.
4554 (F_NAN): Likewise.
4555 (D_POSITIVE_INFINITY): Likewise.
4556 (D_NEGATIVE_INFINITY): Likewise.
4557 (D_NAN): Likewise.
4558 (print_field_info): Use java_float_finite and java_double_finite.
4559
4560Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
4561
4562 * parse.y (method_header): Name "this" implicit argument.
4563
4564Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
4565
4566 * jcf-write.c: Write out LineNumberTable attribute in .class file.
4567 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
4568 (put_linenumber): New function.
4569 (generate_bytecode_insns, generate_classfile): Write line numbers.
4570
4571Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4572
4573 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
4574 (lookup_name, build_known_method_ref, build_class_init,
4575 build_invokevirtual, invoke_build_dtable, match_java_method,
4576 build_field_ref, pushdecl_force_head, build_java_binop,
4577 binary_numeric_promotion, build_decl_no_layout,
4578 build_java_arrayaccess, build_newarray, build_anewarray,
4579 build_java_array_length_access, build_java_arraynull_check): New
4580 extern function prototypes.
4581 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
4582 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
4583 java-tree.h.
4584 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
4585 to NULL
4586 * jcf.h (jcf_out_of_synch): New extern function prototype.
4587 * parse.h: Static/global function implemented in parse.y
4588 prototyped and declarations moved at the end of the file.
4589 (DECL_P): Check that the argument isn't null.
4590 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
4591 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
4592 (QUAL_DECL_TYPE): New macro.
4593 (PARAMS): Macro definition removed.
4594 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
4595 (return_statement:): Call build_return.
4596 (field_access:): Call make_qualified_primary in sub rule.
4597 (method_invocation:): Build method invocation and call
4598 make_qualified_primary when processing primaries.
4599 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
4600 get_type_from_signature.
4601 (java_check_regular_method): Extra integer 0 argument when calling
4602 lookup_java_method2.
4603 (lookup_java_interface_method2): Extra method DECL argument when
4604 calling lookup_java_interface_method2.
4605 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
4606 COMPOUND_EXPR node.
4607 (java_complete_expand_method): Layout current class iff not
4608 already done. Don't process interface's methods.
4609 (java_complete_expand_method): Use super class only if it
4610 exists. Use current class otherwise.
4611 (make_qualified_primary): New function.
4612 (resolve_expression_name): Process qualified expression or
4613 expression from primary the same way.
4614 (resolve_expression_name): Two last arguments to
4615 resolve_field_access are now NULL_TREEs.
4616 (resolve_field_access): New variable is_static. Local field must
4617 be DECLs. is_static computed on field DECLs only. Append code in
4618 where_found to the field access if necessary. Use QUAL_DECL_TYPE
4619 to initialize field_type.
4620 (resolve_qualified_expression_name): New local variable,
4621 previous_call_static and is_static. Handle primaries with function
4622 calls, casts, array references and `this'. `super' now handled as
4623 `(super_class)this'. Use is_static to clarify boolean expressions.
4624 Added code to handle case where a proper handle is required to
4625 access a field. Use QUAL_DECL_TYPE where applicable.
4626 (maybe_access_field): New function.
4627 (patch_method_invocation_stmt): New arguments primary, where,
4628 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
4629 deleted. Use `where' as a type to search from if specified. Check
4630 for static method reference where forbidden. Append primary or
4631 current_this to the argument list if not calling constructor nor
4632 static methods.
4633 (check_for_static_method_reference): New function.
4634 (patch_invoke): Layout the class on which new is done if
4635 necessary.
4636 (lookup_method_invoke): Changed format to report errors on
4637 methods.
4638 (qualify_ambiguous_name): New local variable this_found. Now
4639 handle things from primaries. Method call are considered
4640 expression names.
4641 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
4642 changed into NULLs.
4643 (not_initialized_as_it_should_p): Comply with the new DECL_P.
4644 (java_complete_tree): New case fo RETURN_EXPR. Process function
4645 call arguments in separate function.
4646 (complete_function_arguments): New function.
4647 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
4648 anymore.
4649 (patch_assignment): Take the return function slot into account as
4650 a RHS. Distinguish assignment from a return.
4651 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
4652 when checking methods in interfaces.
4653 (resolve_type_during_patch): NULL argument to unresolve_type_p
4654 instead of NULL_TREE.
4655 (patch_newarray): Fixed typo in comment.
4656 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
4657 (build_return, patch_return): New functions.
4658 * typeck.c (lookup_java_constructor): Fixed typo in comment.
4659
4660Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
4661
4662 * constants.c (find_name_and_type_constant, find_fieldref_index,
4663 find_methodref_index): New methods.
4664 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
4665 just return given method. Also, rename to build_known_method_ref.
4666 (expand_invoke): Rename call to build_invoke_non_interface.
4667 * java-tree.h, parse.h: Update prototype.
4668 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
4669 (such as expand_expr_stmt) if flag_emit_class_files.
4670 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
4671 STACK_TARGET, IGNORE_TARGET): New macros.
4672 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
4673 (generate_bytecode_insn): New function to generate method's bytecode.
4674 (generate_classfile): Node generate Code attribute for a method.
4675 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
4676 push_long_const, field_op, adjust_typed_op, maybe_wide):
4677 New functions used by generate_bytecode_insn.
4678
4679 * typeck.c (signature_include_return): Remove variable.
4680 (push_java_argument_signature, build_java_argument_signature): New.
4681 (build_java_signature): Use push_java_argument_signature.
4682 * parse.y: Use build_java_argument_signature instead of fiddling
4683 with signature_include_return.
4684
4685Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
4686
4687 * gjavah.c (print_c_decl): Always generate JArray<>* for array
4688 types.
4689
4690 * Makefile.in (all.indirect): Added gjavah$(exeext).
4691 (gjavah$(exeext)): Added $(exeext).
4692 (clean): Likewise.
4693
4694Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4695
4696 * class.c (layout_class): Call to java_layout_parsed_class replace
4697 by safe_layout_class.
4698 * expr.c (build_java_array_length_access): Removed static storage
4699 class in the function definition.
4700 (build_java_arraynull_check): Likewise.
4701 Also fixed typos in two comments.
4702 * lex.c (java_init_lex): Initialize static global kw_length.
4703 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
4704 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
4705 java_lex_error.
4706 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
4707 * parse.h (resolve_no_layout): New static function declaration.
4708 (get_identifier_in_static): Declaration removed.
4709 (java_layout_parsed_class): Function name declaration changed to
4710 safe_layout_class.
4711 (build_newarray_node, patch_newarray, resolve_type_during_patch,
4712 not_initialized_as_it_should_p, build_this): New static function
4713 declarations.
4714 (pushdecl_force_head, build_java_binop, int_fits_type_p,
4715 binary_numeric_promotion, stabilize_reference,
4716 build_decl_no_layout, build_java_arrayaccess): Extern function
4717 declarations moved into their own section.
4718 (build_newarray, build_anewarray, build_java_array_length_access,
4719 build_java_arraynull_check): New extern function declarations.
4720 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
4721 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
4722 fake tree codes.
4723 (CALL_CONSTRUCTOR_P): New macro.
4724 * parse.y (kw_length): New static global tree node.
4725 (return_statement): Tagged <node>.
4726 (RETURN_TK): Tagged <operator>.
4727 (variable_declarator_id:): Build variable declaration with an
4728 empty initialization value if a syntax error was found in the
4729 initialization part of the variable declaration.
4730 (statement_without_trailing_substatement:): return_statement: now
4731 uses the default rule.
4732 (return_statement:): Temporarily fixed to return NULL_TREE.
4733 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
4734 (class_instance_creation_expression:): Class creation rules now
4735 call build_method_invocation upon reduction.
4736 (array_creation_expression:): Rules call build_newarray_node upon
4737 reduction.
4738 (dim_exprs:): Build a list of dimension expressions.
4739 (dim_expr:): Store location of the OSB_TK in the dimension
4740 expression node.
4741 (method_invocation:): Added a new error rule.
4742 (build_unresolved_array_type): WFL argument may also be an array
4743 on a primitive type. Name of the argument changed to reflect this.
4744 (method_declarator): Insert argument type at the beginning of the
4745 argument type list and later reverse the list.
4746 (unresolved_type_p): Argument 'returned' may be optionally
4747 NULL_TREE.
4748 (java_layout_class_from_source): Function renamed
4749 safe_layout_class.
4750 (resolve_and_layout): Now call resolve_no_layout and
4751 safe_layout_class.
4752 (resolve_no_layout): New function.
4753 (purify_type_name): New function.
4754 (complete_class_report_errors): Call purify_type_name during error
4755 report on a type not found.
4756 (process_imports): error_found local variable doesn't need to be
4757 initialized to zero.
4758 (declare_local_variables): New local type_wfl. Fixed typo in error
4759 message. type_wfl assigned to unresolved type and used to register
4760 incomplete type. Build a WFL around the variable initialization
4761 statement so that debug info can be generated on it.
4762 (source_start_java_method): Reverse argument list after they've
4763 been processed.
4764 (current_this): New static global variable.
4765 (java_complete_expand_methods): Set current_this when appropriate.
4766 (resolve_expression_name): Build correct static and non static
4767 field access bearing a simple name.
4768 (resolve_field_access): Resolve the length field of arrays. Handle
4769 f.m() cases.
4770 (patch_method_invocation_stmt): Set the type of the method
4771 invocation to error_mark_node. This value is later overridden by a
4772 valid type, if any. Don't handle qualified constructor invocation
4773 as qualified method invocation. Call lookup_method_invoke with its
4774 new flag. It's no longer necessary to access the selected method
4775 as the value of a tree list. Handle constructor invocation.
4776 (patch_invoke): Reverse argument list when invoking non interface
4777 methods. Insert call to new as the first argument of the
4778 constructor.
4779 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
4780 defined within a final class. Return INVOKE_STATIC if the invoked
4781 method is a constructor.
4782 (lookup_method_invoke): New lc argument is a flag to indicate a
4783 constructor lookup. Now handle constructor lookup. Choose the most
4784 specific method in case several were matching the invocation
4785 requirements. Return a method decl instead of a tree list featuring
4786 one single method decl element.
4787 (refine_accessible_methods_list): New lc flag argument to
4788 indicate that a constructor is being looked up.
4789 (not_initialized_as_it_should_p): New function.
4790 (java_complete_tree): Now process fake tree codes
4791 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
4792 save_expr on resolved function call arguments. Case on
4793 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
4794 (patch_assignment): LHS can be a field access expression. When
4795 dealing with reference, lhs_type is the promoted type of the
4796 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
4797 applicable.
4798 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
4799 (patch_binop): Use not_initialized_as_it_should_p where
4800 applicable.
4801 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
4802 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
4803 where applicable.
4804 (resolve_type_during_patch): New function.
4805 (patch_cast): Call resolve_type_during_patch to resolve type and
4806 report error accordingly.
4807 (patch_array_ref): Use not_initialized_as_it_should_p where
4808 applicable. Array base expression is saved before being
4809 used. Promote the type of an array elements if it contains non
4810 builtin types.
4811 (build_newarray_node, patch_newarray, build_this): New functions.
4812
4813Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
4814
4815 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
4816 increment it in `for' statement.
4817 (print_field_info): If number is inf or nan, don't print it.
4818 (print_method_info): If method name is `delete', just ignore it.
4819 (print_c_decl): Special-case jstringArray.
4820
4821 * gjavah.c (help): New function.
4822 (no_argument): New function.
4823 (usage): Changed text.
4824 (main): Rewrote argument handling. Now handles -v, --help,
4825 --version.
4826 (version): New function.
4827 (found_error): New global.
4828 (main): Return found_error.
4829 (generate_access): Set found_error.
4830 (print_c_decl): Likewise.
4831
4832Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
4833
4834 * gjavah.c (print_c_decl): Don't print "," when examining field.
4835 Skip type name when looking at "[L" types.
4836 (process_file): Now static.
4837 (generate_access): Now returns int.
4838 (last_access_generated): New global.
4839 (process_file): Clear last_access_generated; make multiple passes
4840 over the class.
4841 (print_field_info): Just return if generate_access returns true.
4842 (print_method_info): Likewise. Also, allow <init> functions to
4843 pass through.
4844 (print_c_decl): Added is_init argument. Print constructors
4845 properly.
4846 (print_cxx_classname): Use UTF8_GET to extract characters from
4847 string.
4848 (print_base_classname): New function.
4849 (print_class_decls): New function.
4850 (process_file): Use it.
4851 (utf8_cmp): New function.
4852
4853Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
4854
4855 * lang-options.h: Format changed to match changes in gcc/toplev.c
4856 to implement a --help option.
4857
48581998-07-10 Brendan Kehoe <brendan@cygnus.com>
4859
4860 * decl.c (init_decl_processing): Revert change to dtable_type.
4861
4862Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
4863
4864 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
4865
48661998-07-08 Brendan Kehoe <brendan@cygnus.com>
4867
4868 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
4869
4870 * lang.c (lang_init): Default flag_exceptions to 1, without
4871 checking to see if it's 2 first.
4872
4873Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
4874
4875 * constants.c: Include "system.h".
4876 * decl.c: Likewise.
4877 * lang.c (flag_new_exceptions): Get via extern now.
4878 (lang_init_options): New functions. Turn on flag_new_exceptions.
4879
4880Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4881
4882 * lex.c (java_lex): Return 0 when we see an invalid character in
4883 the input.
4884
4885 * lex.c (java_read_char): Specify extra argument when calling
4886 java_lex_error.
4887 (java_read_unicode, java_parse_end_comment,
4888 java_parse_escape_sequence): Likewise,
4889 (java_lex): Specify extra argument when calling
4890 java_lex_error. Test that IDs are beginning with a legal character
4891 for IDs. Handle invalid characters with an error message and a
4892 call to java_lex_error.
4893 (java_lex_error): Adjust column position by new argument
4894 `forward'. Issue an error even if in the middle of reporting an
4895 other error.
4896
48971998-07-07 Brendan Kehoe <brendan@cygnus.com>
4898
4899 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
4900 we don't explicitly put a null pointer when we're copying it.
4901
4902Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
4903
4904 * gjavah.c (print_cxx_classname): New function.
4905 (super_class_name): Likewise.
4906 (print_super_fields): Removed.
4907 (in_super): Removed.
4908 (print_field_info): Never generate #defines.
4909 (print_c_decl): Changed generated types to match JNI. No longer
4910 print class name before method name.
4911 (print_method_info): Print "static" before static methods.
4912 Print "virtual" before non-final methods.
4913 (usage): Use exit(1), not exit(-1).
4914 (main): Likewise.
4915 (print_field_info): Use %.17g to print a double.
4916 (last_access): New globals.
4917 (process_file): Initialize last_access.
4918 (usage): Now static.
4919 (ACC_VISIBILITY): New define.
4920 (generate_access): New function.
4921 (print_field_info): Call it.
4922 (print_method_info): Likewise. Also, generate information for all
4923 methods, not just native methods. Return void.
4924 (print_c_decl): Return void.
4925 (print_field_info): Return void.
4926
4927Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4928
4929 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
4930 processing the jc1 grammar file. Prefix bison functions and
4931 variables with java_.
4932 (parse.c): Dependencies on parse.h and lex.h
4933 * expr.c (build_java_arrayaccess): Function now global.
4934 * java-tree.h: Comment reorganized to carry on previous
4935 classification effort.
4936 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
4937 RESOLVE_TYPE_NAME_P): New flags on WFLs.
4938 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
4939 java_parse (new prefix java_ generated by bison).
4940 (java_layout_parsed_class, java_register_parsed_class): Function
4941 call removed.
4942 (yyparse): Removed unnecessary call to init_outgoing_cpool.
4943 * lex.c (static tree wfl_op): Variable deleted.
4944 (java_init_lex): Initialize kw_super and kw_this. Initialize more
4945 ctxp fields to NULL_TREE.
4946 (java_lex): No longer create WFL for operators. Filename caching
4947 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
4948 created as STRING_CST and later expanded. Removed extra argument
4949 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
4950 and SUPER.
4951 (build_wfl_node): Removed code in comments.
4952 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
4953 store token and location data in the current bison token.
4954 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
4955 static/extern function declaration at the beginning of the file.
4956 (struct qualification): Data structure definition deleted.
4957 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
4958 (qualify_ambiguous_name): Function declaration modified. Function
4959 now returns nothing.
4960 (build_array_ref, patch_array_ref, make_qualified_name,
4961 resolve_qualified_expression_name, maybe_generate_clinit,
4962 resolve_field_access): New static function declarations.
4963 (build_java_arrayaccess): New extern function declaration.
4964 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
4965 (CALL_EXPR_PRIMARY): Macro deleted.
4966 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
4967 (struct parser_ctxt): Field initialized_final
4968 removed. non_static_initialized, static_initialized: New fields.
4969 * parse.y (static tree kw_super, static tree kw_this): New global
4970 static.
4971 (%union): tree wfl field of operator member replaced by int
4972 location. WFLs are non longer created for operators.
4973 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
4974 (qualified_name:): Now calls make_qualified_name to build the
4975 identifier.
4976 (type_declaration:): Consider generating <clinit> when class
4977 parsing completed.
4978 (variable_declarator:): Directly build an assignment node when the
4979 variable is initialized when declared.
4980 (this_or_super:): Build a WFL and set current location when THIS
4981 or SUPER are parsed.
4982 (expression_statement:): Wrap statement around a WFL.
4983 (primary_no_new_array:): Fixed typo. Changed value returned by
4984 THIS_TK because of its new type (temporary).
4985 (dim_exprs:): Temporary fix because of OSB_TK's new type.
4986 (field_access:): Build qualified name with SUPER.
4987 (method_invocation:): Fixed returned value because of SUPER's new
4988 type.
4989 (array_access:): Use OSB_TK location information.
4990 (post_increment_expression:, post_decrement_expression:,
4991 unary_expression:, pre_increment_expression:,
4992 pre_decrement_expression:, unary_expression_not_plus_minus:,
4993 cast_expression:, multiplicative_expression:,
4994 additive_expression:, shift_expression:, relational_expression:,
4995 equality_expression:, and_expression:, exclusive_or_expression:,
4996 inclusive_or_expression:, conditional_and_expression:,
4997 conditional_or_expression:, assignment:): Use new location/token
4998 information available on operators.
4999 (create_class): Set super_decl_type to NULL_TREE when processing
5000 java.lang.Object.
5001 (register_fields): Field initialization is now a MODIFY_EXPR
5002 node. Chain initialization code to the matching lists (according
5003 the the field declaration modifiers).
5004 (maybe_generate_clinit): New function.
5005 (method_header): Don't set method's DECL_NAME to a WFL when adding
5006 methods to java.lang.Object.
5007 (resolve_and_layout): Now can return NULL_TREE if the type
5008 resolution fails. Otherwise, return the class DECL instead of its
5009 TYPE.
5010 (check_method_redefinition): Don't patch method DECL_NAME if it
5011 belongs to java.lang.Object.
5012 (process_imports): Simply assign error_found to the value returned
5013 by check_pkg_class_access.
5014 (declare_local_variables): Don't use their init statements (if
5015 any) when parsing error were previously found. Reuse MODIFY_EXPR
5016 build during parsing as an init statement.
5017 (java_method_add_stmt): Now return the current method body.
5018 (java_layout_parsed_class, java_register_parsed_class): Functions
5019 removed.
5020 (java_complete_expand_methods): Initialize the constant pool on a
5021 per class basis. Layout the classes before expanding their method
5022 bodies. Don't try expand artificial constructor code if error were
5023 found. Make the classes data and register them if no error were
5024 found.
5025 (java_complete_expand_method): Retrieve an artificial constructor
5026 argument list before entering its body. Assign the top block to
5027 the artificial constructor function body and set types of declared
5028 blocks and compound statements to void. Walk method body if not an
5029 artificial constructor.
5030 (make_qualified_name, cut_identifier_in_qualified): New functions.
5031 (resolve_expression_name): Fixed comments. Save/restore the
5032 current class CLASS_LOADED_P flag value. Build non qualified
5033 static field access and handle qualified expression names.
5034 (resolve_field_access, resolve_qualified_expression_name): New
5035 functions.
5036 (patch_method_invocation_stmt): Use the new expression resolution
5037 scheme, calling resolve_field_access when the function call is
5038 resolved as an expression.
5039 (qualify_ambiguous_name): Function rewritten to work on qualified
5040 expression produced by make_qualified_name.
5041 (java_complete_tree): Promote type when function's argument are
5042 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
5043 the assignment to discover further errors if RHS is a expression
5044 name that fails to evaluate. Declare LHS initialized even though
5045 the assignment failed. Don't use the location variable and removed
5046 extra argument in patch function calls. Now handle the ARRAY_REF
5047 case and build internal string representation when STRING_CSTs are
5048 walked.
5049 (build_method_invocation): Don't wrap function call around a WFL.
5050 (build_assignment): Likewise. Use the operator location
5051 information.
5052 (patch_assignment): Handle array access LHSs. Handle error
5053 provenance, resulting in a better error report.
5054 (build_binop): Use op_location from operator as binop location
5055 information.
5056 (build_unaryop, build_incdec, build_cast): Likewise.
5057 (patch_binop): Extract location information from the node. Fixed
5058 typo in error message.
5059 (patch_unary_op): Extract location information from the node.
5060 (build_array_ref, patch_array_ref): New functions.
5061
5062Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
5063
5064 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
5065 match _Jv_IsInstanceOf.
5066 * decl.c (init_decl_processing): Use _Jv_NewArray, not
5067 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
5068
5069Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
5070
5071 * decl.c (init_decl_processing): Functions are now named
5072 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
5073
5074Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
5075
5076 * java-tree.h (load_class): Add prototype.
5077 * class.c (is_compiled_class): Add missing arg to load_class.
5078 * expr.c (expand_java_NEW): Call load_class.
5079 * parse.y (process_import): Removed bogus use of void return value.
5080
5081Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
5082
5083 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
5084 Function name is "_Jv_Throw" instead of "soft_athrow".
5085 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
5086 Function name is "_Jv_AllocObject" instead of "soft_new".
5087 Takes an extra parameter (object size).
5088 * expr.c: Update calls.
5089
5090Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
5091
5092 * lex.c (java_get_line_col): Handle end-of-file.
5093 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
5094
5095Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
5096
5097 * lang.c (lang_init): Make -fexceptions the default.
5098 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
5099 exception handling is not turned on.
5100
5101Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
5102
5103 * lang.c (flag_new_exceptions): Make this this default.
5104 * decl.c (end_java_method): Call emit_handlers.
5105 * except.c (method_init_exceptions): Set language code and version.
5106 (expand_start_java_handler): Enable exception, and call
5107 expand_eh_region_start.
5108 (expand_end_java_handler): Enable exception, and set up catch blocks.
5109 (emit_handlers): New routine to generate the saved handlers.
5110 * java-except.h (emit_handlers): Add prototype.
5111
5112Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
5113
5114 We used to have three different representations of the constant pool:
5115 the CPool structure, the tree_constant_pool, and the constructures
5116 used to build the Class object (which may need class and string
5117 constants) in compiled code. None were appropriate for compiling
5118 to .class files, so I did a major overhaul.
5119
5120 First, the tree_constant_pool array was removed. Things were
5121 modified to the CPool structure in the JCF could be used.
5122 Second, a "capacity" field was added to the CPool, and functions
5123 written to search for a matching constant, adding one if not found.
5124 The code that generated the Class object was changed to use a CPool.
5125 The actual TREE_LISTs used to build the CONSTRUCTORs used for
5126 the static Class object are now only in build_constants_constructor.
5127 Finally, I wrote code which can generate a .class file (including its
5128 constant pool) from the RECORD_TYPE of a class. This is a big step
5129 on the way to compiling Java source into .class files.
5130
5131 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
5132 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
5133
5134 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
5135 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
5136 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
5137 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
5138 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
5139 (lang_type): Removed constant_pool field.
5140 * jcf.h (CPool): Renamed size to count. Added field capacity.
5141 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
5142 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
5143 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
5144
5145 * constants.c (current_constant_pool_tags, current_constant_pool_data,
5146 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
5147 * constants.c (build_constants_constructor): Use new outgoing_cpool.
5148 (set_constant_entry, find_constant1, find_constant2,
5149 find_class_constant, count_constant_pool_bytes, write_constant_pool,
5150 find_utf8_constant, find_class_or_string_constant): New functions.
5151
5152 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
5153 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
5154 (give_name_to_class, get_class_constant): Likewise.
5155 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
5156 (get_name_and_type_constant, get_ref_constant): Removed.
5157 * parse.h (parser_ctxt): Remove field tree_constant_pool.
5158 * parse.y: Don't save/restore tree_constant_pool.
5159 * verify.c (verify_jvm_instructions): Update for new approach.
5160 * expr.c (expand_invoke, expand_java_field_op): Likewise.
5161
5162 * lang-options.h: Added -femit-class-file, -femit-class-files.
5163 * lang.c (flag_emit_class_files), java-tree.h: New flag.
5164 (lang_f_options): Added "emit-class-file(s)".
5165
5166 * expr.c (build_java_arrayaccess): Generate more efficient array
5167 bounds checking, by using unsigned compare.
5168
5169 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
5170
5171Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5172
5173 * parse.h: New comment on the handling of unresolved type
5174 identifiers. JDEPs are now part of the jdep_code enum.
5175 (typedef struct jdep): Now use enum jdep_code or int, depending on
5176 availability. Both are narrowed down to an 8 bits bitfield.
5177 (CALL_EXPR_PRIMARY): Fixed comment.
5178
5179Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
5180
5181 * Make-lang.in (java): Added gjavac and jvgenmain.
5182 (java.start.encap): Depend on gjavac.
5183 (java.rest.encap): Depend on jvgenmain.
5184
5185 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
5186 (JAVA_CROSS_NAME): Likewise.
5187 (java.all.build): Depend on jvgenmain and gjavac.
5188 (java.all.cross): Depend on jvgenmain and gjavac-cross.
5189 (jvgenmain$(exeext)): New target.
5190 (java.install-common): Wrote.
5191 * config-lang.in (compilers, stagestuff): Added gjavac and
5192 jvgenmain.
5193
5194Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
5195
5196 * lang.c (lang_decode_option): New argc/argv interface.
5197
5198Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5199
5200 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
5201 * decl.c (build_decl_no_layout): New function.
5202 * expr.c (java_lang_expand_expr): Layout declarations found in
5203 blocks before they're pushed.
5204 * jcf-parse.c (load_class): Save current line when parsing class
5205 file.
5206 (parse_source_file): Register class before expanding their
5207 methods.
5208 * lang.c (put_decl_node): Produce `null' when `void *' is
5209 processed.
5210 * lex.c (static tree wfl_op): New static global, for error report
5211 on casts.
5212 (java_init_lex): wfl_operator and wfl_op initialized
5213 here. Filename caching added for wfl_op. Return wfl_op when `(' is
5214 parsed.
5215 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
5216 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
5217 build_unresolved_array_type): New static function definitions.
5218 (build_decl_no_layout): New extern function declared.
5219 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
5220 faulty modifier exists.
5221 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
5222 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
5223 (UNARY_PLUS_EXPR): New fake operator.
5224 (struct parser_ctxt): New field osb_number.
5225 * parse.y (static tree wfl_operator): New static WFL for operator
5226 bound error messages.
5227 (DECR_TK, INCR_TK): Moved.
5228 (OP_TK): Tagged <operator>.
5229 (array_type:): Now call build_unresolved_array_type.
5230 (dim_expr:): Count the number of '[' seen.
5231 (post_increment_expression, post_decrement_expression,
5232 pre_increment_expression, pre_decrement_expression,
5233 unary_expression_not_plus_minus, unary_expression:): Actions are
5234 now building the corresponding unary expressions.
5235 (cast_expression:): Actions are now building cast expressions.
5236 (build_unresolved_array_type): New function.
5237 (create_interface): Reset the number of declared interfaces.
5238 (create_class): Likewise.
5239 (method_header): Methods declared within the scope of an interface
5240 are now implicitly set public and abstract.
5241 (java_complete_class): Variable's and parameter's type are patched
5242 with a promoted type.
5243 (declare_local_variables): Resolved non builtin types are promoted
5244 before being used to build a variable decl. Removed type patch
5245 posted on variable initialization statement.
5246 (source_start_java_method): Use build_decl_no_layout to build the
5247 decl of a parameter of incomplete type.
5248 (java_register_parsed_class): Process interfaces too. Call
5249 rest_of_decl_compilation on each processed class declarations.
5250 (java_complete_expand_methods): Don't attempt to expand things in
5251 interfaces.
5252 (java_complete_tree): Process CONVERT_EXPR, even though it always
5253 has a type. Propagate error_mark_node to node's type too. Promote
5254 method's call argument type and return error_mark_node if
5255 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
5256 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
5257 handle unary operator nodes.
5258 (build_assignment): Added comment.
5259 (print_int_node): New function.
5260 (patch_assignment): New second argument. New error handling. Use
5261 print_int_node. Handle references. Use can_cast_to_p to issue
5262 different error message according to the context and check upon
5263 the initialization of the RHS.
5264 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
5265 (operator_string): Handle more operators.
5266 (patch_binop): No longer use a function static
5267 wfl_operator. Improved error message on shift distance.
5268 (build_unaryop, build_incdec, build_cast, patch_unaryop,
5269 patch_cast): New functions.
5270
5271Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
5272
5273 * jvspec.c: New file.
5274 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
5275
5276 * java-tree.h (identifier_subst): Add declaration.
5277
5278Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
5279
5280 * jvgenmain.c (main): Generate call to JvRunMain.
5281
5282 * class.c (make_class_data): Push value for "sync_info" field.
5283 * decl.c (init_decl_processing): Push "sync_info" field.
5284
5285Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
5286
5287 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
5288 Java (source) name, not signature.
5289 Set TYPE_ALIGN to (at least) that of element_type.
5290
5291Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
5292
5293 * class.c: Moved classname-mangling-rekated code to ...
5294 * mangle.c: ... this new file.
5295 * jvgenmain.c: New program (needs mangle.c) to generate main program.
5296 * Makefile.in: Update for above changes.
5297
5298Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5299
5300 * expr.c (truthvalue_conversion): Convert integer and floating
5301 point value to their truth value.
5302 * lex.c (java_lex): Handle the `null' literal.
5303 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
5304 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
5305 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
5306 New macros.
5307
5308 * parse.y: Reorganization/documentation on token declaration.
5309 (binop_lookup[]): New added new tree codes.
5310 (relational_expression): Build corresponding binary operators.
5311 (equality_expression, conditional_and_expression,
5312 conditional_or_expression): Likewise.
5313 (java_complete_class): Fix crash in debug message.
5314 (java_complete_tree): Check initialization of method call
5315 arguments. Further bogus node evaluation to detect more error
5316 during assignments. Handles more binary operators.
5317 (patch_assignment): Use DECL_P.
5318 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
5319 code.
5320 (operator_string): Handle more case. Compacted source.
5321 (patch_binop): Changed function comment. Checking for
5322 uninitialized first operand takes the compound assignment into
5323 account and uses DECL_P. Checking for uninitialized second operand
5324 delayed to routine's end. Use macros to issue type bound error
5325 messages and issue messages on both operands if their types are
5326 different. Force fixed type into node. Handle all binary
5327 operators.
5328
5329Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5330
5331 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
5332 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
5333 build operator node and return tokens.
5334 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
5335 * parse.h (java_complete_tree): Changed returned type in prototype.
5336 (build_method_invocation, build_assignment, patch_assignment,
5337 patch_binop): New static function declarations.
5338 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
5339 BUILD_EXPR_WFL): New macros.
5340 * parse.y (enum tree_code binop_lookup[]): New static for token to
5341 TREE_CODE lookup.
5342 (%union): Parser union has new sub-structure `operator'.
5343 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
5344 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
5345 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
5346 ASSIGN_ANY_TK): Tokens tagged `operator'.
5347 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
5348 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
5349 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
5350 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
5351 (assignment_operator:): Rule tagged `operator'.
5352 (expression_statement:): Re-installed default rule.
5353 (method_invocation:): Sub rules call build_method_invocation.
5354 (postfix_expression:): Don't attempt to resolve name here. Just
5355 return an ID.
5356 (multiplicative_expression:): Sub-rules build corresponding binop
5357 expression node.
5358 (additive_expression:, shift_expression:, and_expression:,
5359 exclusive_or_expression:, inclusive_or_expression:): Likewise.
5360 (assignment:): Sub rule invoke build_assignment.
5361 (assignment_operator:): Default rules on sub rules.
5362 (force_error): Added documentation on this variable.
5363 (declare_local_variables): Build initialization calling
5364 build_assignment.
5365 (expand_start_java_method): Removed unused rtx declaration. Mark
5366 arguments as already initialized.
5367 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
5368 (java_complete_expand_methods): Don't process next method if
5369 completion of the previous one triggered errors.
5370 (java_complete_expand_method): Call source_end_java_method if no
5371 error were found during completion.
5372 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
5373 locals declaratilon. Handle names found within a class. Return
5374 error_mark_node when things aren't found.
5375 (patch_method_invocation_stmt): Return error_mark_node on failures.
5376 (patch_invoke): Removed unused local. Return the correct node.
5377 (java_complete_tree): Now returns a value. The BLOCK section binds
5378 local identifiers and the type of a BLOCK is now void. Assign the
5379 result of operand completion on COMPOUND_EXPR. Assign the
5380 encapsulated node of a WFL to the result of its completion, except
5381 when the node is an identifier. Now handle MODIFY_EXPR and several
5382 binary operators. Return error_mark_node on errors.
5383 (build_method_invocation, build_assignment, patch_assignment,
5384 build_binop, operator_string, patch_binop): New functions.
5385 * typeck.c (binary_numeric_promotion): New function.
5386
5387Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
5388
5389 * class.c (identifier_subst): New convenience wrapper for ident_subst.
5390 Replace most uses of ident_subst by identifier_subst.
5391
5392 * class.c (push_class_static_dummy_field): Removed function.
5393 (build_class_ref): Find Class object decl by looking up "CNAME.class",
5394 instead of looking got "class" static field. Create that decl here.
5395 (class_identifier_node): Removed; no longer needed.
5396 (init_class_processing): Don't init class_identifier_node.
5397 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
5398 Do nreverse 0 times (instead of twice) for Object and Class.
5399 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
5400
5401Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
5402
5403 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
5404 while initializing linenumber_count and linenumber_table.
5405 Do it before init_function_start (which calls emit_line_note).
5406 * expr.c (expand_byte_code): Don't need to clear lineno here.
5407
5408Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
5409
5410 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
5411 then mangle number as _N_.
5412
5413 * class.c (mangle_class_field): New function.
5414 (build_class_ref): Set assembler name of class reference using
5415 mangle_class_field.
5416 (push_class_static_dummy_field): Likewise.
5417
5418Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
5419
5420 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
5421 of assigning to TREE_CODE. The latter method exploits a feature
5422 of GCC that is not ANSI compliant.
5423
5424Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5425
5426 * decl.c (pushdecl_force_head): New function.
5427 (pushlevel): Removed conditional printf.
5428 (complete_start_java_method): Don't enter local variable scope if
5429 function is compiled from source code.
5430 * expr.c: parse.h now included
5431 (java_lang_expand_expr): New function.
5432 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
5433 printf. Terminate buffer when doing directories.
5434 * jcf-parse.c (parse_source_file): Call lang_init_source before
5435 parsing and before code generation.
5436 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
5437 use printf if the macro is defined.
5438 * lang.c (lang_init): Install lang_expand_expr hook on
5439 java_lang_expand_expr.
5440 (java_dummy_print): New function.
5441 (lang_init_source): New function.
5442 * lex.c (java_lex): Remember location of an opening brace at the
5443 second nesting level.
5444 (java_is_eol): Unget character seen after a CR if it is EOF.
5445 * parse.h: Now includes lex.h
5446 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
5447 printf if the macro is defined.
5448 (expand_start_java_method, build_expr_block, enter_block,
5449 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
5450 New static function declarations.
5451 (pushdecl_force_head): New extern function declaration.
5452 (INCOMPLETE_TYPE_P): New macro.
5453 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
5454 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
5455 BLOCK_EXPR_ORIGIN): New macros.
5456 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
5457 DECL_SOURCE_LINE_LAST): New macros.
5458 (struct parser_ctxt): Removed field current_method_decl, redundant
5459 with the field current_function_decl. Added fields
5460 first_ccb_indent1 and pending_block.
5461 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
5462 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
5463 tagged <node>
5464 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
5465 (compilation_unit:): Cosmetic on sub rule.
5466 (type_declaration:): Cosmetic on sub rules. Added an error rule.
5467 (variable_initializer:): Installed default rule on expression:.
5468 (method_declaration:): method_header: starts a new
5469 method. method_body: installs the function body, absorbs blocks
5470 emitted for temporary variable scopings, pops function's body block
5471 and merges function's last statement lineno in DECL_SOURCE_LINE.
5472 (method_body:): Installed default rules.
5473 (block:): Call enter_block when an opening brace is seen. Absorb
5474 scoping blocks and call exit_block when a closing brace is seen.
5475 (block_statement:): Cosmetic changes.
5476 (method_invocation:): Create WFL around CALL_EXPR node.
5477 (patch_stage): Added comment around definition.
5478 (method_header): Try to use first_ccb_indent1 as the first line of
5479 the method, so BP debug info are emitted at the first opening
5480 brace of the function. If the function has no body, use the
5481 location of the function's name. Override currently defined method
5482 name with the matching WFL so we can point redefinition errors
5483 using the location where the function's name was declared.
5484 (check_abstract_method_header): Interprets DECL_NAME as an
5485 identifier or as a WFL, accordingly.
5486 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
5487 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
5488 location and name information out of it and reinstall DECL_NAME to
5489 its original identifier node value.
5490 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
5491 function's source code).
5492 (read_import_dir): Test the value returned by find_class and issue
5493 a fatal accordingly.
5494 (declare_local_variables): Push a new block for the scope of the
5495 new variable(s) if code has been already generated at that nesting
5496 level. Pinpoint redefinition errors using the variable id
5497 WFLs. Generate initialization code if necessary. If the variable
5498 type is incomplete, register a patch on its decl.
5499 (source_start_java_method): Rewritten. Define a new block for the
5500 function's parameters. Build parameter decl out of function's
5501 arguments and register them for a patch if their types are
5502 incomplete.
5503 (expand_start_java_method): Includes the part of
5504 source_start_java_method that was pushing the parameter decls and
5505 completing the method start code.
5506 (source_end_java_method): Removed call the expand_end_bindings and
5507 poplevel (already taken care of). Reinstall function's arguments
5508 and get function's last line of code before calling
5509 expand_function_end.
5510 (java_method_add_stmt): New comment before the function's
5511 code. Complement the second operand of the current COMPOUND_EXPR
5512 if necessary.
5513 (java_complete_expand_methods): Don't generate debug info on line
5514 zero when expanding a generated constructor.
5515 (java_complete_expand_method): Set start and end line numbers for
5516 a artificially generated constructor to one and manually call
5517 enter_block and exit_block when defining it. For all methods:
5518 expand function's start calling the new expand_start_java_method
5519 and invoke java_complete_tree on the effective method's body, if
5520 any.
5521 (resolve_expression_name): Now use lookup_name_in_blocks to search
5522 local variable decls and print out an error when variables are
5523 undefined.
5524 (patch_method_invocation_stmt): Inserted comment before the
5525 function's code.
5526 (lookup_method_invoke): Chain method's arguments using chainon
5527 with the current arg list as a second argument. Inserted missing
5528 IDENTIFIER_POINTER when reporting an error on methods not found.
5529 (refine_accessible_methods_list): Don't retain constructors.
5530 (patch_arguments): Function removed.
5531 (java_complete_tree): Inserted comment before the function's
5532 code. New case for BLOCKs. Moved the WFL case a bit
5533 further. Complete function's arguments.
5534 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
5535 maybe_absorb_scoping_blocks): New functions.
5536
5537Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5538
5539 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
5540 previously set.
5541 * jcf-parse.c (parse_source_file, java_error_count): New forward
5542 and extern declarations.
5543 (java_parse_abort_on_error): Macro moved.
5544 (jcf_parse_source): fatal called if fopen fails. Now calls
5545 parse_source_file.
5546 (parse_source_file): New parse_only parameter. Reflects the
5547 elimination of the second pass.
5548 (yyparse): parse_source_file called with argument set to 0.
5549 * jcf.h (JCF_ZERO): Sets java_source to zero.
5550 * lex.c (java_init_lex): pass argument is gone. Function modified
5551 to be called once during the analysis of a file.
5552 (java_unget_unicode): Fixed typo in fatal message.
5553 (java_get_line_col): Likewise.
5554 (java_lval): Likewise. String literals no longer built during
5555 second pass.
5556 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
5557 account.
5558 * parse.h (MODIFIER_WFL): New macro.
5559 (parse_check_super, parser_check_super_interface): Now return int.
5560 (parser_chain_incomplete_item, not_builtin_p,
5561 complete_method_decl): Declarations removed.
5562 (build_method_invocation_stmt, build_invoke): Renamed using the
5563 `patch' instead of `build'
5564 (register-incomplete_type, obtain_incomplete_type,
5565 java_complete_tree, java_complete_expand_method,
5566 unresolved_type_p, create_jdep_list): New function declarations.
5567 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
5568 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
5569 (jdep): New typedef on new struct _jdep.
5570 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
5571 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
5572 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
5573 JDEP_RESOLVED_P): New macros.
5574 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
5575 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
5576 JDEP_VARIABLE): New enum values and jdep kinds.
5577 (jdeplist): New typedef on struct _jdeplist.
5578 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
5579 macros.
5580 (CALL_EXPR_PRIMARY): New macro.
5581 (struct parser_ctxt): Fields java_pass, current_method_decl,
5582 method_decl_list deleted. New field jdeplist.
5583 (INCOMPLETE_P): Macro deleted.
5584 * parse.y (single_type_import_declaration:): Removed pass switch.
5585 (type_import_on_demand_declaration): Likewise.
5586 (field_declaration:): Removed pass switch on all sub rules.
5587 (class_declaration:): Call the complete_class_decl removed on
5588 class_body rules.
5589 (method_declaration:): Removed second pass switch. No longer chain
5590 methods decl when method_header reduced.
5591 (method_header:): Sub rules no longer depend on pass switch.
5592 (method_declarator:): Likewise.
5593 (method_body:): Likewise.
5594 (abstract_method_declaration:): Likewise.
5595 (block_statement:): Likewise.
5596 (local_variable_declaration:): Likewise.
5597 (argument_list:): Likewise.
5598 (method_invocation:): Likewise. Call to build_method_invocation_stmt
5599 removed. Partial CLASS_EXPR tree node built instead.
5600 (postfix_expression:): Removed pass switch on all sub rules.
5601 (java_pop_parser_context): Free classd_list content.
5602 (yyerror): Call obstrack_grow0 to finalize error message.
5603 (check_class_interface_creation): Comment modified to reflect new
5604 returned value meaning. Removed second pass switch. Return 1 if an
5605 error was found, 0 otherwise. Adjust pointer on filename if a
5606 leading path separator was found.
5607 (maybe_create_class_interface_decl): Removed first pass switch
5608 when linking the class decl to the class_list. Install a new
5609 jdep_list for the class.
5610 (add_superinterfaces): List of unresolved interfaces is
5611 gone. Unresolved interfaces are directly added to the current
5612 dependencies list.
5613 (create_interface): Second pass shortcut removed.
5614 ctpx->modifier_ctx access through MODIFIER_WFL.
5615 (create_class): Second pass shortcut removed. Call to
5616 register_incomplete_type replaces the call to
5617 parser_chain_incomplete_item.
5618 (complete_class_decl): Function removed.
5619 (duplicate_declaration_error): New way of retrieving redeclared
5620 item type.
5621 (register_fields): Call to lookup_modifier_cl replaced by
5622 MODIFIER_WFL. New way of handling unresolved type, using
5623 unresolved_type_p and obtain_incomplete_type.
5624 register_incomplete_type replaces call to parser_chain_incomplete_item.
5625 (patch_stage): New static global variable.
5626 (method_header): New way of handling unresolved type, using
5627 unresolved_type_p and obtain_incomplete_type. patch_stage used to
5628 indicates that the method decl needs to be patched.
5629 (check_abstract_method_header): Call to lookup_modifier_cl
5630 replaced by MODIFIER_WFL.
5631 (method_declarator): Incomplete argument type are registered
5632 calling register_incomplete_type. Patch on the declared method is
5633 issued in that case.
5634 (unresolved_type_p): New function.
5635 (parser_check_super_interface): New comment to reflect function's
5636 modified returned type (int). Function and has a new argument
5637 this_wfl. Call to parse_error_context uses this_wfl instead of
5638 relying on lookup_cl.
5639 (parser_check_super): Comment reflects function's new returned
5640 type (int). Function returns non zero value on error.
5641 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
5642 register_incomplete_type, jdep_resolve_class): New functions to
5643 handle incomplete types in declarations.
5644 (java_complete_class): Rewritten to work with the new incomplete
5645 type handling scheme.
5646 (complete_class_report_errors): Likewise.
5647 (complete_method_decl): Removed: it jobs is now handled by
5648 java_complete_class.
5649 (do_resolve_class): Class loaded in not already loaded and not
5650 found in Java source code.
5651 (java_check_regular_methods, java_check_abstract_methods): Don't
5652 call complete_method_decl anymore.
5653 (lookup_modifier_cl, not_builtin_p): Functions deleted.
5654 (read_import_dir): Got rid of the pass number dependency.
5655 (declare_local_variables): New handling of unresolved types (patch
5656 issued).
5657 (source_start_java_method): New parameter level. Function called
5658 with level set to 1 when argument types are potentially
5659 unresolved. Called to complete the job with level set to 2 once
5660 types are complete.
5661 (source_end_java_method): Call to permanent_allocation
5662 removed. Waiting to be replaced by a more suitable obstack
5663 management.
5664 (java_complete_expand_methods, java_complete_expand_method,
5665 java_expand_finals): New functions.
5666 (build_method_invocation_stmt): Renamed
5667 patch_method_invocation_stmt. Extracts function call expression
5668 (wfl) and arguments (args) from CALL_EXPR tree operands.
5669 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
5670 call. Patch the function and argument operand of the CALL_EXPR
5671 tree argument.
5672 (patch_argument, java_complete_tree): New functions.
5673
5674Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
5675
5676 Recover from missing fields and methods (i.e. error instead of fatal).
5677 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
5678 * expr.c (expand_invoke): Recover from missing method.
5679 (expand_java_field_op): Recover from missing field.
5680 Inline references to java.lang.{Integer,Char,...}.TYPE.
5681 * typeck.c (get_type_from_signature), java-tree.h: New function.
5682 * class.c (add_method): Use get_type_from_signature.
5683 (build_class_ref): Handle a class that was not found.
5684 * typeck.c (convert): Handle conversion to pointers (for convenience).
5685 * verify.c (verify_jvm_instructions): Use get_type_from_signature
5686 instead of lookup_field to handle missing fields.
5687
5688 * jcf-parse.c (process_zip_dir): Set java_source.
5689
56901998-04-20 Brendan Kehoe <brendan@cygnus.com>
5691
5692 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
5693
5694Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5695
5696 * jcf-parse.c (load_class): Don't change input_filename before
5697 calling jcf_parse_source (but still do it before calling
5698 jcf_parse).
5699 (jcf_parse_source): Assign input_filename after having saved the
5700 parser context.
5701 * lex.c (java_init_lex): Chain a WFL node to the import on demand
5702 list. ctxp->modifier_ctx zeroed according to its new
5703 definition. ctxp->filename initialized. Removed
5704 JAVA_MODIFIER_CTX_UNMARK.
5705 (java_unget_unicode): Update the character based column position.
5706 (java_allocate_new_line): ref_count not used anymore. Always free
5707 ctxp->p_line. Initialize c_line->char_col to 0.
5708 (java_get_unicode): Update the character based column position.
5709 (java_lex): Use ctxp->elc to store current position in source
5710 file, at the beginning of the parsed token. Set modifier_ctx entry
5711 corresponding to the parse modifier to a WFL node. Return a WFL
5712 node when an identifier is parsed.
5713 (java_lex_error): Now uses ctxp->elc to store current position in
5714 source.
5715 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
5716 * lex.h (build_wfl_node): New function definitions.
5717 (struct java_line): ref_count and next fields are gone. New field
5718 char_col.
5719 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
5720 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
5721 (JAVA_COLUMN_DELTA): New macro.
5722 (java_lc): New typedef on new struct _java_lc.
5723 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
5724 (parse_error_context, parse_warning_context): Changed prototypes.
5725 (java_get_line_col): Added as an available global function.
5726 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
5727 (IC_DECL): Replaced by macro IC_TYPE
5728 (DEPEND_WFL): New macro.
5729 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
5730 wrong modifier.
5731 (exit_java_complete_class): Removed a commented out statement.
5732 (struct parser_ctxt): Added comments on fields. modifier_ctx is
5733 now an array of tree nodes. Deleted fields line_list and
5734 e_line. New field elc, to replace e_line.
5735 * parse.y (array_type:): Build WFL node.
5736 (qualified_name:): Build a single WFL node out of two. Retain
5737 the location information of the first node in the resulting node.
5738 (package_declaration:): Use package name as a WFL node
5739 (single_type_import_declaration:): Use imported name as a WFL node.
5740 (type_import_on_demand_declaration:): Use root of the imported
5741 packages as a WFL node.
5742 (field_declaration:): Removed unused local variable cl.
5743 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
5744 (yyerror): New static elc. Removed static error_line, error_pos.
5745 New local code_from_source. Save ctxp->elc into elc at the first
5746 pass. Call java_get_line_col to get a string of the line where
5747 the error occured.
5748 (debug_line): Removed static function.
5749 (parse_error_context, parse_warning_context): Parameter cl is now
5750 a WFL node. Use its value to initialize ctxp->elc.
5751 (redefinition_error): Parameter cl is now a WFL node.
5752 (parse_add_interface): New parameter wfl. No longer call
5753 lookup_cl, use wfl instead.
5754 (check_class_interface_creation): Parameter cl is now a WFL node.
5755 (maybe_create_class_interface_decl): Likewise.
5756 (add_superinterfaces): New function.
5757 (create_interface): Removed local cl, node, super_decl,
5758 super_decl_type. Function now uses id as a WFL node. Better
5759 warning/error report on obsolete or forbidden mix of
5760 modifiers. Now calls add_superinterfaces to register interfaces.
5761 (create_class): Removed local cl, node. Local variable id is used
5762 as a WFL node. Better error report on forbidden modifier
5763 mix. Uses add_superinterfaces to register interfaces.
5764 (find_field): Argument cl is now a WFL node. Now store the WFL
5765 node of a fields that needs to be checked for their
5766 initialization.
5767 (method_header): Local variable node non longer used. Local
5768 variable id replaces cl.
5769 (check_modifiers_consistency): Local variable cl is now a WFL
5770 node.
5771 (method_declarator): Local variable cl replaced by parameter id.
5772 (parser_qualified_name): Now uses parameter name as a WFL node.
5773 (parser_check_super_interface): New parameter wfl, for achieve
5774 greater accuracy during error reports.
5775 (parser_chain_incomplete_item): New parameter named location. Used,
5776 along the decl, to construct the incomplete item node.
5777 (java_complete_class): resolve_class now uses WFL node extracted
5778 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
5779 where appropriate.
5780 (complete_method_decl): Unresolved function's argument types are WFL.
5781 (resolve_class): Parameter cl is now a WFL node.
5782 (resolve_and_layout): Likewise.
5783 (do_resolve_class): Likewise. Try first to use cl and then do the
5784 lookup on the decl when calling check_pkg_class_access.
5785 (complete_class_report_errors): Use IC_TYPE in place of
5786 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
5787 instead of doing a lookup over the decl.
5788 (java_check_final): Use WFL info from field tree list.
5789 (lookup_cl): Rewritten and returns a statically defined WFL node.
5790 (lookup_modifier_cl): Now uses information from WFL nodes.
5791 (process_imports): Likewise.
5792 (read_import_dir): name and cl arguments replaced by a single WFL
5793 node. Function modified accordingly.
5794 (find_in_imports_on_demand): Now uses WFL node.
5795 (check_pkg_class_access): cl argument is now a WFL node.
5796 (declare_local_variables): Fixed to use WFL nodes.
5797 (resolve_expression_name): Likewise.
5798 (build_method_invocation_stmt): name_combo argument renamed
5799 wfl. Function modified to use WFL nodes.
5800 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
5801 (lookup_method_invoke): cl is now a WFL node. Added missing
5802 IDENTIFIER_POINTER to class type decl name.
5803
5804Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
5805
5806 * lang.c (init_parse): Now returns char* containing the filename.
5807
5808Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
5809
5810 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
5811
5812 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
5813 * class.c (make_class_data): If flag_assume_compiled, initial class
5814 state is CSTATE_PREPARED; make superclass and interfaces direct
5815 references, rather than constant pool indexes.
5816
5817Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5818
5819 * parser.y: Include flags.h. Removed debug variable pl.
5820 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
5821 (block:): Likewise.
5822 (labeled_statement_nsi:): Generate debug info when reducing
5823 expression_statement:.
5824 (check_pkg_class_access): get_access_flags_from_decl invokation
5825 fixed for new CLASS_* flags location.
5826 (source_end_java_method): Save/restore parser context when
5827 entering/leaving this routine. Restore lineno to its right value
5828 before calling expand_end_bindings.
5829 (build_method_invocation_stmt): build_invoke called with the
5830 current line information.
5831 (build_invoke): New argument cl. Wrap the function call around a
5832 wfl node.
5833 (refine_accessible_methods_list): Changed comment, removed
5834 unnecessary code.
5835 * parse.h: Fixed typo in comments.
5836 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
5837 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
5838 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
5839 parser_ccb_indent.
5840 * lex.c (java_lex): Record the last closing curly bracket of a
5841 function.
5842 * jcf-parse.c (jcf_parse_source): Now calls
5843 java_check_methods. Clarified comment, fixed typo.
5844
58451998-04-09 Dave Brolley <brolley@cygnus.com>
5846
5847 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
5848 (finish_parse): Expose for non USE_CPPLIB builds.
5849
5850Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
5851
5852 * lang.c (lang_print_xnode): New function.
5853
5854Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
5855
5856 * decl.c (class_dtable_decl), java-tree.h: New tree node.
5857 * class.c (get_dispatch_vector, get_dispatch_table): New functions
5858 used to build a class's dispatch table.
5859 (make_class_data): Generate dispatch table if flag_assume_compiled.
5860 Set dtable of class object to address of class_dtable_decl.
5861
5862 * decl.c (int_decl_processing): Make soft_badarrayindex_node
5863 be volatile and have side effects - generates better code.
5864
5865 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
5866 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
5867
5868 * expr.c (expand_invoke): If class is final, method is
5869 effectively final, so can call it directly.
5870
5871 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
5872
5873 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
5874
5875Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5876
5877 * parse.y (build_method_invocation_stmt): Removed extra argument
5878 to build_invoke.
5879
5880Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5881
5882 * expr.c (dtable_indent): Now static global.
5883 (expand_invoke): Now call invoke_build_dtable and
5884 build_invokevirtual.
5885 (invoke_build_dtable, build_invokevirtual): New functions.
5886 * jcf-io.c (find_class): Defer issuing a warning by setting
5887 jcf->outofsynch to 1.
5888 * jcf-parse.c (jcf_out_of_synch): New function.
5889 (load_class): Test this_jcf.outofsynch flag and call
5890 jcf_out_of_synch accordingly.
5891 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
5892 comment indentation.
5893 * lex.c (java_get_unicode): Fixed code indentation.
5894 (java_lex): Create string literal. Fixed typo. Removed several
5895 premature obstack_free.
5896 * parse.h: New enums for name resolution and invocation mode.
5897 (struct qualification): New data structure.
5898 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
5899 (do_resolve_class, build_method_invocation_stmt,
5900 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
5901 debug_line, identical_subpath_p, invocation_mode,
5902 refine_accessible_methods_list, build_invoke,
5903 lookup_method_invoke): New functions declared.
5904 (build_invokevirtual, invoke_build_dtable, match_java_method,
5905 build_field_ref, jcf_out_of_synch): New references to external
5906 functions.
5907 (struct parse_ctxt): Removed artificial_constructor field.
5908 * parse.y: (array_type:): Type defined for this rule.
5909 (class_type:): Installed default rule for interface_type:.
5910 (array_type:): Now build Java array type.
5911 (qualified_name:): Now use obstack_grow0.
5912 (method_declaration:): Skip the artificial constructor added to
5913 the list, if any.
5914 (abstract_method_declaration:): Execute the code only during pass 1.
5915 (block:): Installed default rule in block_statements:.
5916 (block_statement:): Add the statement to the method during pass 2.
5917 (statement_expression): Installed default rule for
5918 method_invocation:.
5919 (argument_list:): Added code to build the argument list.
5920 (method_invocation:): Added call to create the method invocation
5921 node.
5922 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
5923 (debug_line): New function for debug.
5924 (complete_class_decl): No longer do something during pass 1.
5925 (method_header): Use BUILD_PTR_FROM_NAME.
5926 (parser_qualified_classname): Use obstack_grow0. Removed bogus
5927 obstack_free.
5928 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
5929 function's main comment.
5930 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
5931 classes.
5932 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
5933 (resolve_class): Now works with arrays.
5934 (do_resolve_class, resolve_and_layout): New functions.
5935 (java_check_regular_methods): Reverse method list before and after
5936 having processed it. No longer set ctxp->artificial_constructor.
5937 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
5938 accordingly. Fixed typo in issued error message. Now use
5939 obstack_grow0.
5940 (find_in_imports_on_demand): Now use obstack_grow0.
5941 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
5942 (source_end_java_method): Call expand_expr_stmt instead of
5943 expand_expr. Calls it before calling expand_function_end.
5944 (java_method_add_stmt): Do nothing if errors were found during
5945 parsing.
5946 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
5947 (build_method_invocation_stmt, build_invoke, invocation_mode,
5948 lookup_method_invoke, refine_accessible_methods_list,
5949 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
5950 New functions.
5951 * typeck.c (build_java_signature): Properly end method signature
5952 if return type skipped.
5953 (match_java_method): New function.
5954
5955Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
5956
5957 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
5958
5959Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5960
5961 * expr.c (build_invoke_non_interface): New function.
5962 (methods_ident, ncode_ident): Now static globals.
5963 (expand_invoke): Use build_invoke_non_interface.
5964 * java-tree.h (struct lang_decl): New field function_decl_body.
5965 (DECL_FUNCTION_BODY): New macro.
5966 * jcf-parse.c (jcf_parse_source): Deeper check before setting
5967 CLASS_FROM_SOURCE_P.
5968 (parse_source_file): Fixed typos. Call java_layout_parsed_class
5969 before starting pass 2. Call to java_generate_parsed_class replaced
5970 by java_register_parsed_class.
5971 * lex.c: Fixed typo in header. Some line width related formating.
5972 * lex.h: Some line width related formating.
5973 * parse.h (source_end_java_method, resolve_expression_name,
5974 complete_class_decl, maybe_create_class_interface_decl,
5975 check_class_interface_creation): New static function declarations.
5976 (java_layout_parsed_class, java_method_add_stmt): New function
5977 declarations.
5978 (struct parser_ctxt): Field mark_class_generate removed. New
5979 fields class_list and artificial_constructor.
5980 * parse.y: Fixed typo in header.
5981 (class_declaration:): Call complete_class_decl when class body
5982 parsed.
5983 (method_declaration:): Call source_end_java_method in pass 2 when
5984 the method body is defined.
5985 (postfix_expression:): Do expression name resolution on sub-rule
5986 name during pass 2.
5987 (create_class, create_interface): Merged common pieces.
5988 (check_class_interface_creation, maybe_create_class_interface_decl):
5989 New functions.
5990 (complete_class_decl): New function.
5991 (register_fields): Fixed line width related typo.
5992 (method_header): Correctly skip first argument when fixing
5993 argument line. Changed the loop.
5994 (java_check_circular_reference): Now use ctxp->class_list.
5995 (java_complete_class): Removed start/stop marking.
5996 (java_check_regular_methods): Now takes a class decl as an
5997 argument. Add default constructor if none were encountered.
5998 (java_check_methods): Now use ctxp->class_list. Changed call to
5999 java_check_regular_methods.
6000 (source_start_java_method): Set DECL_ARG_TYPE for each function
6001 arguments.
6002 (source_end_java_method, java_method_add_stmt): New functions.
6003 (java_generate_parsed_class): No longer exists.
6004 (java_layout_parsed_class, java_register_parsed_class): New functions.
6005 (resolve_expression_name): New function.
6006
6007Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6008
6009 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
6010 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
6011 until pass initializations are done. Call read_import_dir with
6012 pass set to 0.
6013 * parse.h: (lookup_modifier_cl): New function declared.
6014 (INTERFACE_FIELD_MODIFIERS): New macro.
6015 (OBSOLETE_MODIFIER_WARNING): New macro.
6016 * parse.y: (register_fields): Class type and current field name in
6017 local variables. Check modifier(s) if adding field(s) to an interface.
6018 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
6019 and report errors using the faulty modifier line context.
6020 (lookup_modifier_cl): New function.
6021 (read_import_dir): Detect and report default import processing
6022 failure.
6023
60241998-02-11 Brendan Kehoe <brendan@cygnus.com>
6025
6026 Add a pair of -fassume-compiled/-fno-assume-compiled options.
6027 * class.c (is_compiled_class): Return 1 after making sure it
6028 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
6029 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
6030 * java-tree.h (flag_assume_compiled): Add decl.
6031 * lang.c (lang_f_options): Add the flag.
6032 (flag_assume_compiled): Add decl, default to 0.
6033
6034Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6035
6036 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
6037 (is_compiled_class): Likewise.
6038 (layout_class): Likewise.
6039 (layout_class): Detect and lay out classes defined in source code.
6040 (interface_of_p, add_interface_do, may_add_interface): New
6041 function.
6042 (add_interface): Now use add_interface_do.
6043 (add_method_1): New function.
6044 (add_method): Now use add_method_1.
6045 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
6046 (complete_start_java_method): New function.
6047 (start_java_mehod): Now call complete_start_java_method.
6048 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
6049 (expand_invoke): Likewise and fixed typo.
6050 *gjava.c: (print_super_field): Use new argument to find_class
6051 DO_CLASS_FILE.
6052 (main): Likewise.
6053 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
6054 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
6055 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
6056 IDENTIFIER_NODE.
6057 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
6058 (add_method_1, push_class): New prototypes.
6059 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
6060 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
6061 directory where the class was found.
6062 (find_class): New argument DO_CLASS_FILE. Function find_class
6063 modified accordingly.
6064 *jcf-parse.c: (fix_class_path): New function.
6065 (load_class): Use new VERBOSE argument. load_class now finds and
6066 loads/parses .class/.java files. Save read_state of current_jcf
6067 if necessary.
6068 (java_parser_abort_on_error): New macro.
6069 (jcf_parse_source, parse_source_file): New function.
6070 (jcf_parse): Fixed typo.
6071 (yyparse): Call parse_source_file () only.
6072 (process_zip_dir): Fixed typo, fix zdir->filename_length when
6073 writing the real class name back in the zip directory entry.
6074 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
6075 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
6076 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
6077 (find_class): Prototype fixed.
6078 *lex.c: Added 1998 time stamp.
6079 Removed all static global variables, moved into the parser
6080 context data structure.. Now include unistd.h if SEEK_SET not
6081 defined.
6082 (java_init_lex): Rewritten.
6083 (java_sneak_unicode): Modified current unicode access in current line.
6084 (java_unget_unicode): Likewise.
6085 (java_allocate_new_line): New allocation management.
6086 (java_read_char): Modified access and storage of unget_utf8_value.
6087 New way of processing current unicode.
6088 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
6089 (java_get_unicode): Now use the parser context.
6090 (java_lineterminator): Likewise.
6091 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
6092 of the reentrant parser implementation. Function now use the
6093 parser context data structure and java_lval. Fixed production of
6094 the float and double constant "out of range" error message. Fixed
6095 obstack use. Return integer value when hitting a modifier. Now
6096 return type for TRUE, FALSE and other predefined types. Return
6097 identifier as a TREE_LIST list containing the current line context
6098 as the TREE_VALUE sub-node.
6099 (java_unicode_2_utf8): Fixed typo in declaration.
6100 (java_lex_error): Now use the parser context data structure.
6101 *lex.h: Added 1998 time stamp.
6102 (struct java_line): New fields ref_count and next.
6103 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
6104 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
6105 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
6106 *parse.h: Added 1998 time stamp.
6107 (java_parse_source_file): Renamed from parse_source_file.
6108 (YYERROR_NOW, YYNOT_TWICE): Fixed.
6109 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
6110 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
6111 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
6112 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
6113 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
6114 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
6115 (struct parser_ctxt): New data structure to keep the parser context.
6116 *parse.y: Added 1998 time stamp, got rid of static global variables.
6117 (java_error_count, ctxp): New global variables.
6118 (%union): New value field.
6119 (numeric_type, integral_type): Rules removed.
6120 (primitive_type): Rule defined to handle integral, float, double and
6121 boolean types.
6122 (qualified_name, package_declaration,
6123 single_type_import_declaration, type_import_on_demand_declaration,
6124 modifiers, class_declaration, super, interfaces,
6125 interface_type_list, class_body, field_declaration,
6126 field_declaration, variable_declarators, variable_declarator,
6127 variable_declarator_id, method_declaration, method_header,
6128 formal_parameter_list, formal_parameter, method_body, block,
6129 static, interface_declaration, extends_interfaces,
6130 abstract_method_declaration, local_variable_declarators): Rules now
6131 define actions.
6132 (force_error, do_warning): New global statics.
6133 (push_parser_context, parser_context_save_global,
6134 parser_context_restore_global, pop_parser_context): New functions.
6135 (yyerror): Now uses the global parser context. Fixed use of obstack.
6136 (parse_error, parse_error_context, parse_warning_context,
6137 java_accstring_lookup, redefinition_error, check_modifiers,
6138 parser_add_interface, create_interface, create_class, find_field,
6139 duplicate_declaration_error, register_fields, method_header,
6140 check_modifiers_consistency, check_abstract_method_header,
6141 method_declarator, parser_qualified_classname,
6142 parser_check_super_interface, parser_check_super,
6143 parser_chain_incomplete_item, java_check_circular_reference,
6144 layout_class_from_source, java_complete_class,
6145 complete_method_decl, resolve_class, complete_class_report_errors,
6146 java_check_final, check_method_redefinition,
6147 java_check_regular_methods, java_check_abstract_methods,
6148 java_check_methods, lookup_java_interface_method2,
6149 lookup_java_method2, lookup_cl, find_name_in_single_imports,
6150 process_imports, find_in_imports, read_import_entry,
6151 read_import_dir, find_in_imports_on_demand,
6152 check_pkg_class_access, not_builtin_p, declare_local_variables,
6153 source_start_java_method, java_generate_parsed_class): New
6154 functions.
6155 *typeck.c: (signature_include_return): New global variable.
6156 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
6157 to add the function returned type in the signature.
6158
61591998-02-09 Brendan Kehoe <brendan@cygnus.com>
6160
6161 * jcf-io.c (open_in_zip): Use strncmp and LEN.
6162
6163Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
6164
6165 * Make-lang.in (java.info): Added.
6166 (java.install-info): Added
6167
61681998-01-27 Brendan Kehoe <brendan@cygnus.com>
6169
6170 * Makefile.in (clean): Also remove java/parse.c.
6171
61721998-01-26 Brendan Kehoe <brendan@cygnus.com>
6173
6174 Add a pair of -fbounds-check/-fno-bounds-check options.
6175 * lang.c (lang_decode_option): Add code to grok arguments.
6176 (flag_bounds_check): Add decl.
6177 (lang_f_options): New array w/ the option in it.
6178 * java-tree.h (flag_bounds_check): Add decl.
6179 * lang-options.h: New file.
6180 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
6181 of a static macro value.
6182 (JAVA_ARRAY_EXCEPTION): Delete macro.
6183
6184Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
6185
6186 * typeck.c (build_java_array_type): Fix two bugs in previous change.
6187 * expr.c (build_anewarray): Add missing promote_type.
6188
6189Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
6190
6191 Add array types with known length to optimize bounds checking.
6192 * typeck.c (build_java_array_type): Take length parameter.
6193 (java_array_type_length, build_prim_array_type): New functions.
6194 * java-tree.h: Update for new functions.
6195 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
6196 * class.c: Use build_prim_array_type.
6197 * expr.c (can_widen_reference_to): Handle known-length array types.
6198 (verify_jvm_instructions): Keep track of integer push instructions
6199 followed by newarray/anewarray, so we can build known-length arrays.
6200 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
6201 (java_array_data_offset): New function.
6202 (build_java_array_length_access): New function. Optimize if constant.
6203 (build_java_arrayaccess): Constant fold bounds check.
6204 (expand_java_newarray, expand_java_anewarray): Replaced by ...
6205 (build_newarray, build_anewarray): New functions.
6206 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
6207 * verify.c (merge_types): Handle known-lengh array types.
6208
6209Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
6210
6211 * expr.c (expand_byte_code): Fix performace bug, which caused
6212 searching linenumber_table to be linear rather than constant.
6213
6214Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
6215
6216 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
6217
6218 * decl.c, java-tree.h (soft_fmod_node): New global.
6219 * decl.c (init_decl_processing): Define __builtin_fmod.
6220 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
6221 using __builtin_fmod.
6222
6223Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6224
6225 * keyword.h: New file, output of keyword.gperf as processed by
6226 gperf.
6227 * lex.c (java_lex_init): Initialize java_error_flag.
6228 * parse.c (YYERROR_NOW): Uses java_error_flag.
6229 * parse.y: New static java_error_flag. Useless definition of
6230 buffer_error gone.
6231 * parse.y (java_error): Portable error recovery using
6232 java_error_flag (not yet completely tuned).
6233
62341997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
6235
6236 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
6237
6238Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6239
6240 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
6241 (parse.c, lex.c, keyword.h): New rules for Java source code
6242 front-end.
6243 * parse.c: Renamed into jcf-parse.c.
6244 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
6245 * keyword.gperf: New file, Java keywords.
6246 * parse.y: New file, Java language grammar.
6247 * parse.h: New file, Java language grammar definitions.
6248 * lex.c: New file, Java language lexer.
6249 * lex.h: New file, Java language lexer definitions.
6250
6251Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
6252
6253 * decl.c (clinit_identifier_node), java-tree.h: New global.
6254 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
6255 * verify.c (verify_jvm_instructions): Inline use of removed macros.
6256 * expr.c (expand_java_field_op): Check for invalid assignment
6257 to final field.
6258
6259 * jcf-reader.c (get_attribute): Test for wrong attribute length.
6260
6261Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
6262
6263 * verify.c (verify_jvm_instructions): When processing a handler,
6264 attempt to set the current_subr to the right value.
6265 (More complicated code combines Sep 17 and Oct 22 versions.)
6266
6267Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
6268
6269 * class.c (push_class): Figure out (guess) name of source file.
6270 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
6271 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
6272 (parse_class_file): Change return type from int to void.
6273 Call debug_start_source_file/debug_end_source_file.
6274
6275 * expr.c (build_java_binop): Fix masking 2nd operand.
6276 * decl.c (init_decl_processing): Set sizetype first.
6277
6278Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
6279
6280 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
6281 (Revert Sep 17 change.)
6282
6283Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6284
6285 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
6286 .class extension in their name and fix thing so we don't process
6287 them parse_zip_file_entries().
6288 (parse_zip_file_entries): Cleaned unused local variables.
6289
6290Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
6291
6292 * expr.c (can_widen_reference_to): Allows equal array element types.
6293 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
6294 * jcf-dump.c (RET): Get (and print) index.
6295
6296 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
6297 Promote element type to POINTER_TYPE.
6298
6299Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6300
6301 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
6302 find_in_current_zip, jcf_figure_file_type): Moved from
6303 jcf-reader.c to parse.c.
6304 * zextract.c: (read_zip_archive): takes file_comment_length possible
6305 field into account.
6306
6307Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
6308
6309 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
6310
6311 * verify.c (merge_types): Handle array types even better ...
6312
6313Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
6314
6315 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
6316
6317 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
6318 * class.c (make_class_data): Don't build fields_decl if no fields.
6319 When building fields_decl, skip if DECL_ARTIFICAL.
6320
6321 * expr.c (java_stack_swap): Update stack_type_map.
6322 * verify.c (merge_types): Handle array types better.
6323
6324Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
6325
6326 * class.c (add_field): Don't promote short integral fields to
6327 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
6328 * expr.c (push_value): Promote and convert short integral values.
6329
6330 * decl.c, java-tree.h (integer_two_node): New constant node.
6331 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
6332
6333Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6334
6335 * class.c (append_gpp_mangled_type): Use function argument
6336 unpromoted type to generate mangled name.
6337
6338Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6339
6340 * constants.c (build_constant_data_ref): Now uses current_class
6341 instead of main_class.
6342 (build_constants_constructor): Now uses current_class instead of
6343 main_class.
6344 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
6345 of the global variable SeepZipFiles done here.
6346 * zextract.c (read_zip_archive): extra_field optional field taken
6347 into account while computing the position of the class file in the
6348 archive.
6349 * verify.c (verify_jvm_instructions): Use current_jcf to search
6350 the constant pool.
6351 * parse.c (load_class): First search for the class to load in the
6352 current zip file. Saves current_jcf (restored before returning
6353 from that function). Don't call JCF_FINISH in the class was found
6354 in the current ZIP file.
6355 (jcf_parse): If the class was found in the current ZIP file, save
6356 its tree_constant_pool (for later reuse).
6357 (parse_class_file): New function. Process each method defined in
6358 the current class and record the class as to be later registered.
6359 (yyparse): Rewritten. Figure the type of the current file and switch
6360 accordingly.
6361 * lang.c: New global variable current_jcf.
6362 (lang_init): Removed compiling_from_source test (done later, in
6363 yyparse). Removed call the jcf_parse ().
6364 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
6365 (typedef struct JCF): New fields seen_in_zip (to mark a class found
6366 in the current ZIP file) and zip_offset (offset to the class data in
6367 the current zip file).
6368 * jcf-reader.c: zipfile.h included.
6369 localToFile: New ZipFileCache static global variable
6370 (parse_zip_file_entries): New function. Browse the current ZIP
6371 file directory and process each class found.
6372 (process_zip_dir): New function. Register each class found in the
6373 ZIP file directory. The class aren't parsed but a valid JCF is
6374 link to each of them.
6375 (find_in_current_zip): New function. Search for a class in the
6376 current ZIP file directory. If found, prepare the class so that it
6377 can be loaded.
6378 (jcf_figure_file_type): New function. Examine the file structure
6379 to figure a class file, a ZIP file. If none of these categories are
6380 matched, a source file is assumed.
6381 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
6382 SeenZipFile: New global variable.
6383 (open_in_zip): Use zipmember's length to accelerate the search for
6384 a member. If zipmember was NULL and zip file successfully read,
6385 return 0.
6386 * java-tree.h: New global variable current_jcf declared. Added
6387 declaration for current_constant_pool_tags, current_constant_pool_data,
6388 current_constant_pool_length, current_constant_pool_data_ref.
6389 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
6390 store the JCF of classes seen in a zip file) and tree *constant_pool
6391 (to save a loaded class constant pool). current_class declared here.
6392 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
6393 retrieve method_ref_constant.
6394 (PUSHC): java_push_constant_from_pool now uses current_jcf.
6395 (OBJECT): get_class_constant now uses current_jcf.
6396 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
6397 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
6398 (expand_invoke): Now uses current_class instead of main_class
6399 (build_class_init): Now uses current_class instead of main_class
6400 * class.c: New static global variable registered_class.
6401 (register_class): New function.
6402 (emit_register_class): Modified to use registered_class instead of
6403 main_class
6404 (is_compiled_class): Now take into account class seen in the archive.
6405
6406Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
6407
6408 * except.h: Renamed to: java-except.h.
6409 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
6410 * except.c: Add semi-working (commented out) implementation.
6411
6412 * expr.c (expand_iinc): Add needed flush_quick_stack.
6413 * parse.c (set_source_filename): New function.
6414 (give_name_to_class): Set input_filename from package.classname.java.
6415
6416 * jcf-io.c (find_class): Don't look first in ".".
6417
6418Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6419
6420 * zextract.c (read_zip_archive): Now takes into account the
6421 extra_field field.
6422 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
6423
6424Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
6425
6426 * constants.c, java-tree.h (build_internal_class_name): New function.
6427 (alloc_class_constant): Re-implement using build_internal_class_name.
6428 * class.c (make_class_data): Likewise.
6429 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
6430
6431Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
6432
6433 * verify.c (verify_jvm_instructions): Temporarily set current_subr
6434 to NULL before pushing an exception handler target.
6435
6436 * expr.c (flush_quick_stack): Save from low stack indexes to high.
6437 (java_stack_swap, java_stack_dup): Re-write to be safe from
6438 clobbering registers.
6439 (build_class_init): New function.
6440
6441Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6442
6443 * typeck.c (build_java_array_type): Temporary use
6444 permanent_obstack to create the array 'length' field.
6445 * expr.c (lookup_label): Temporay use permanent_obstack to create
6446 label if not found.
6447 * class.c (push_super_field): Tempory use permanent_obstack.
6448
6449Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6450
6451 * typeck.c (type_for_mode): Now handles double_type_node and
6452 float_type_node.
6453 * verify.c (verify_jvm_instructions): The instruction following
6454 the wide bytecode is checked. OPCODE_ret added to the list of
6455 wide.
6456
6457Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6458
6459 * class.c (make_class): Temporary use permanent_obstack. Set the
6460 class CLASS_P field to 1.
6461 (push_class): Temporary use permanent_obstack.
6462 (set_super_info): Temporary use permanent_obstack.
6463 (add_method): Temporary use permanent_obstack, set
6464 METHOD_TRANSIENT().
6465 (add_field): Temporary use permanent_obstack. Sets
6466 FIELD_VOLATILE() and FIELD_TRANSIENT().
6467 (build_class_ref): Temporary use permanent_obstack if the class
6468 isn't compiled.
6469 (build_static_field_ref): Temporary use permanent_obstack when
6470 creating field's rtl.
6471 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
6472 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
6473 and fields. Function finalized, as far as flag handling.
6474 (push_class_static_dummy_field): Temporary use permanent_obstack.
6475 (emit_register_class): Force generation of class registration at
6476 -O3 or deeper.
6477 * decl.c (end_java_method): Call permanent_allocation() before
6478 returning.
6479 * expr.c (can_widen_reference_to): Added comment to interface
6480 handling, fixed typo.
6481 (lookup_field): Now uses CLASS_P() to correct FIXME
6482 (expand_invoke): Verification on public && !static &&
6483 !abstract moved into soft_lookupinterfacemethod (kaffe).
6484 Use Object class dtable if objectref is an array when expanding
6485 invokeinterface.
6486 (java_push_constant_from_pool): Temporary use permanent_obstack
6487 for CONSTANT_string
6488 * parse.c (get_ref_constant): Temporary use permanent_obstack to
6489 create constant references.
6490 (get_constant): Temporary use permanent_obstack to create constant.
6491 (load_class): Temporary use permanent_obstack to load class.
6492 (jcf_parse): Temporary use permanent_obstack to perform class
6493 layout.
6494 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
6495 (build_java_signature): Temporary use permanent_obstack.
6496 * verify.c: (verify_jvm_instruction): removed unecessary verification
6497 on ACC_SUPER flag.
6498 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
6499 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
6500 (CLASS_P): Defined
6501
6502Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
6503
6504 * class.c (append_gpp_mangled_type): Fix typo.
6505 (emit_register_class): Use main_class to get class object, rather
6506 than looking for no-longer-existing static decl starting with _CL.
6507 * typeck.c (parse_signature_type): Promote array element type
6508 if it is a RECORD_TYPE.
6509
6510Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
6511
6512 * class.c (push_class_static_dummy_field): New function.
6513 (mangle_static_field): New. Do G++-style mangling of static fields.
6514 (layout_class): Mandle static fields here, not in add_field.
6515 (build_class_ref): The class object is now a dummy static field.
6516 * decl.c (find_local_variable): Look for best, instead of first match.
6517 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
6518 (build_java_athrow): Don't check here if exception is Throwable.
6519 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
6520 (TYPE_USED): Removed. No longer used ...
6521 * parse.c (jcf_parse): Call push_class_static_dummy_field.
6522 * verify.c (push_pending_label): New function.
6523 (push_pending_block): Renamed to check_pending_block.
6524 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
6525 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
6526 re-checking possible handlers) after a store (less wasted work).
6527 Check for null handler (finally) before calling add_handler.
6528 Various changes to (finally?) correctly handle try/finally.
6529
65301997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
6531
6532 * class.c: Include stdio.h.
6533
6534Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
6535
6536 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
6537 to make sure class is initialized before static/special invoke.
6538
6539 * verify.c (verify_jvm_instructions): On a store instruction,
6540 call find_local_variable to force pre-allocation of decl and rtx.
6541 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
6542
6543Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
6544
6545 * class.c (build_class_ref): Strip off "promoted_" if need be.
6546 (make_field_value): Call build_java_signature when needed.
6547 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
6548 * expr.c (build_java_athrow): Don't push_value of exception.
6549 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
6550 match specification of [fd]cmp[lg] for NaNs.
6551 (expand_byte_code): Add support for exception handler ranges.
6552 * except.c: Add skeleton for EH code-generation.
6553 * verify.c (merge_types): Treat all promoted integral types as equal.
6554 * constants.c (build_constants_constructor): To force creation of
6555 current_constant_pool_data_ref, call build_constant_data_ref.
6556
6557 * javaop.def (lload): Fix typo.
6558 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
6559
6560Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
6561
6562 * parse.c: Don't include function.h.
6563
6564Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
6565
6566 * except.[ch]: New files.
6567 * Makefile.in (JAVA_OBJS): Add except.o
6568 * expr.c: Temporary warning about unimplemented exceptions.
6569 * verify.c: Verify exception handlers.
6570
6571 * jcf-dump.c (disassemble_method): Print exception table.
6572
6573Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6574
6575 * expr.c (verify_jvm_instructions): Started a thorough
6576 verification of invoke* bytecodes.
6577 (expand_byte_code): flush quick stack if PC is the target of a
6578 branch. and undef RET (conflicting with config/i386/i386.h).
6579 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
6580 used.
6581 (expand_invoke): Now handles invokeinterface and do more
6582 verification according to the bytecode.
6583 (lookup_field): Don't try to load the class if processing
6584 dtable_type.
6585 (can_widen_reference_to): Now handles interfaces.
6586 * decl.c (init_decl_processing): New global variable
6587 soft_lookupinterfacemethod_node, declared in java-tree.h.
6588 Call set_super_info on string_type_node.
6589 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
6590 defined.
6591 * class.c (set_super_info): Fills the CLASS_* flags according to
6592 access_flags.
6593 (get_access_flags_from_decl): Handles all class flags.
6594
6595Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
6596
6597 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
6598 * parse.c (yyparse): Check for abstract method, and missing code.
6599 * expr.c (expand_byte_code): Change interface.
6600 * lang.c (put_decl_node): Print promoted types prettier.
6601 * verify.c (verify_jvm_instruction): Change interface.
6602 Partial support for scanning exception table.
6603 For load instructions, handle promoted integral types.
6604
6605Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
6606
6607 * verify.c: New file, with contents moved from expr.c.
6608 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
6609 * typeck.c (is_array_type_p): Moved here from expr.c.
6610 * java-tree.h: Add some now-needed function declarations.
6611 * Makefile.in (JAVA_OBJS): Added verify.o.
6612
6613Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6614
6615 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
6616 METHOD_ABSTRACT flag.
6617
6618 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
6619 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
6620 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
6621
6622 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
6623 variables.
6624 (start_java_method): Hook for SYNCHRONIZED methods.
6625
6626 * expr.c (build_java_jsr, build_java_ret): New functions
6627 (JSR,PRE): New macros
6628 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
6629 (verify_jvm_instructions): tableswitch, lookupswitch,
6630 monitorenter, monitorexit, goto_w: verified.
6631 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
6632 (build_java_monitor): New function.
6633 (MONITOR_OPERATION): Modified to call build_java_monitor()
6634 (verify_jvm_instructions): Started a thorough verification of
6635 invoke* bytecodes.
6636
6637Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
6638
6639 Support verification of jsr/ret subroutines (used for try/finally).
6640 * decl.c (return_address_type_node): New type node.
6641 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
6642 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
6643 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
6644 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
6645 TYPE_USED): New macros for special types in type_map.
6646
6647 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
6648 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
6649 BCODE_JUMP_TARGET.
6650 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
6651
6652 * expr.c (can_widen_reference_to): New function.
6653 (pop_type): Use it.
6654 (merge_type_state): Support handling start of subroutine.
6655 (push_pending_block): Return char* error message, instead of calling
6656 fatal on an error. Also handle subroutines.
6657 (verify_jvm_instructions): Handle errors from push_poending_block.
6658 Support jsr and ret instructions.
6659
6660Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
6661
6662 * jcf-io.c (find_classfile): Fix thinko.
6663 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
6664
6665Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
6666
6667 * Makefile.in (BISON): Remove.
6668
6669Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
6670
6671 * Makefile.in: Convert to autoconf.
6672 * config-lang.in (outputs): Added java/Makefile.
6673
6674 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
6675 Rename cc1java to jc1.
6676
6677 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
6678 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
6679
6680 * class.c (class_depth): Do load_class if needed.
6681
6682 Mostly better verification.
6683 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
6684 (init_decl_processing): Change return type of soft_checkcast.
6685 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
6686 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
6687 lang_print_error): New functions.
6688 (lang_init): Set global hook print_error_function to lang_print_error.
6689 * expr.c: In the type_map ptr_type_node is only used for null now.
6690 (pop_type, merge_types): Hence ptr_type_node matches any reference.
6691 (merge_types): Dererence pointer to record types before comparing.
6692 (decode_newarray_type, merge_types): On error just return NULL.
6693 (build_java_binop): Add preliminary implementation (with warning)
6694 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
6695 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
6696 (expand_compare, expand_java_goto, expand_java_call): Don't
6697 push_pending_block, since that only makes sense when verifying.
6698 (merge_type_state): Different return codes.
6699 (push_pending_block): A block may need to be verified more than once.
6700 (expand_byte_code): Warn about unused code at code generation time.
6701 (verify_jvm_instruction): Changed logic, since code may need to be
6702 re-verified if type-state has changed. Also, better error handling.
6703 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
6704 Improve newarray, anewarray, ?aload, athrow,
6705 * java-tree.h (LABEL_CHANGED): New macro.
6706
6707Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6708
6709 * decl.c (soft_athrow_node): New global variable initialized.
6710 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
6711 * typeck.c (convert): Added support for REAL_TYPE.
6712 (convert_to_char): New function.
6713 (convert): Handle CHAR_TYPE.
6714 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
6715 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
6716 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
6717 promoted type.
6718 (verify_jvm_instructions): Added break a the end of bogus unop: label.
6719 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
6720 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
6721 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
6722 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
6723 to Use The Right Things.
6724 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
6725 compatible with INT. BOOLEAN is made equivalent to BYTE.
6726 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
6727 OPCODE_ifnonnull): Now supported.
6728 (build_java_athrow): New function.
6729
6730Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
6731
6732 Rename method name <init> to match G++ (and fix mangling).
6733 * class.c (layout_class): Replace method name of <init> by class name.
6734 (make_method_value): Do inverse renaming of constructor from <init>.
6735 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
6736 * typeck.c (lookup_java_constructor): New function.
6737 * expr.c (expand_invoke): If method_name is <init>, call
6738 lookup_java_constructor to find constructor.
6739
6740 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
6741
6742Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6743
6744 * parse.c (get_class_constant): Modified to handle array "classes"
6745 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
6746 wide type.
6747 (convert): Modified to handle real type.
6748 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
6749 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
6750 variables declared.
6751 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
6752 soft_multianewarray, soft_newarray_node, soft_throw_node): New
6753 global variables initialized.
6754 (find_local_variable): Handles the case of a pointer
6755 (end_java_method): Restore the use of one more scope
6756 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
6757 build_java_array_length_access, expand_java_arrayload,
6758 expand_java_arraystore, expand_java_array_length,
6759 expand_java_multianewarray, expand_java_anewarray,
6760 build_java_check_indexed_type, is_array_type_p,
6761 build_java_throw_out_of_bound_exception): New functions.
6762 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
6763 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
6764 OPCODE_<t>aload): Implemented code for verification.
6765 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
6766 ARRAY_NEW_MULTI): Macro defined.
6767 (CONVERT): Modified to invoke convert().
6768 (case OPCODE_aload2): Fixed index typo from 2 to 1.
6769
6770Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
6771
6772 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
6773 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
6774 (make_class_data): Field name needs '/' as package prefix.
6775 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
6776
6777Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
6778
6779 Implement debug information for local variables.
6780 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
6781 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
6782 DECL_LOCAL_SLOT_CHAIN): New macros.
6783 (struct lang_decl_var): New type.
6784 * parse.c (give_name_to_locals): Move to decl.c.
6785 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
6786 (start_java_method): Re-write parameter handling.
6787 (pending_local_decls): New global variable.
6788 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
6789 (find_local_variable): Accept pc so we can skips decls not in range.
6790 (struct binding_level): Add end_pc field.
6791 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
6792 (various): Change so current pc gets passed to find_local_variable.
6793
6794 * decl.c (init_decl_processing): Re-arrange fields in
6795 class_type_node and and method_type_node to match kaffe 0.9.1.
6796 * class.c (make_method_value, make_class_data): Update
6797 initializations to match.
6798
6799Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
6800
6801 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
6802 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
6803 (push_super_field): New function.
6804 (make_class_data): Handle inheritance of class static initializer.
6805 (layout_class): New name mangling.
6806 * constants.c (build_constant_data_ref): Init type of data array
6807 to a one-element array.
6808 (build_constants_constructor): Set DECL_SIZE from complete array type.
6809 * decl.c: Rename class_type, object_type etc to class_type_node,
6810 object_type_node etc. Make former inherit from latter.
6811 * expr.c (expand_invoke): Add cast of function address.
6812 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
6813 * parse.c (yyparse): Don't call layout_class here.
6814 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
6815
6816Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
6817
6818 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
6819 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
6820 (alloc_class_constant): New.
6821 * expr.c (expand_invoke): Make sure method's class is initialized.
6822 * class.c (interits_from_p, emit_register_class): New functions.
6823 * parse.c (yyparse): Call emit_register_class.
6824
6825Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
6826
6827 * constants.c: New file, to handle constant pool.
6828 * Makefile.in (JAVA_OBJS): Add constants.o.
6829 * decl.c (init_decl_processing): Update, fix, finish various structs.
6830 (pushdecl_top_level): New.
6831 * parse.c (layout_class): Moved to class.c.
6832 * expr.c (java_push_constant_from_pool): New function.
6833 * class.c (build_class_ref): Make work fully
6834 (make_class_data): Emit super-class, constant pool, interface vector.
6835
6836Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
6837
6838 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
6839 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
6840 * class.c (class_depth): New function.
6841 (lookup_named_class): Replaced by new function lookup_class.
6842 * decl.c (object_type_node, string_type_node): New.
6843 Remove various types that we no longer need.
6844 * expr.c (verify_jvm_instructions): New separate verifier pass.
6845 (push_type, pop_type): New functions for verifier.
6846 (type_stack_dup, pop_argument_types, merge_types): Likewise.
6847 (expand_byte_code): Simplify, since we assume already verified.
6848 (expand_invoke): Now mostly works.
6849 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
6850 * lang.c (main_class): Move to parse.c. Don't make_class yet.
6851 * parse.c: Wait to allocate class object until we know its name.
6852 (layout_class): Calculate DECL_VINDEX for each virtual method.
6853 * typeck.c (get_array_type): Rename to ...
6854 (build_java_array_type): ... and provide working implementation.
6855 (build_java_signature): New function - build Java signature of type.
6856 (set_java_signature): New function - cache signature with type.
6857 (lookup_java_method): New function.
6858
6859Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
6860
6861 * class.c (ident_subst): Take extra SUFFIX parameter.
6862 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
6863 (set_constant_value, build_static_field_ref, is_compiled_class): New.
6864 (build_class_ref): Actually implement.
6865 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
6866 * decl.c (builtin_function): New.
6867 (init_decl_processing): Update for current Kaffe. Declare some
6868 builtin Kaffe functions.
6869 * expr.c (build_address_of): New.
6870 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
6871 Renamed (from expand_java_new etc), and added working implementations.
6872 (build_field_ref): Now also handle static fields.
6873 (expand_invoke): Implement invokestatic, and start implement rest.
6874 * java-opcodes.h: Use javaop.def to avoid duplicated list.
6875 * javaop.def: Rename invokevirt -> invokevirtual.
6876 * lang.c (use_handles): Removed.
6877 * parse.c: Add support for ConstantValue atribute.
6878 Handle nested loading of a class. (JPOOL_UTF): New.
6879
6880Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
6881
6882 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
6883
6884Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
6885
6886 * Make-lang.in (java.install-man): New empty rule.
6887 * typeck.c (set_local_type): New function.
6888 * expr.c (STORE_INTERNAL): Call find_local_variable,
6889 not find_stack_slot. Call set_local_type.
6890
6891Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
6892
6893 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
6894 and building RECORD_TYPE CONSTRUCTORs.
6895 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
6896
6897 * lang.c (use_handles): Change the default to 0.
6898 * decl.c: Define and build class_type, field_type, utf8const_type.
6899 * class.c (make_class_data, make_field_value,
6900 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
6901 hashUtf8String, strLengthUtf8, mangled_classname:
6902 Functions to build reflective data structures.
6903 * parse.c (yyparse): Call make_class_data.
6904
6905 * jcf-io.c (open_class, find_classfile): New functions.
6906 * jcf-dump.c: Support reading classfile from explicitly-named
6907 class file (without CLASSPATH searching).
6908
6909Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
6910
6911 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
6912 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
6913 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
6914 (get_constant): Now trivial for CONSTANT_Utf8.
6915
6916 * jcf.h: Make NEW_CPOOL the default.
6917 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
6918
6919Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>
6920
6921 New directory.
This page took 0.944449 seconds and 5 git commands to generate.