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