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