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