jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes...
[gcc.git] / gcc / java / ChangeLog
1 1999-03-12 Andrew Haley <aph@cygnus.com>
2
3 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
4 we'll need a directory separator and a null character.
5
6 Wed Mar 10 23:20:11 1999 Per Bothner <bothner@cygnus.com>
7
8 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
9
10 Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
11
12 * lex.c (java_parse_end_comment): Take extra parameter (next char).
13
14 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
15
16 * class.c (layout_class_method): A static method in a base class
17 is never overridden, so treat it like it doesn't exist.
18 However, do complain about private non-static method overriding
19 public static method.
20
21 * parse.y: Don't set unused INITIALIZED_P flag.
22 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
23
24 * parse.y (find_expr_with_wfl): Optimize tail-calls.
25 (build_array_from_name): Re-order &index[string] to &string[index].
26
27 * parse.y (java_complete_tree): Don't call patch_assignment if rhs is
28 error_mark (it might catch more errors, but it is more likely to lose).
29
30 Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
31
32 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
33 (parse-scan.o): Depend on toplev.h.
34
35 * class.c (make_method_value): Add prototype. Make it static.
36 Remove unused second argument, caller changed.
37
38 * expr.c (java_lang_expand_expr): Remove unused variable
39 `return_label'.
40
41 * java-tree.h: Don't prototype find_in_current_zip.
42 Add prototypes for verify_constant_pool, start_java_method,
43 end_java_method, give_name_to_locals, expand_byte_code,
44 open_in_zip, set_constant_value, find_constant1, find_constant2,
45 find_utf8_constant, find_string_constant, find_class_constant,
46 find_fieldref_index, find_methodref_index, write_constant_pool,
47 count_constant_pool_bytes and encode_newarray_type.
48
49 * jcf-dump.c: Remove unused variable `LONG_temp'.
50
51 * jcf-parse.c: Include parse.h.
52 (jcf_parse_source): Remove unused parameter, all callers changed.
53 (jcf_figure_file_type): Add static prototype.
54 (find_in_current_zip): Likewise. Also remove unused parameter,
55 all callers changed.
56 (read_class): Initialize variable `saved_pos'.
57
58 * jcf-reader.c (jcf_parse_preamble): Mark variables
59 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
60
61 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
62 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
63 (java_parse_doc_section): Initialize variable `seen_star'.
64 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
65 (java_lex_error): Mark parameters `msg' and `forward' with
66 ATTRIBUTE_UNUSED.
67 (java_get_line_col): Mark parameters `filename' and `line' with
68 ATTRIBUTE_UNUSED.
69
70 * parse-scan.y: Include toplev.h.
71 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
72
73 * parse.h: use `struct JCF', not plain `JCF'.
74 (java_parser_context_save_global, java_expand_classes
75 java_parser_context_restore_global, java_parse): Add prototypes.
76
77 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
78 `node'.
79
80 Wed Feb 24 16:13:59 1999 Per Bothner <bothner@deneb.cygnus.com>
81
82 * check-init.c (check_init): COPYN takes word count, not bit count.
83
84 Fri Feb 26 14:06:21 1999 Per Bothner <bothner@cygnus.com>
85
86 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
87 explicit build_decl. (Avoids crash in reload when optimizing.)
88
89 Thu Feb 25 21:05:04 1999 Per Bothner <bothner@cygnus.com>
90
91 * decl.c (complete_start_java_method): Handle synchronized method
92 even when compiling from bytecode.
93
94 1999-02-26 Tom Tromey <tromey@cygnus.com>
95
96 * gjavah.c (add_class_decl): Only generate `#include' if outer
97 class is not the name of the class we are processing. Correctly
98 append `.h' in #include.
99 (process_file): Clean up newlines around generated `#include's.
100 (decode_signature_piece): Correctly handle inner classes.
101 (struct include): New structure.
102 (all_includes): New global.
103 (print_include): New function.
104 (add_class_decl): Use it.
105 (process_file): Likewise.
106 (add_class_decl): Generate include for java-array.h if array
107 seen.
108 (process_file): Don't generate java-array.h include.
109
110 * gjavah.c (add_namelet): Check for standard package names here.
111 (add_class_decl): Don't check for standard package names here.
112
113 1999-02-25 Tom Tromey <tromey@cygnus.com>
114
115 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
116 When reading a zip file, only use strncmp if both strings are
117 bigger than the buffer length. Initialize `k' when looping
118 through zip file.
119
120 1999-02-24 Tom Tromey <tromey@cygnus.com>
121
122 * gjavah.c (struct namelet): New structure.
123 (add_namelet): New function.
124 (print_namelet): New function.
125 (print_class_decls): Use add_namelet and print_namelet to generate
126 namespaces and not classes.
127 (method_printed): New global.
128 (HANDLE_END_METHOD): Examine method_printed.
129 (print_method_info): Set method_printed when required. Print
130 error if function to be ignored is marked virtual. Handle $finit$
131 method.
132 (METHOD_IS_FINAL): New macro.
133 (print_field_info): Use it.
134 (HANDLE_METHOD): Clear method_printed.
135 (method_pass): New global.
136 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
137 (process_file): Do two passes over both fields and methods.
138 (HANDLE_METHOD): Examine method_pass.
139 (root): New global.
140 (add_class_decl): New function.
141 (print_class_decls): Don't scan over entire constant pool.
142
143 1999-02-23 Tom Tromey <tromey@cygnus.com>
144
145 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
146 disable linking in that case.
147
148 1999-02-20 Tom Tromey <tromey@cygnus.com>
149
150 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
151 not 0x1f.
152
153 Sun Feb 21 14:56:11 1999 Per Bothner <bothner@cygnus.com>
154
155 * decl.c (build_result_decl), java-tree.h: New method.
156 (complete_start_java_method): Handle synchronized methods.
157 Don't build DECL_RESULT here. (Ordering dependency problem.)
158 (start_java_method): Call build_result_decl here instead ...
159 * parse.y (java_complete_expand_method): ... and here.
160 (expand_start_java_method): Don't call complete_start_java_method here.
161 (java_complete_expand_method): Call it here instead.
162 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
163 * java-tree.h: ... here.
164
165 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
166 * parse.y (java_complete_lhs): Don't call force_evaluation_order
167 for ARRAY_REF - it doesn't work when array bounds are checked.
168 (patch_array_ref): Handle it here instead.
169
170 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
171
172 Fri Feb 19 15:35:01 1999 Per Bothner <bothner@cygnus.com>
173
174 Force left-to-right evaluation of binary operations etc.
175 * expr.c (force_evaluation_order), java-tree.h: New function.
176 * parse.y (java_complete_lhs): Pass binary operations, procedure
177 calls, and ARRAY_REFs to force_evaluation_order.
178 (various): Set TREE_SIDE_EFFECTS more carefully.
179
180 Tolerate random (non-UTF8) encoding in comments without complaining.
181 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
182 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
183
184 * parse.y (resolve_qualified_expression_name): Handle error_mark.
185 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
186
187 * parse.y (java_complete_lhs): Ignore an empty statement in a
188 COMPOUND_EXPR. Don't complain about empty statement after return.
189
190 Fri Feb 19 13:00:56 1999 Per Bothner <bothner@cygnus.com>
191
192 * parse.y (obtain_incomplete_type): Don't wrap unknown types
193 in TREE_LIST - just chain the POINTER_TYPEs together.
194 (resolve_class): If type already resolved, return decl.
195 After resolving, update TREE_TYPE(class_type), and name (if array).
196 * parse.h (do_resolve_class), parse.y: Make non-static.
197 * class.c (maybe_layout_super_class): Take this_class argument.
198 Do do_resolve_class if necessary.
199 (layout_class, layout_class_methods): Adjust calls appropriately.
200 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
201 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
202 * typeck.c (build_java_array_type): Don't call layout_class.
203
204 Wed Feb 17 15:47:20 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
205
206 * parse.y (check_pkg_class_access): Allow private class access
207 within the same package.
208 (strip_out_static_field_access_decl): New function.
209 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
210 operator argument before testing its nature.
211
212 Wed Feb 3 12:38:43 1999 Per Bothner <bothner@cygnus.com>
213
214 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
215 (TRY_EXPR): Simplify - it no longer has a finally clause.
216 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
217 Simpler handling of TRY_EXPR, which no longer has a finally clause.
218 * expr.c (java_lang_expand_expr): Likewise.
219 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
220 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
221 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
222 (build_try_statement): Remove finally parameter and handling.
223 (build_try_finally_statement): New function.
224 (patch_try_statement): No longer need to support finally clause.
225 (try_statement): Update grammar action rules.
226 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
227 Simpler handling of TRY_EXPR, which no longer has a finally clause.
228
229 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
230
231 * jcf-parse.c (get_constant): Add braces around computation of 'd'
232 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
233
234 1999-02-17 Andrew Haley <aph@cygnus.com>
235
236 * class.c (build_utf8_ref): Back out broken patch which was
237 intended to to output signatures using '.' as a separator.
238
239 * class.c (make_class_data): Output signatures using '.' as a
240 separator, rather than '/'.
241 (mangled_classname): Likewise.
242 (make_field_value): Likewise.
243 (make_method_value): Likewise.
244 * constants.c (alloc_class_constant): Likewise.
245 * expr.c (build_invokeinterface): Likewise.
246
247 Thu Feb 11 21:25:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
248
249 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
250 of an ancient workaround.
251
252 Wed Feb 10 23:27:33 1999 Jeffrey A Law (law@cygnus.com)
253
254 * jvspec.c (xmalloc): Kill the prototype. It does not belong
255 here anymore.
256
257 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
258
259 * lex.c (yylex): Encode \0 as UTF8.
260
261 1999-02-10 Tom Tromey <tromey@cygnus.com>
262
263 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
264 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
265 (libgcj_zip): Renamed.
266 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
267 LIBJAVA_ZIP_FILE.
268 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
269
270 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
271 (GC_NAME): Renamed -lgc to -lgcjgc.
272
273 Tue Feb 9 19:31:09 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
274
275 * lex.c (java_lang_cloneable): Initialize.
276 * parse.y (java_lang_cloneable): New static variable.
277 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
278 doing one more qualification round.
279 (valid_ref_assignconv_cast_p): Reject null source or
280 destination. Allow an array to be cast into java.lang.Cloneable.
281 (patch_cast): Swapped two first arguments to first call to
282 valid_ref_assignconv_cast_p.
283
284 Mon Feb 8 11:50:50 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
285
286 * parse.h: DECL_P renamed JDECL_P.
287 * parse.y: DECL_P replaced by JDECL_P.
288 (build_array_from_name): Always use pointer's type.
289 (patch_bc_statement): Extra code to search continue target in a
290 for loop. Fixed comments. Continue target is current loop when
291 unlabeled.
292
293 1999-02-05 Andrew Haley <aph@cygnus.com>
294
295 * class.c (make_class_data): The superclass of an interface should
296 be null, not class Object.
297
298 * lex.c (java_lex): Sign extend hex literals.
299
300 1999-02-04 Andrew Haley <aph@cygnus.com>
301
302 * class.c (build_utf8_ref): Output signatures using '.' as a
303 separator, rather than '/'.
304 (make_class_data): Likewise.
305
306 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
307
308 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
309 mkstemp.o. Get them from libiberty now.
310
311 Tue Feb 2 19:49:12 1999 Jeffrey A Law (law@cygnus.com)
312
313 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
314
315 Tue Feb 2 20:04:50 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
316
317 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
318 from libiberty.h
319
320 Tue Feb 2 10:39:47 1999 Per Bothner <bothner@cygnus.com>
321
322 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
323 * jcf-write.c (generate_bytecode_return): New function.
324 (generate_bytecode_insns): Use it, for RETURN_EXPR.
325
326 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
327 generate special [fd]const_[01] instructions.
328
329 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
330
331 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
332 handling OPCODE_lookupswitch or OPCODE_tableswitch.
333
334 Mon Feb 1 20:44:47 1999 Per Bothner <bothner@cygnus.com>
335
336 * parse.y (patch_method_invocation): Handle calling static methods,
337 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
338
339 * parse.y (java_complete_lhs): Don't complain about unreachable
340 exit condition in a do-while statement.
341
342 Fri Jan 29 18:19:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
343
344 * lex.c (java_read_char): Fixed utf8 decoding.
345 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
346 range.
347 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
348 comments. Local variable `all_primitive' is gone. Broadened
349 acceptance of `0' to floating point targets. `long' can now be
350 widened to `double' or `float'.
351 (valid_method_invocation_conversion_p): Added leading
352 comment. Fixed tabulation.
353 (build_string_concatenation): Optimize out left or right empty
354 string constants.
355
356 Thu Jan 28 18:51:26 1999 Per Bothner <bothner@cygnus.com>
357
358 * jcf-write.c (localvar_alloc): Only emit entry for
359 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
360 (generate_bytecode_insns): Only call put_linenumber if
361 debug_info_level > DINFO_LEVEL_NONE.
362 * jvspec.c (lang_specific_driver): If no -O* or -g* option
363 is specified, add -g1 (for compatibility wih javac).
364
365 Thu Jan 28 09:17:51 1999 Hans-Peter Nilsson <hp@axis.se>
366
367 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
368 gjavah.o, check-init.o, jv-scan.o
369
370 Mon Feb 1 09:50:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
371
372 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
373
374 * gjavah.c: Include config.h and system.h.
375
376 * javaop.h (inline): Don't define, its handled by system.h.
377 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
378 from `inline' to `static inline'.
379
380 * jcf.h (inline): Don't define, its handled by system.h.
381
382 * lex.c (inline): Likewise.
383
384 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
385
386 * lang-specs.h: Map -Qn to -fno-ident.
387
388 Fri Jan 29 16:51:56 1999 Richard Henderson <rth@cygnus.com>
389
390 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
391
392 1999-01-29 Tom Tromey <tromey@cygnus.com>
393
394 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
395 then cast it to Object before calling `append' method.
396
397 Thu Jan 28 14:45:39 1999 Per Bothner <bothner@cygnus.com>
398
399 * check-init.c (check_bool2_init, check_bool_init, check_init):
400 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
401 * jcf-write.c (generate_bytecode_insns): Likewise.
402
403 Thu Jan 28 11:50:11 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
404
405 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
406 * parse.y (patch_cast): Allow a boolean to be cast into a
407 boolean.
408
409 Wed Jan 27 10:19:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
410
411 * parse.y: (class_declaration:): Fixed indentation.
412 (class_member_declaration:): Extra `;' after field declaration now
413 accepted.
414 (interface_declaration:): Removed debug messages in error reports.
415 (patch_binop): Nodes created and returned inherit the orignal
416 node's COMPOUND_ASSIGN_P flag value.
417 (patch_cast): Fix cast from char to floating point.
418
419 Mon Jan 25 17:39:19 1999 Andrew Haley <aph@cygnus.com>
420
421 * except.c, java-except.h (expand_resume_after_catch): new
422 function.
423 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
424 to branch back to main flow of control after a catch block.
425
426 Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
427
428 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
429 $(srcdir)/../system.h.
430 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
431 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
432 (jcf-write.o): Likewise.
433 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
434 (mangle.o): Depend on $(srcdir)/../toplev.h.
435 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
436 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
437
438 * class.c: Include output.h and parse.h.
439 (mangled_classname): Add the `const' keyword to a char*.
440 (find_named_method): Hide unused function definition.
441 (build_utf8_ref): Change type of variable `c' to unsigned char.
442 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
443 (build_class_ref): Add the `const' keyword to a char*.
444 (layout_class_method): Remove unused variable `buf'.
445
446 * decl.c (find_local_variable): Remove unused variable `rtl'.
447 (pushdecl): Likewise for variables `different_binding_level' and
448 `oldglobal'.
449 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
450 (maybe_build_cleanup): Likewise for parameter `decl'.
451
452 * except.c (expand_start_java_handler): Mark parameter `range'
453 with ATTRIBUTE_UNUSED.
454
455 * expr.c: Include except.h.
456 (pop_type): Remove unused variable `i'.
457 (pop_value): Likewise for variables `n_words' and `i'.
458 (expand_java_arrayload): Likewise for variable `convert'.
459 (java_lang_expand_expr): Likewise for variables `op0', `type',
460 `mode', `unsignedp', `node' and `elements'.
461 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
462 `eh_ranges'.
463 (process_jvm_instruction): Add a `const' qualifier to a char*.
464
465 * gjavah.c (output_directory): Add the `const' keyword to a char*.
466 (temp_directory): Likewise.
467 (print_c_decl): Likewise.
468 (print_method_info): Likewise.
469 (decode_signature_piece): Likewise.
470 (print_mangled_classname): Likewise.
471
472 * java-except.h: Provide prototypes for maybe_start_try,
473 maybe_end_try and add_handler.
474
475 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
476 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
477 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
478 init_expr_processing, push_super_field, init_class_processing,
479 can_widen_reference_to, class_depth, verify_jvm_instructions,
480 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
481 set_local_type, merge_type_state, push_type, load_type_state,
482 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
483 emit_unicode_mangled_name): Add prototypes.
484
485 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
486 (print_signature_type): Use ISDIGIT, not isdigit.
487 (print_signature): Remove unused variable `j'.
488
489 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
490 int when comparing against one.
491
492 * jcf-parse.c: Include toplev.h.
493
494 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
495 (localvar_free): Remove unused variable `i'.
496 (generate_bytecode_conditional): Likewise for variable `kind'.
497
498 * jv-scan.c: Include config.h and system.h. Remove redundant
499 OS header and gansidecl.h includes.
500 (warning): Add the `const' keyword to a char*. Also add
501 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
502 __STDC__, when determining whether to use ANSI-isms.
503 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
504 (xmalloc): Don't redundantly prototype here.
505 (main): Remove unused parameter `envp'. Also fix the arguments
506 passed to function `fatal' to match the format specifier.
507
508 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
509
510 * mangle.c: Include toplev.h.
511 (emit_unicode_mangled_name): Declare parameter `len'.
512
513 * parse.y (parse_warning_context): Add the `const' keyword to a
514 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
515 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
516 (issue_warning_error_from_context): Add the `const' keyword to
517 a char*.
518 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
519 not `__STDC__' for whether to use ANSI-isms.
520
521 * typeck.c (incomplete_type_error): Mark parameters `value' and
522 `type' with ATTRIBUTE_UNUSED.
523 (parse_signature_type): Use ISDIGIT, not isdigit.
524
525 * verify.c (check_pending_block): Add the `const' keyword to a char*.
526 (verify_jvm_instructions): Likewise. Remove unused variables
527 `field_name' and `default_val'.
528
529 * zextract.c: Include config.h and system.h. Remove redundant
530 OS header includes.
531
532 * zipfile.h: Prototype `read_zip_archive'.
533
534 Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
535
536 * typeck.c (convert): Allow conversions to void type: some
537 optimizations in gcc do this.
538
539 Thu Jan 21 15:21:49 1999 Andrew Haley <aph@cygnus.com>
540
541 * typeck.c (convert_ieee_real_to_integer): New function.
542 (convert): When not using fast-math and using hardware fp, convert
543 an IEEE NaN to zero.
544
545 1999-01-18 Andrew Haley <aph@cygnus.com>
546
547 * parse.y (patch_binop): Do a type conversion from signed to
548 unsigned and then back to signed when a ">>>" is found.
549
550 Sun Jan 17 22:34:22 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
551
552 * java-tree.h: (check_for_initialization): Added prototype.
553 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
554 * parse.y (do_resolve_class): Removed unused locals.
555 (read_import_dir): Likewise.
556 (resolve_qualified_expression_name): Array creation
557 expressions are valid primary expressions.
558 (qualify_ambiguous_name): Likewise.
559 (patch_synchronized_statement): Removed unused local.
560
561 Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com)
562
563 * Makefile.in (zextract.o): Add dependencies.
564
565 * Makefile.in: Do not put ^Ls at the start of a line.
566
567 Fri Jan 15 20:16:20 1999 Per Bothner <bothner@cygnus.com>
568
569 * expr.c (process_jvm_instruction): Coerce to correct Throwable
570 sub-type the result of the call that gets the exception value.
571
572 * parse.y (java_complete_expand_methods): If flags_syntax_only,
573 don't call finish_class.
574
575 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
576 clear found before continuing.
577
578 * verify.c (verify_jvm_instructions): On an array load, allow
579 and handle top of stack to be TYPE_NULL.
580
581 * gjavah.c (generate_access): Translate Java package private or
582 protected access to C++ public, but with a comment.
583
584 1999-01-13 Andrew Haley <aph@cygnus.com>
585
586 * expr.c (generate_name): Name prefix changed to avoid clashes
587 with assembler temp labels.
588
589 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
590 MODIFY_EXPR. Without this, code for the assignement may not be
591 generated at all and the synchronized statement will read an
592 uninitialized variable.
593
594 Wed Jan 13 01:24:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
595
596 * class.c (maybe_layout_super_class): Fixed returned value.
597 * lex.c: Added 1999 to the copyright.
598 (java_init_lex): Initialize java_lang_imported.
599 * lex.h: Added 1999 to the copyright.
600 * parse.h: Added 1999 to the copyright.
601 (REGISTER_IMPORT): Fixed typo in trailing macro.
602 (CURRENT_OSB): New macro.
603 (struct parser_ctxt): New fields osb_depth, osb_limit.
604 * parse.y (java_lang_id): New global variable.
605 (type_import_on_demand_declaration): Don't import java.lang.* twice.
606 (array_creation_expression:): Use CURRENT_OSB.
607 (dims:): Uses a stack to keep track of array dimensions.
608 (cast_expression:): Use CURRENT_OSB.
609 (find_expr_with_wfl): Return NULL if node found doesn't meet the
610 conditions.
611 (register_fields): Fixed typos in comment.
612 (check_method_redefinition): Fixed comment indentation.
613 (java_check_regular_methods): Set saved found wfl to NULL after
614 having reinstalled it in the previously found DECL_NAME.
615
616 Sun Jan 10 13:36:14 1999 Richard Henderson <rth@cygnus.com>
617
618 * gjavah.c (java_float_finite): Use a union to do type punning.
619 (java_double_finite): Likewise.
620
621 Sat Jan 9 11:25:00 1999 Per Bothner <bothner@cygnus.com>
622
623 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
624 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
625 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
626 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
627 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
628 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
629
630 Fri Jan 8 15:48:03 1999 Per Bothner <bothner@cygnus.com>
631
632 * check-init.c (check_init): If compiling to native, we don't
633 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
634
635 1999-01-08 Tom Tromey <tromey@cygnus.com>
636
637 * parse-scan.y (variable_declarator_id): Set or increment
638 bracket_count.
639 (bracket_count): New global.
640 (formal_parameter): Handle case where bracket pairs trail variable
641 declarator id.
642
643 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
644
645 * jcf-parse.c (yyparse): variable len changed from a char to an
646 int to prevent overflow.
647
648 Wed Jan 6 17:19:46 1999 Per Bothner <bothner@cygnus.com>
649
650 * java-tree.h: Declare read_class.
651 * jcf-parse.c (read_class): New function.
652 (load_class): Now just call read_class.
653
654 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
655 * jcf-parse.c (parse_source_file): Declare save_error_count,
656 which is needed by java_parse_abort_on_error macro,
657 * parse.y (java_layout_classes, java_expand_classes): Likewise.
658
659 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
660 constructor, if initializing a static field.
661 (patch_new_array_init): Set TREE_CONSTANT if it is.
662 * expr.c (java_lang_expand_expr): For a static array constructor
663 of primitive elements, allocate the array itself statically.
664 Disabled until we can set the vtable field statically.
665
666 * check-init.c: New file. Checks for definite assignment.
667 * Makefile.in (JAVA_OBJS): Add check-init.o.
668 * parse.y (java_complete_expand_method): Call check_for_initialization.
669 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
670
671 Wed Jan 6 14:53:10 1999 Graham <grahams@rcp.co.uk>
672
673 * parse.y : include system.h instead of including
674 standard headers directly with the exception of <dirent.h>.
675
676 Wed Jan 6 16:20:06 1999 Per Bothner <bothner@cygnus.com>
677
678 * lex.h: Moved static function declarations to lex.c,
679 to shut up some -Wall warnings.
680 * lex.c: Static function declarations moved here.
681 * jcf-dump.c: Small fixes to shut up -Wall warnings.
682
683 Tue Jan 5 22:15:40 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
684
685 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
686
687 Tue Dec 22 11:25:19 1998 Per Bothner <bothner@cygnus.com>
688
689 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
690 * verify.c (verify_jvm_instructions): Fix off-by-one error.
691
692 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
693 (localvar_alloc): Change return type to void,
694 (emit_unop): Remove unused variable size.
695
696 * jcf-write.c (struct jcf_block): Add new union.
697 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
698 (call_cleanups): New functions.
699 (struct jcf_partial): New fields num_finalizers and return_value_decl.
700 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
701 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
702 * lang.c (lang_init): Call using_eh_for_cleanups.
703 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
704 completing operands to patch_synchronized_statement.
705 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
706 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
707 WITH_CLEANUP_EXPR instead of TRY_EXPR.
708
709 Sun Dec 20 16:15:44 1998 John F. Carr <jfc@mit.edu>
710
711 * Make-lang.in: Comment out control-Ls; they upset some makes.
712
713 1998-12-18 Tom Tromey <tromey@cygnus.com>
714
715 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
716 consistently.
717
718 1998-12-17 Tom Tromey <tromey@cygnus.com>
719
720 * parse.y (DIR_SEPARATOR): New define.
721 (check_class_interface_creation): Use it.
722
723 * parse-scan.y (report_main_declaration): Recognize
724 `java.lang.String' in argument to main.
725
726 Wed Dec 16 16:18:59 1998 Per Bothner <bothner@cygnus.com>
727
728 * parse.y (create_interface): Remove bogus test.
729
730 Wed Dec 16 14:42:19 1998 Per Bothner <bothner@cygnus.com>
731
732 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
733 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
734
735 1998-12-16 Tom Tromey <tromey@cygnus.com>
736
737 * parse-scan.y (qualified_name): Use correct sprintf format.
738
739 1998-12-15 Tom Tromey <tromey@cygnus.com>
740
741 * gjavah.c (print_field_info): Changed how most negative number is
742 printed.
743
744 Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com>
745
746 * parse.y (fold_constant_for_init): New function.
747 (resolve_expression_name): Don't replace static final
748 constant-initialized fields by its value.
749 (java_complete_lhs): New. Same as java_complete_tree, except does
750 not replace static final constant-initialized fields by their values.
751 (register_fields): If there is an initializer, set DECL_INITIAL and
752 MODIFY_EXPR_FROM_INITIALIZATION_P.
753 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
754 Only call patch_initialized_static_field if
755 MODIFY_EXPR_FROM_INITIALIZATION_P.
756 (patch_initialized_static_field): If not valid constant, clear
757 DECL_INITIAL.
758
759 * parse.y (lookup_field_wrapper): Fix thinko.
760
761 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
762 set and restore global lineno.
763
764 1998-12-14 Tom Tromey <tromey@cygnus.com>
765
766 * gjavah.c (print_field_info): If value to print is the smallest
767 value of its size, then print as hex to avoid later warnings from
768 C++ compiler.
769
770 1998-12-14 Tom Tromey <tromey@cygnus.com>
771
772 * gjavah.c (decompile_method): Decompile `return null'.
773 (process_file): Generate `#pragma interface'.
774 (method_declared): New global.
775 (print_method_info): Set it.
776 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
777 (print_method_info): Handle abstract methods.
778
779 Sun Dec 13 17:31:40 1998 Per Bothner <bothner@cygnus.com>
780
781 * parse.y (patch_method_invocation): If class_decl is null
782 (e.g. an array type), use original type.
783
784 * parse.y (check_thrown_exceptions): Temporary hack to suppress
785 errors about uncaught exception from clone (of array, specifically).
786
787 1998-12-13 Tom Tromey <tromey@cygnus.com>
788
789 * gjavah.c (decompile_method): Handle all types of `return'
790 opcode. Decompile `return this' and `return'.
791 (method_access): New global.
792 (print_method_info): Set it.
793 (decompile_method): Don't decompile a synchronized method.
794
795 1998-12-13 Tom Tromey <tromey@cygnus.com>
796
797 * jcf-reader.c (jcf_parse_one_method): Recognize
798 HANDLE_END_METHOD.
799 * gjavah.c (HANDLE_END_METHOD): New macro.
800 (HANDLE_CODE_ATTRIBUTE): New macro.
801 (decompile_method): New function.
802 (print_method_info): Don't print `;\n' at end of function decl.
803 Include java-opcodes.h.
804 (decompiled): New global.
805
806 Sat Dec 12 20:13:19 1998 Per Bothner <bothner@cygnus.com>
807
808 * class.c (build_class_ref): Handle PRIMTYPE.class if
809 flag_emit_class_files.
810 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
811 if flag_emit_class_files.
812 * parse.y (java_complete_tree): Pre-liminary support for
813 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
814
815 * parse.y (patch_synchronized_statement): Don't call monitorexit
816 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
817
818 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
819
820 * zipfile.h (opendir_in_zip): New declaration.
821 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
822 (opendir_in_zip): New function, using code from open_in_zip.
823 (open_in_zip): Call opendir_in_zip.
824 (find_class): Remove no-longer-used do_class_file parameter,
825 but add source_ok parameter. Change logic so if we find a .java file,
826 we don't look for .class in later classpath emtries.
827 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
828 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
829 * gjavah.c: Update call to find_class.
830 * jcf-dump.c: Likewise.
831
832 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
833 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
834 nothing if body is empty_stmt_node.
835 Various little fixes so SP gets correctly adjusted.
836 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
837 For CALL_EXPR, test if static first.
838 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
839 such as the ones we create for Object and Class.
840 Set and restore current_function_decl.
841 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
842 (note_possible_classname): New function.
843 (read_import_entry): Removed. Merged with read_import_dir.
844 (read_import_dir): Don't call find_class - that only gives us
845 the first classpath entry having the needed package.
846 Use the struct buffer data structure from buffer.h.
847 (read_import_dir, find_in_imports_on_demand): The remembered
848 class names now use '.' (not '/') as package separator.
849
850 * parse.y (java_complete_expand_methods): Call write_classfile
851 here, and not in java_expand_classes (which only gets first class).
852
853 Sat Dec 12 19:46:04 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
854
855 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
856 (register_fields): If a static fields has an initializer, just
857 chain it on ctxp->static_initialized, and handle later.
858 (java_complete_expand_methods): Force <clinit> first.
859 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
860 - it's already been completed.
861 (patch_initialized_static_field): New function.
862 (java_complete_field): Call it.
863
864 Sat Dec 12 19:21:11 1998 Per Bothner <bothner@cygnus.com>
865
866 * expr.c (encode_newarray_type, build_new_array): New functions.
867 * java-tree.h: Declare build_new_array.
868 * jcf-write.c (patch_newarray): Use build_new_array.
869
870 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
871 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
872
873 * parse.y (patch_new_array_init): Re-organize.
874 Now is passed the actual array (pointer) type of the value.
875 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
876 (patch_array_constructor): Removed - merged into patch_new_array_init.
877 (java_complete_tree): Update patch_new_array_init.
878
879 * jcf-write.c (find_constant_index): New function.
880 (generate_bytecode_insns): Use find_constant_index.
881 (generate_classfile): Use find_constant_index for ConstantValue.
882
883 1998-12-11 Tom Tromey <tromey@cygnus.com>
884
885 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
886 * decl.c (init_decl_processing): Renamed dtable -> vtable.
887 * class.c (make_class_data): Renamed dtable -> vtable, and
888 dtable_method_count -> vtable_method_count.
889
890 Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
891
892 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
893 global variables, initialized.
894 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
895 Declared new global variables.
896 * lex.c (java_lex): Return long_zero_node, float_zero_node,
897 double_zero_node, integer_zero_node upon direct matching.
898 * parse.y (purify_type_name): Added function prototype.
899 (duplicate_declaration_error_p): Consider new_type as potentially
900 being a incomplete type. Use purify_type_name on type string.
901 (method_header): saved_type: unused variable removed. Don't figure
902 return type if method name is invalid.
903 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
904 processed by patch_unaryop.
905 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
906 increment/decrement node into its original type after binary
907 numeric promotion on its operands.
908
909 Thu Dec 10 11:02:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
910
911 * parse.y (array_initializer:): Array init operand is NULL_TREE
912 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
913 now an error. Fixed indentation problems.
914 (patch_string): Handle error_mark_node as an argument.
915 (patch_new_array_init): Fixed indentation problems.
916 (array_constructor_check_entry): Removed check on null wfl_value.
917 Return an error if wfl_value's walk returns an error.
918
919 Wed Dec 9 15:37:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
920
921 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
922 * lex.c (java_lex): Remember column position before advancing one
923 token. Retain location information on OCB_TK.
924 * lex.h (typedef struct java_lc): Added new field.
925 * parse.h (GET_SKIP_TYPE): New macro.
926 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
927 * parse.y (build_new_array_init, patch_new_array_init,
928 patch_array_constructor, maybe_build_array_element_wfl,
929 array_constructor_check_entry): New function prototypes.
930 (switch_block:): Tagged <node>.
931 (OCB_TK): Tagged <operator>.
932 (array_initializer:): Installed actions.
933 (variable_initializer): Build location information on element if
934 necessary.
935 (switch_statement:): Fixed indentation typo.
936 (switch_block:): Redefined default action.
937 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
938 (patch_assignment): Removed duplicate code.
939 (maybe_build_array_element_wfl, build_new_array_init,
940 patch_new_array_init, patch_array_constructor,
941 array_constructor_check_entry): New functions.
942
943 Mon Dec 7 15:13:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
944
945 * parse.y (array_initializer): Tagged <node>.
946 (variable_initializer:): Use default rule.
947 (array_initializer:): Defined actions.
948 (variable_initializers:): Likewise.
949 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
950 non-static field accesses.
951 (patch_invoke): Fixed indentation typo.
952 (java_complete_tree): Likewise.
953 (build_labeled_block): Changed leading comment. Generate an error
954 in case of duplicate loop labels.
955 (patch_conditional_expr): Patch results of string concatenation
956 operations.
957
958 Sun Dec 6 13:45:00 1998 Per Bothner <bothner@cygnus.com>
959
960 * constants.c (find_methodref_index): When the class is an interface,
961 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
962
963 * decl.c (finit_identifier_node): Use "$finit$", rather than
964 "<finit>" (which Sun's verifier rejects).
965 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
966 (generate_field_initialization_code): Removed.
967 (fix_constructors) Don't add call to $finit$ here (wrong order).
968 (patch_method_invocation): Add $finit$ call here.
969
970 * java-tree.h (CALL_USING_SUPER): New macro.
971 * parse.y (patch_invoke): Remove im local variable.
972 (patch_method_invocation, patch_invoke): Don't pass super parameter.
973 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
974 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
975
976 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
977
978 * parse.y (java_complete_tree): Don't complain about unreachable
979 statement if it is empty_stmt_node.
980
981 * jcf-write.c (find_constant_wide): New function.
982 (push_long_const): Use find_constant_wide.
983
984 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
985 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
986 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
987 Emit invokeinterface when calling an interface method.
988 Emit invokespecial also when calling super or private methods.
989
990 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
991
992 Sun Dec 6 13:21:18 1998 Per Bothner <bothner@cygnus.com>
993
994 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
995
996 Thu Dec 3 17:11:12 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
997
998 * java-tree.h (java_layout_seen_class_methods): New function
999 prototype.
1000 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
1001 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
1002 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
1003 * parse.y (method_declarator:): Defined action.
1004 (issue_warning_error_from_context): input_filename saved, set to
1005 the appropriate value and restored after java_error is called.
1006 (build_unresolved_array_type): Fixed comment.
1007 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
1008 (method_header): Deal with return type the same way type are
1009 handled for fields and method's parameters and local variables
1010 types are handled.
1011 (check_method_redefinition): Removed extra CR.
1012 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
1013 (java_layout_seen_class_methods): New function.
1014 (java_layout_classes): Call java_layout_seen_class_methods.
1015
1016 Thu Dec 3 15:56:50 1998 Per Bothner <bothner@cygnus.com>
1017
1018 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
1019
1020 Thu Dec 3 15:08:30 1998 Per Bothner <bothner@cygnus.com>
1021
1022 * jcf-dump.c (main): Fix error message.
1023 * jcf-path.c (add_entry): Style fix.
1024
1025 Wed Dec 2 15:52:25 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1026
1027 * class.c (layout_class_method): Call build_java_argument_signature
1028 on constructors too.
1029 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
1030 (patch_method_invocation): Define a primary when resolving an
1031 expression name. Augmented comment on code checking illegal `this'
1032 usage. Loosened it test by accepting NEW_CLASS_EXPR.
1033
1034 Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1035
1036 * class.c (layout_class_method): Don't report error on non-static
1037 overriding static if the method is private.
1038 * java-tree.h (finish_class): Prototype added.
1039 * lex.c (java_get_line_col): Handle col argument -2 value.
1040 * parse.h: All static method declarations moved to parse.y.
1041 * parse.y: Now contains all static method declarations previously
1042 found in parse.h.
1043 (find_expr_with_wfl, missing_return_error,
1044 unreachable_stmt_error): New functions.
1045 (java_get_real_method_name): Identify constructors bearing class
1046 names in source code compiled classes only.
1047 (java_complete_expand_methods): Call missing_return_error.
1048 (invocation_mode): Private methods invoked as static methods.
1049 (java_complete_tree): Call unreachable_stmt_error.
1050
1051 1998-12-01 Tom Tromey <tromey@cygnus.com>
1052
1053 * Makefile.in (+target): Removed.
1054 (+xmake_file): Likewise.
1055 (+tmake_file): Likewise.
1056 (.NOEXPORT): Removed duplicate.
1057
1058 Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1059
1060 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
1061
1062 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
1063
1064 * jvgenmain.c: Remove the xmalloc prototype, we get it from
1065 libiberty.h. Provide an xmalloc definition.
1066
1067 * jvspec.c: Remove the xmalloc prototype.
1068
1069 * parse-scan.y: Include config.h and system.h. Don't include
1070 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
1071 Provide an xstrdup definition.
1072
1073 Wed Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
1074
1075 * jcf-path.c (add_entry): recognize ".jar" too
1076 * lang-specs.h: ditto
1077
1078 Thu Nov 26 12:44:07 1998 Per Bothner <bothner@cygnus.com>
1079
1080 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
1081 soft_monitorenter_node, soft_monitorexit_node, throw_node.
1082
1083 * jcf-write.c (generate_bytecode_insns):
1084 Handle pre/post-increment/decrement of long.
1085
1086 * jcf-write.c (generate_bytecode_insns):
1087 Handle missing exception handler (finally for synchronized).
1088
1089 Wed Nov 25 09:47:15 1998 Per Bothner <bothner@cygnus.com>
1090
1091 * java-tree.h (end_params_node): Declare global.
1092 * decl.c (end_params_node): New global.
1093 (init_decl_processing, start_java_method): Use end_params_node for
1094 end of list of parameter types. Follows correct gcc conventions.
1095 * expr.c (pop_argument_types, pop_arguments): Likewise.
1096 * lang.c (put_decl_node): Likewise.
1097 * typeck.c (various places): Likewise.
1098 * class.y (various places): Likewise.
1099 * parse.y (various places): Likewise.
1100
1101 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
1102 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
1103
1104 * class.c: Add #include flags.h, remove no-longer needed declaration.
1105
1106 * class.c (layout_class_method): Remove commented-out code, re-format.
1107 Don't add vtable entry (or index) for private methods.
1108 * expr.c (expand_invoke): A private method is implicitly final.
1109 * class.c (make_class_data): If inlining or optimizing,
1110 skip private methods.
1111
1112 * class.c (finish_class): New function. Calls existing methods,
1113 but alls emits deferred inline functions.
1114 * jcf-parse.c (parse_class_file): Call finish_class.
1115 * parse.y (java_complete_expand_methods): Likewise.
1116
1117 * expr.c (build_java_binop): Explicit default, to silence -Wall.
1118
1119 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
1120
1121 Wed Nov 25 00:50:58 1998 Marc Espie <espie@quatramaran.ens.fr>
1122
1123 * jcf-write.c (generate_bytecode_conditional): Fix typo.
1124
1125 Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com>
1126
1127 * (generate_classfile): Always write class access flag with
1128 ACC_SUPER set.
1129
1130 Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1131
1132 * class.c (maybe_layout_super_class): New function.
1133 (layout_class): Reorganized. Loop on class methods dispatched into
1134 a new function. Call maybe_layout_super_class.
1135 (layout_class_methods, layout_class_method): New functions.
1136 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
1137 class.
1138 (expand_invoke): Likewise.
1139 * java-tree.h (all_class_list): New global variable declared.
1140 (layout_class_methods, layout_class_method): New function
1141 prototypes.
1142 (LAYOUT_SEEN_CLASS_METHODS): New macro.
1143 * jcf-parse.c (all_class_list): New global variable.
1144 (load_class): Extended what class_or_name can be. Use parser
1145 context mechanism to save globals before calling jcf_parse.
1146 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
1147 is set on the file name.
1148 (jcf_parse): Layout class methods when Object is loaded, otherwise
1149 record class in all_class_list for delayed method layout.
1150 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
1151 * lang.c (put_decl_node): Decode <init> into the decl context
1152 class name.
1153 * lex.c (java_allocate_new_line): Use xmalloc.
1154 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
1155 pointers, not TREE_LIST elements.
1156 (struct parser_ctxt): Fixed comment indentations, added comments
1157 and reordered some fields.
1158 (java_check_methods): Function prototype removed.
1159 * parse.y (java_push_parser_context): Use xmalloc.
1160 (java_parser_context_restore_global): Pop extra pushed ctxp only
1161 when there's nothing next.
1162 (maybe_create_class_interface_decl): Fixed comment, add new
1163 created class decl to all_class_list.
1164 (method_header): Use GET_REAL_TYPE on argument's types.
1165 (method_declarator): Use GET_REAL_TYPE, change type to the real
1166 type in TREE_LIST dependency node. Build argument list with the
1167 real type.
1168 (create_jdep_list): Use xmalloc. Removed allocation error message.
1169 (obtain_incomplete_type): Fixed leading comment. Broadened
1170 incoming argument meaning.
1171 (register_incomplete_type): Use xmalloc. Removed allocation error
1172 message.
1173 (safe_layout_class): Fixed leading comment.
1174 (jdep_resolve_class): Reversed if statement condition and switch
1175 if and else bodies.
1176 (resolve_and_layout): Fixed leading comment. Broadened incoming
1177 argument meaning.
1178 (complete_class_report_errors): New local variable name, for
1179 clarity. purify_type_name used for all error cases.
1180 (java_get_real_method_name): Stricter check on constructors.
1181 (java_check_regular_methods): Reverse methods list only if not
1182 already laid out. Layout artificial constructor.
1183 (java_check_methods): Deleted.
1184 (source_start_java_method): Obtain incomplete type for patchable
1185 method arguments.
1186 (java_layout_classes): Fixed leading comment. Use
1187 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
1188 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
1189 before returning. Fixed comments.
1190 (java_expand_classes): Check for errors up front.
1191 (patch_method_invocation): Class to search is resolved and laid
1192 out.
1193
1194 Tue Nov 24 12:57:13 1998 Per Bothner <bothner@cygnus.com>
1195
1196 * expr.c (java_lang_expand_expr): Add missing emit_queue.
1197
1198 * javaop.h (int8): Removed - not used.
1199 (jbyte): Redefine portably with correct signedness.
1200
1201 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
1202
1203 * jcf-write.c (generate_bytecode_insns): Fix typo
1204 OPCODE_getstatic to OPCODE_getfield.
1205
1206 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
1207 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
1208 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
1209
1210 Thu Nov 19 11:16:55 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1211
1212 * jcf-parse.c (jcf_parse_source): Function returned type is
1213 void. Added prototype.
1214 (jcf_parse): Function returned type is void.
1215 (yyparse): Remove call to fclose on the last parsed file.
1216
1217 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
1218
1219 Wed Nov 18 23:54:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1220
1221 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
1222 (layout_class): Cope with methods featuring WFL in decl names.
1223 * decl.c (unqualified_object_id_node): New global variable,
1224 initialized.
1225 (build_decl_no_layout): Removed.
1226 * expr.c (build_primtype_type_ref): Handle Double.
1227 (java_lang_expand_expr): Fixed indentations.
1228 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
1229 (flag_wall, flag_redundant, flag_not_overriding,
1230 flag_static_local_jdk1_1, unqualified_object_id_node): Global
1231 variable declarations.
1232 (build_decl_no_layout): Removed prototype.
1233 (java_get_real_method_name): Added prototype.
1234 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
1235 (java_parse_abort_on_error): Macro now just returns.
1236 * jcf-parse.c (jcf_parse_source): Check fclose returned
1237 value. Call emit_register_classes if java_report_errors returns
1238 zero.
1239 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
1240 flag_static_local_jdk1_1): New integer flags.
1241 (lang_decode_option): New flags set here.
1242 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
1243 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
1244 the flag_redundant variable.
1245 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
1246 when parsing java.lang.Object class.
1247 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
1248 NULL_TREE to build.
1249 (resolve_qualified_expression_name): Fixed indentation.
1250 (patch_array_ref): Changed prototype.
1251 (not_initialized_as_it_should_p): Prototype removed.
1252 (java_report_errors): Added function prototype.
1253 * parse.y (formal_parameter:): Changed error message for not yet
1254 supported final parameters.
1255 (class_type_list:): Set both PURPOSE and VALUE of created
1256 TREE_LIST to be class_type.
1257 (primary_no_new_array:): Handle class literals on primitive types.
1258 (parse_warning_context): Reinstalled correct force_error and
1259 do_warning flags setups.
1260 (java_report_errors): Changed prototype. Return java_error_count
1261 value.
1262 (variable_redefinition_error): Consider treating variable type as
1263 a fake pointer.
1264 (create_interface): Warn about redundant abstract modifier if
1265 flag_redundant is set. Changed error message.
1266 (lookup_field_wrapper): Save/restore globals before/after looking
1267 up field.
1268 (duplicate_declaration_error_p): Consider treating declaration
1269 type as a fake pointer.
1270 (register_fields): Extract real type from dependency node. Check
1271 for duplicate field declaration after type adjustment. Use
1272 DECL_INITIAL to store static final initialized values.
1273 (method_header): Extract real function type from dependency node.
1274 (check_abstract_method_header): Use GET_METHOD_NAME.
1275 (obtain_incomplete_type): Layout fake pointer type.
1276 (safe_layout_class): Don't try to check for methods before layout.
1277 (java_complete_class): Don't check for correct throws clause
1278 elements inheritance here.
1279 (resolve_and_layout): Broadened name parameter meaning.
1280 (reset_method_name): Use GET_METHOD_NAME.
1281 (java_get_real_method_name): New function.
1282 (java_check_regular_methods): Don't check methods in
1283 java.lang.Object. Verify lineage of throws clause elements. Use
1284 flag_no_overriding in warning report.
1285 (check_throws_clauses): Don't check if class was from
1286 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
1287 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
1288 (declare_local_variables): Use flag_static_local_jdk1_1 to report
1289 warning on unsupported final local variables. Use build_decl
1290 instead of build_decl_no_layout. Get real local variable type from
1291 dependency node.
1292 (source_start_java_method): Get real parameter type from
1293 dependency node. Call build_decl instead of build_decl_no_layout.
1294 (java_layout_classes): Reverse tree and layout type and class as
1295 required. Mark class as loaded when done.
1296 (resolve_field_access): Fixed indentation. Restricted condition
1297 leading to static field access code generation. Set field_type
1298 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
1299 (resolve_qualified_expression_name): Initialize type_found to
1300 null. Handle static field resolved during qualification. Fixed
1301 layout on non primitive field decl types.
1302 (not_accessible_p): Fixed typo in comment.
1303 (patch_method_invocation): Resolve and layout class to search from
1304 type.
1305 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
1306 layout non primitive type, if necessary. Make method node only to
1307 report errors.
1308 (find_applicable_accessible_methods_list): Consider WFL'ed method
1309 decl names. Fixed indentation.
1310 (argument_types_convertible): Resolve and layout target type if
1311 necessary.
1312 (java_complete_tree): Fixed indentation problems. Rewrote
1313 CALL_EXPR thrown exceptions check. Re-installed further processing
1314 of the assignment in certain cases.
1315 (patch_assignment): Call maybe_build_primttype_type_ref to perform
1316 inlining on class literals.
1317 (valid_builtin_assignconv_identity_widening_p): Cope with constant
1318 0 literal.
1319 (valid_method_invocation_conversion_p): Likewise.
1320 (patch_string): Temporary disable forbidden use of `this' in
1321 explicit constructor invocations when doing string concatenation
1322 within their scope.
1323 (patch_unaryop): Added comment. Reinstalled code to disable
1324 further check on assignment operation with cast expression RHS.
1325 (patch_switch_statement): Fixed indentation.
1326 (build_try_statement): Call build_decl instead of
1327 build_decl_no_layout.
1328 (patch_synchronized_statement): Likewise.
1329 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
1330 IS_UNCHECKED_EXPRESSION_P.
1331 (check_thrown_exceptions_do): Changed leading comment. Resolve and
1332 layout argument exception type.
1333 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
1334 of IS_UNCHECKED_EXPRESSION_P.
1335
1336 Wed Nov 18 14:21:48 1998 Anthony Green <green@cygnus.com>
1337
1338 * jcf-parse.c (yyparse): Open class file in binary mode.
1339
1340 Sun Nov 15 17:14:17 1998 Per Bothner <bothner@cygnus.com>
1341
1342 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
1343
1344 * jcf-write.c (perform_relocations): Move check out one loop.
1345
1346 Sun Nov 15 15:09:56 1998 Anthony Green <green@hoser.cygnus.com>
1347
1348 * Make-lang.in: Fix reference to srcdir.
1349 * jv-scan.c: Add missing xmalloc prototype.
1350 * jvgenmain.c: Ditto.
1351
1352 Sun Nov 15 14:36:29 1998 Per Bothner <bothner@cygnus.com>
1353
1354 * decl.c (error_mark_node), java-tree.h: New global.
1355 * parse.y: Use empty_stmt_node instead of size_zero_node.
1356 (build_if_else_statement): If missing else, use empty_stmt_node.
1357
1358 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
1359 (java_complete_expand_method): Complain if return is missing.
1360 (java_check_regular_methods): Comment out incorrect error check.
1361 (not_accessible_p): Fix incorrect handling of protected methods.
1362 (patch_method_invocation): Pass correct context to not_accessible_p.
1363 (find_applicable_accessible_methods_list): Likewise.
1364 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
1365 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
1366 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
1367 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
1368
1369 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
1370 (push_int_const): Remove reundant NOTE_PUSH.
1371 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
1372 (- case SWITCH_EXPR): Fix code generation bug.
1373 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
1374 (generate_classfile): More robust for abstract methods.
1375
1376 Sun Nov 15 13:52:39 1998 Anthony Green <green@cygnus.com>
1377
1378 * Makefile.in: jv-scan and jvgenmain all require libiberty.
1379 * Make-lang.in: Ditto.
1380
1381 * jv-scan.c: Remove xmalloc and xstrdup definitions.
1382 * jvgenmain: Ditto.
1383
1384 Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
1385
1386 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
1387
1388 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
1389
1390 Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
1391
1392 Allow uses of interface types to verify. This is not really
1393 type-safe, but it matches what Sun does, and is OK as long as
1394 there are appropriate run-time checks.
1395 * verify.c (merge_types): If merging two interface types,
1396 just set the result to java.lang.Object.
1397 * expr.c (pop_type): Any interface is matches by java.lang.Object.
1398
1399 1998-11-13 Tom Tromey <tromey@cygnus.com>
1400
1401 * gjavah.c (main): Handle --output-class-directory argument.
1402 * jvspec.c (lang_specific_driver): Translate `-d' into
1403 -foutput-class-dir.
1404 * jcf.h (jcf_write_base_directory): Declare.
1405 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
1406 * lang-options.h: Mention -foutput-class-dir.
1407 * jcf-write.c (jcf_write_base_directory): New global.
1408 (make_class_file_name): Put generated .class file into `-d'
1409 directory, or into source directory if -d not given. Function now
1410 static.
1411 (write_classfile): Free class file name. Handle case where class
1412 file name is NULL.
1413 (DIR_SEPARATOR): New macro.
1414 Include <sys/stat.h>
1415
1416 * Makefile.in (prefix): New macro.
1417
1418 Thu Nov 12 14:15:07 1998 Per Bothner <bothner@cygnus.com>
1419
1420 * parse.y (patch_invoke): Do less if flag_emit_class_files.
1421 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
1422 here (done in patch_invoke instead).
1423 (case_identity): Moved here from parse.y.
1424
1425 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
1426 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
1427 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
1428 so they can be efficiently scanned without recursion.
1429 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
1430 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
1431 in BLOCK iteratively, rather than recursively.
1432
1433 * parse.y (do_unary_numeric_promotion): New function.
1434 (patch_unaryop, patch_binop, patch_array_ref): Use it.
1435
1436 * parse.y (patch_newarray): Various fixes.
1437
1438 Re-do handling of switch statements (for proper block scoping).
1439 * parse.y: Add just a single block for the enture switch block,
1440 but don't create any "case blocks".
1441 (group_of_labels): Rmeoved unneeded non-terminal.
1442 CASE_EXPR and DEFAULT_EXPR are added to current block.
1443 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
1444 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
1445 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
1446 * parse.y (wfl_operator, print_int_node): Make non-static.
1447 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
1448 as part of recursive scan of block.
1449 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
1450 (patch_switch_statement): Most tests move dinto java_complete_tree.
1451
1452 * parse.y: Make various production be non-typed (void).
1453 * parse.y (parse_error): Merged into issue_warning_error_from_context.
1454 * parse.y (add_stmt_to_compound): Don't create/change extra node.
1455 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
1456
1457 * jcf-write.c (struct jcf_handler): New type.
1458 (struct jcf_switch_state): New type.
1459 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
1460 (alloc_handler, emit_unop, emit_reloc): New functions.
1461 (adjust_typed_op): Add extra parameter ("max type" offset).
1462 (emit_switch_reloc, emit_case-reloc): New function.
1463 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
1464 (generate_bytecode_insns): Support REAL_CST, switch statements,
1465 exception handling, method calls, object/array creation, and more.
1466
1467 * class.c: Remove some unused variables.
1468 * constants.c (find_string_constant): New function.
1469 (count_constant_pool_bytes): Fix to correctly handle wide constants.
1470 * decl.c (complete_start_java_method): Don't _Jv_InitClass
1471 if flag_emit_class_files.
1472
1473 1998-11-12 Tom Tromey <tromey@cygnus.com>
1474
1475 * jcf-io.c (find_class): Added explanatory comment.
1476
1477 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
1478 trailing slash to `.zip' entries.
1479
1480 * jvspec.c (lang_specific_driver): Correctly handle case where
1481 GC_NAME not defined.
1482
1483 1998-11-11 Tom Tromey <tromey@cygnus.com>
1484
1485 * jvspec.c (GC_NAME): New define.
1486 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
1487 if required.
1488 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
1489
1490 Wed Nov 11 19:08:52 1998 Per Bothner <bothner@cygnus.com>
1491
1492 * jcf-dump.c (TABLE_SWITCH): Fix typos.
1493
1494 1998-11-11 Tom Tromey <tromey@cygnus.com>
1495
1496 * jcf-dump.c (main): Correctly recognize `--'-style long options.
1497
1498 Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1499
1500 * class.c (is_compiled_class): Call safe_layout_class for class
1501 compiled from source.
1502 * conver.h (convert_to_integer, convert_to_real,
1503 convert_to_pointer): Added prototypes.
1504 * decl.c (init_decl_processing): Non longer push the decls of
1505 `methodtable', `constants', `Class', `Field', `dispatchTable'
1506 `jexception' and `Method'.
1507 * expr.c (build_invokeinterface): New function.
1508 (expand_invoke): static variable CLASS_IDENT now in
1509 build_invokeinterface. Use build_invokeinterface.
1510 (expand_java_field_op): Moved code to inline
1511 java.lang.PRIMTYPE.TYPE into a function.
1512 (build_primtype_type_ref): New function.
1513 * java-tree.def (INSTANCEOF_EXPR): New tree code.
1514 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
1515 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
1516 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
1517 (DECL_LOCAL_STATIC_VALUE): New macro.
1518 (build_invokeinterface, build_primtype_type_ref): New function
1519 prototypes.
1520 (java_parse_abort_on_error): Macro rewritten.
1521 * jcf-parse.c (current_method): Add comment to declaration.
1522 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
1523 Function prototypes fixed.
1524 (jcf_parse_source): push/pop parser context. save/restore global.
1525 (parse_source_file): Fixed leading comment. Now take a
1526 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
1527 classes and pop the parser context anymore.
1528 (yyparse): Push parser context, save globals, parse the source
1529 file, restore globals and pop the parser context when processing a
1530 source file.
1531 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
1532 * lex.c (java_parse_doc_section): New function.
1533 (java_lex): Call java_parse_doc_section when appropriate. Build an
1534 operator around INSTANCEOF_TK.
1535 * lex.h (java_lineterminator, java_sprint_unicode,
1536 java_unicode_2_utf8, java_lex_error, java_store_unicode):
1537 Prototypes rewritten.
1538 (java_parse_escape_sequence, java_letter_or_digit_p,
1539 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
1540 java_read_unicode, java_store_unicode, java_read_char,
1541 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
1542 Added function prototypes.
1543 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
1544 define.
1545 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
1546 New macros
1547 (struct parser_ctxt): New fields: deprecated,
1548 current_parsed_class_un, gclass_list.
1549 (fix_method_argument_names, issue_warning_error_from_context,
1550 resolve_package, lookup_package_type): New function prototypes.
1551 (resolve_expression_name): Fixed function prototype.
1552 (find_applicable_accessible_methods_list): Fixed indentation, added
1553 extra argument in prototype.
1554 (check_final_assignment, build_null_of_type, check_deprecation,
1555 check_method_redefinition, reset_method_name,
1556 java_check_regular_methods, java_check_abstract_methods,
1557 maybe_build_primttype_type_ref): New function prototype.
1558 * parse.y (conver.h): Include.
1559 (INSTANCEOF_TK): Tagged <operator>.
1560 (single_type_import_declaration): Use REGISTER_IMPORT macro.
1561 (relational_expression:): Build binop for instanceof.
1562 (java_push_parser_context): Remember ctxp->gclass_list across
1563 contexts.
1564 (java_pop_parser_context): Simply return if no context
1565 exists. Remember gclass_list across contexts.
1566 (issue_warning_error_from_context): New function.
1567 (parse_error_context): Don't setup ctxp->elc here. Call
1568 issue_warning_error_from_context instead.
1569 (parse_warning_context): Likewise.
1570 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
1571 setup. Link new class/interface to ctxp->gclass_list.
1572 (add_superinterfaces): Register interface as incomplete if not
1573 loaded.
1574 (create_class): Remember class unqualified name in
1575 ctxp->current_parsed_class_un. Check class deprecation.
1576 (register_fields): Check field deprecation. Remember static final
1577 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
1578 processing INIT.
1579 (method_header): New local variable ORIG_ARG. Use unqualified
1580 current class name for check on constructor errors. Promote return
1581 type if of record type. Argument list fix moved in
1582 fix_method_argument_names, called here. Check method deprecation.
1583 (fix_method_argument_names): New function.
1584 (method_declarator): Promote record typed arguments.
1585 (safe_layout_class): Check class methods before layout.
1586 (java_complete_class): Compute field layout when patched.
1587 (do_resolve_class): Try to load class after having it renamed
1588 after the package name.
1589 (get_printable_method_name): Use DECL_CONTEXT.
1590 (reset_method_name): New function.
1591 (check_method_redefinition): Use reset_method_name.
1592 (java_check_regular_methods): New local variable
1593 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
1594 names for error report. Check for compile-time error when method
1595 found has default (package) access.
1596 (java_check_abstract_methods): Now takes an interface DECL node as
1597 an argument. Also reinstall real name on unchecked
1598 overriding/hiding methods for error report.
1599 (java_check_methods): Fixed leading comment. Get classes to verify
1600 from ctxp->gclass_list. Use CHECK_METHODS macro and set
1601 CLASS_METHOD_CHECKED_P on class verification.
1602 (lookup_java_method2): Get real method name if necessary.
1603 (find_in_imports): Don't check package class access here.
1604 (resolve_package, lookup_package_type): New functions.
1605 (java_layout_classes): Fixed leading comment. Take classes to be
1606 laid out from ctxp->gclass_list.
1607 (java_complete_expand_methods): Don't expand native and abstract
1608 methods.
1609 (java_expand_classes): New function.
1610 (resolve_expression_name): Use additional argument ORIG. Retrieve
1611 values of static final field of primitive types.
1612 (resolve_field_access): Handles static final field of promotive
1613 type.
1614 (resolve_qualified_expression_name): Handle STRING_CST as
1615 primaries and package name resolution. Check deprecation on found
1616 decls. Set where_found and type_found on non static field resolved
1617 during qualification. Layout non primitive field decl types.
1618 (check_deprecation): New function.
1619 (maybe_access_field): Simplified.
1620 (patch_method_invocation_stmt): Local variable CLASS_TYPE
1621 removed. Reverse method's argument when primary is a type. Don't
1622 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
1623 instead. Include abstract class in the list of class searchable
1624 for constructors. Use DECL_CONTEXT of found method for access
1625 checks. Check method deprecation.
1626 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
1627 converting arguments. Handle INVOKE_INTERFACE.
1628 (lookup_method_invoke): Search constructor using existing
1629 infrastructure (don't rely on lookup_java_constructor anymore).
1630 (find_applicable_accessible_methods_list): Extra argument flag
1631 LC. Now include constructor in the search.
1632 (qualify_ambiguous_name): Conditional expression are primaries.
1633 (not_initialized_as_it_should_p): static final are always
1634 initialized.
1635 (java_complete_tree): Pass extra NULL argument to
1636 resolve_expression_name. Stricter test to carry on patching
1637 assignments. New case for INSTANCEOF_EXPR.
1638 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
1639 (check_final_assignment, maybe_build_primttype_type_ref): New
1640 functions.
1641 (patch_assignment): Detect resolved static finals and carry normal
1642 assignment error check on them. Inline PRIMTYPE.TYPE read access.
1643 (try_builtin_assignconv): Access constant 0 on all primitive
1644 types.
1645 (valid_builtin_assignconv_identity_widening_p): Accept identical
1646 types. Accept all promoted type on int type.
1647 (valid_ref_assignconv_cast_p): Accept a null pointer to be
1648 assigned to a reference.
1649 (valid_method_invocation_conversion_p): Accept to check null
1650 pointers.
1651 (build_binop): Merge declaration and initialization of local
1652 variable BINOP.
1653 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
1654 numeric types. Improved validity test for qualify operators on
1655 references.
1656 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
1657 and PREINCREMENT_EXPR. Also detect resolved static finals of a
1658 primitive type and issue the appropriate error message.
1659 (resolve_type_during_patch): Mark class loaded when resolved.
1660 (patch_cast): Allow null to be cased to reference types.
1661 (build_null_of_type): New function.
1662 (patch_array_ref): Handle array on references correctly.
1663 (patch_return): Removed unused local variable MODIFY. Force
1664 boolean to be returned as integers. Allows null to be returned by
1665 a function returning a reference.
1666 * typeck.c (convert_to_integer, convert_to_real,
1667 convert_to_pointer): Prototypes moved to convert.h
1668 (lookup_argument_method): Use method real name, if necessary.
1669
1670 1998-10-30 Tom Tromey <tromey@cygnus.com>
1671
1672 * class.c (build_class_ref): Changed name of primitive classes to
1673 start with `_Jv_'.
1674
1675 * class.c (make_class_data): Renamed fields: nmethods to
1676 method_count, method_count to dtable_method_count. Always set
1677 `state' field to 0.
1678 * decl.c (init_decl_processing): Likewise.
1679
1680 Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1681
1682 * class.c (layout_class): Don't mangle <finit>, produce
1683 __finit<class> instead. Don't verify artificial methods.
1684 * decl.c (finit_identifier_node): New declared global.
1685 (init_decl_processing): finit_identifier_node initialized.
1686 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
1687 * java-tree.h (finit_identifier_node): Declared as extern.
1688 (struct lang_decl): New field called_constructor.
1689 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
1690 (CLASS_HAS_FINIT_P): New macro.
1691 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
1692 explicit constructor invocation.
1693 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
1694 CALL_SUPER_CONSTRUCTOR_P): New macros.
1695 (write_classfile): Added prototype.
1696 * jcf-parse.c (jcf_parse_source): Parse and remember for
1697 generation if the file was seen on the command line.
1698 (parse_source_file): Don't write the class file here.
1699 (yyparse): Loop on files rewritten. Set current_jcf.
1700 (parse_zip_file_entries): Parse class file only if it was found.
1701 * lang.c (init_parse): Don't open command line provided filename
1702 here.
1703 (lang_parse): Don't set main_jcf anymore.
1704 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
1705 (JCONSTRUCTOR_CHECK): New macro.
1706 (JBSC_TYPE_P): New macro.
1707 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
1708 (COMPLETE_CHECK_OP_2): New macro.
1709 (struct parse_ctxt): New field explicit_constructor_p.
1710 (check_class_interface_creation): Fixed prototype indentation.
1711 (patch_method_invocation_stmt): Prototype reflects added argument.
1712 (patch_invoke): Likewise.
1713 (complete_method_declaration, build_super_invocation,
1714 verify_constructor_circularity,
1715 build_this_super_qualified_invocation, get_printable_method_name,
1716 patch_conditional_expr, maybe_generate_finit, fix_constructors,
1717 verify_constructor_super, create_artificial_method,
1718 start_artificial_method_body, end_artificial_method_body,
1719 generate_field_initialization_code): New function prototypes.
1720 * parse.y: Fixed leading comment
1721 (constructor_header:, constructor_body:, block_end:): Rules tagged
1722 <node>.
1723 (type_declaration:): Call maybe_generate_finit.
1724 (method_declaration:): Action for method_body: placed in new
1725 function complete_method_declaration, called here.
1726 (constructor_declaration:): Defined actions. Removed leading
1727 FIXME.
1728 (constructor_header:): New rule with action.
1729 (constructor_body:): Rule rewritten using block_begin: and
1730 block_end:. Defined actions.
1731 (constructor_declarator:, explicit_constructor_invocation:):
1732 Defined actions.
1733 (block:): Use new rules block_begin: block_end:.
1734 (block_begin:, block_end:): New rules and actions.
1735 (block_statements:): Fixed error message for explicit
1736 constructors.
1737 (method_invocation:): Call build_this_super_qualified_invocation
1738 if primary is `this' or `super' was seen.
1739 (conditional_expression:): Action defined.
1740 (extra_ctxp_pushed_p): New static global flag.
1741 (java_parser_context_save_global): Create parser context if
1742 necessary. Use extra_ctxp_pushed_p to remember it.
1743 (java_parser_context_restore_global): Pop extra parser context if
1744 one exists.
1745 (build_array_from_name): Array on primitive types are marked
1746 loaded.
1747 (register_fields): Restore new name in field initializer
1748 expression if type was altered. Non static fields initialized upon
1749 declaration marked initialized.
1750 (maybe_generate_finit): New function.
1751 (maybe_generate_clinit): Use create_artificial_method,
1752 start_artificial_method_body, end_artificial_method_body. Generate
1753 debug info for enclosed initialization statements.
1754 (method_header): Fixed leading comment. Check constructor
1755 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
1756 accordingly.
1757 (complete_method_declaration, constructor_circularity_msg,
1758 verify_constructor_circularity): New functions.
1759 (get_printable_method_name): New function.
1760 (check_method_redefinition): Don't rename <finit> methods. Fix
1761 declared constructor names. Error message for
1762 constructors modified.
1763 (java_check_regular_methods): Local variable seen_constructor
1764 renamed saw_constructor. Skip verification on constructors. Create
1765 default constructor with create_artificial_method.
1766 (java_check_methods): Removed unnecessary empty line.
1767 (create_artificial_method, start_artificial_method_body,
1768 end_artificial_method_body): New functions.
1769 (java_layout_classes): Changed leading comment. Reverse fields
1770 list if necessary. Always layout java.lang.Object if being
1771 defined.
1772 (java_complete_expand_methods): Verify constructor circularity.
1773 (java_complete_expand_method): Call fix_constructor on
1774 constructors. Local variable no_ac_found removed. Restore
1775 bindings if method body expansion failed.
1776 (fix_constructors, verify_constructor_super,
1777 generate_field_initialization_code): New function.
1778 (java_expand_classes): Fixed leading comment. Write class file
1779 here.
1780 (resolve_expression_name): Check for illegal instance variable
1781 usage within the argument scope of an explicit constructor
1782 invocation.
1783 (resolve_qualified_expression_name): Pass extra from_super flag
1784 when invoking patch_method_invocation_stmt. New case for
1785 conditional expression when used as a primary. Check for error
1786 when acquiring super.
1787 (patch_method_invocation_stmt): Added extra argument super. New
1788 local variable is_static_flag. Set class_to_search according to
1789 the nature of the constructor invocation. Don't add `this'
1790 argument when expanding NEW_CLASS_EXPR. Check for illegal method
1791 invocation within the argument scope of explicit constructor
1792 invocation. Set is_static according to is_static_flag. Provide
1793 extra `super' argument to patch_invoke invocation.
1794 (patch_invoke): New argument from_super. Loop on arguments
1795 indentation fixed. Pass from_super to invocation_mode. New switch
1796 case INVOKE_SUPER. Fixed error message in switch default case.
1797 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
1798 value.
1799 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
1800 (lookup_method_invoke): Fixed prototypes in candidates list. Error
1801 message takes constructors into account.
1802 (find_applicable_accessible_methods_list): Fixed indentation.
1803 (qualify_ambiguous_name): Take explicit constructor invocation
1804 into account. Deal with a conditional expression as a primary to
1805 a method call.
1806 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
1807 case. Added extra argument to patch_method_invocation_stmt.
1808 Register calls made to explicit constructor `this'. Don't call
1809 save_expr in ARRAY_REF case when emitting class files. Check for
1810 illegal use of this when expanding explicit constructor invocation
1811 arguments.
1812 (complete_function_arguments): Set and reset parser context
1813 explicit_constructor_p field value when appropriate.
1814 (build_super_invocation, build_this_super_qualified_invocation):
1815 New functions.
1816 (patch_assignment): Fixed typo.
1817 (patch_unaryop): Check on final fields occurs only when a decl
1818 exits.
1819 (patch_return): Take constructors into account.
1820 (patch_conditional_expr): New function.
1821 * typeck.c (build_java_signature): Removed unnecessary empty line.
1822
1823 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
1824
1825 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
1826
1827 1998-10-28 Tom Tromey <tromey@cygnus.com>
1828
1829 * decl.c (init_decl_processing): Renamed fields.
1830 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
1831 interface_len, msize fields.
1832
1833 * class.c (make_class_data): Removed subclass_head and
1834 subclass_next fields.
1835 * decl.c (init_decl_processing): Removed subclass_head and
1836 subclass_next fields.
1837
1838 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
1839
1840 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
1841 * mangle.c (emit_unicode_mangled_name): Similarly.
1842
1843 Mon Oct 26 12:17:23 1998 Nick Clifton <nickc@cygnus.com>
1844
1845 * jcf-parse.c (get_constant): Place braces around code to compute
1846 'd' when REAL_ARITHMETIC is not defined.
1847
1848 Sun Oct 25 14:58:05 1998 H.J. Lu (hjl@gnu.org)
1849
1850 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
1851 dependency.
1852
1853 1998-10-23 Tom Tromey <tromey@cygnus.com>
1854
1855 * lang-specs.h: `.zip' files are input to jc1.
1856
1857 Thu Oct 22 23:01:54 1998 Per Bothner <bothner@cygnus.com>
1858
1859 * jvspecs.c: Add (but don't enable) support for combining multiple
1860 .class and .java input filenames to a single jc1 invocation.
1861 Add support for -C flag (copile to .class files).
1862 Translate -classpath and -CLASSPATH arguments.
1863 * lang-specs.h: Don't set %2 spec.
1864
1865 1998-10-22 Tom Tromey <tromey@cygnus.com>
1866
1867 * jcf-path.c (add_entry): Don't add trailing separator if entry is
1868 a .zip file.
1869 (add_path): Don't add trailing separator to non-empty path
1870 elements.
1871
1872 * lang.c (lang_decode_option): Check for -fclasspath and
1873 -fCLASSPATH before examining other `-f' options.
1874
1875 * java-tree.h (finalize_identifier_node): Don't declare.
1876 * class.c (make_class_data): Don't push "final" field.
1877 * decl.c (init_decl_processing): Don't push "final" field.
1878 (finalize_identifier_node): Removed.
1879 (init_decl_processing): Don't set finalize_identifier_node.
1880
1881 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
1882
1883 Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
1884
1885 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
1886 (JV_SCAN_SOURCES): New macro.
1887 (JCF_DUMP_SOURCES): Likewise.
1888 (jcf-dump$(exeext)): New target.
1889 (jv-scan$(exeext)): New target.
1890
1891 1998-10-22 Tom Tromey <tromey@cygnus.com>
1892
1893 * Makefile.in (LEX): Removed.
1894 (LEXFLAGS): Likewise.
1895 (SET_BISON): New macro.
1896 (BISON): Removed.
1897 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
1898 spurious diffs in parse.c.
1899 ($(PARSE_SCAN_C)): Likewise.
1900 (PARSE_DIR): New macro.
1901 (PARSE_C): Use it.
1902 (PARSE_SCAN_C): Likewise.
1903 (PARSE_RELDIR): New macro.
1904
1905 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
1906
1907 * jcf-io.c (find_class): Use saw_java_source to determine when to
1908 look for `.java' file.
1909 * jcf-parse.c (saw_java_source): New global.
1910 (yyparse): Set it if `.java' file seen.
1911
1912 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
1913 (GCJH_SOURCES): Likewise.
1914 * Makefile.in (datadir): New macro.
1915 (libjava_zip): Likewise.
1916 (JAVA_OBJS): Added jcf-path.o.
1917 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
1918 (../gcjh$(exeext)): Likewise.
1919 (jcf-path.o): New target.
1920 * java-tree.h (fix_classpath): Removed decl.
1921 * jcf-parse.c (fix_classpath): Removed.
1922 (load_class): Don't call fix_classpath.
1923 * parse.y (read_import_dir): Don't call fix_classpath.
1924 * lex.h: Don't mention classpath.
1925 * lex.c (java_init_lex): Don't initialize classpath.
1926 * jcf-io.c (classpath): Removed global.
1927 (find_class): Use jcf_path iteration functions. Correctly search
1928 class path for .java file.
1929 (open_in_zip): New argument `is_system'.
1930 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
1931 classpath-related options.
1932 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
1933 and -I.
1934 (lang_init): Call jcf_path_init.
1935 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
1936 * lang-specs.h: Handle -I. Minor cleanup to -M options.
1937 Correctly put braces around second string in each entry.
1938 * gjavah.c (main): Call jcf_path_init. Recognize all the new
1939 classpath-related options.
1940 (help): Updated for new options.
1941 * jcf.h: Declare functions from jcf-path.c. Don't mention
1942 `classpath' global.
1943 * jcf-path.c: New file.
1944
1945 * jcf-depend.c: Include jcf.h.
1946
1947 * jcf-write.c (localvar_alloc): Returns `void'.
1948 (localvar_free): Removed unused variable.
1949
1950 * lang.c (OBJECT_SUFFIX): Define if not already defined.
1951 (init_parse): Use OBJECT_SUFFIX, not ".o".
1952
1953 Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1954
1955 * class.c (emit_register_classes): Renamed from
1956 emit_register_class.
1957 * java-tree.h (emit_register_classes): Prototype renamed from
1958 emit_register_class.
1959 * jcf-parse.c (yyparse): Call emit_register_classes once before
1960 returning.
1961 * parse.y (java_expand_classes): No longer register classes.
1962
1963 Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1964
1965 * class.c (is_compiled_class): New local variable
1966 seen_in_zip. Identify classes found in currently compiled source
1967 file(s).
1968 * decl.c (complete_start_java_method): Fixed typo.
1969 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
1970 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
1971 (CLASS_P): Moved around.
1972 (java_parse_abort_on_error): Macro moved from jcf-parse.c
1973 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
1974 java-parse.h
1975 (jcf_parse_source): Changed leading comment. Removed unnecessary
1976 fclose and CLASS_FROM_SOURCE_P marking.
1977 (parse_source_file): New local variables remember_for_generation
1978 and filename. Mark parsed file name identifier node. Removed block
1979 executed when parse_only was null. Set remember_for_generation.
1980 Use it as an argument to java_pop_parser_context.
1981 (yyparse): New local variables several_files, list, next node and
1982 current_file_list. Split ampersand separated file names into
1983 current_file_list. Iterate through the list and parse accordingly.
1984 * parse.h (java_pop_parser_context): New function prototype.
1985 * parse.y (ctxp_for_generation): New static global variable.
1986 (java_pop_parser_context): New argument generate. Link popped ctxp
1987 to ctxp_for_generation list accordingly.
1988 (java_complete_expand_methods): Fixed indentation.
1989 (java_expand_classes): New function.
1990
1991 Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
1992
1993 * Makefile.in: Link with libiberty.a instead of memmove.o.
1994
1995 Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1996
1997 * lex.c (setjmp.h): No longer included.
1998 * lex.h (setjmp.h): Included.
1999 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
2000 (duplicate_declaration_error_p): Renamed from
2001 duplicate_declaration_error.
2002 (build_array_from_name): New function prototype.
2003 * parse.y (setjmp.h): No longer included.
2004 (variable_declarator_id): Define action.
2005 (build_array_from_name): New function.
2006 (duplicate_declaration_error_p): Renamed from
2007 duplicate_declaration_error. Fixed leading comment.
2008 (register_fields): Main `for' loop reorganized. Uses
2009 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
2010 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
2011 build_array_from_name.
2012 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
2013 types.
2014 (read_import_dir): Don't try to skip `.' and `..'.
2015 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
2016 build_array_from_name. Main `for' loop reorganized.
2017 (resolve_qualified_expression_name): When building access to a
2018 field, use the type where the field was found, not its own type.
2019 (maybe_access_field): Use field DECL_CONTEXT if the type where the
2020 field was found is null.
2021 (qualify_ambiguous_name): Sweep through all successive array
2022 dimensions.
2023
2024 Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2025
2026 * java-tree.h (pop_labeled_block, lang_printable_name,
2027 maybe_add_interface, set_super_info, get_access_flags_from_decl,
2028 interface_of_p, inherits_from_p, fix_classpath,
2029 complete_start_java_method, emit_handlers, init_outgoing_cpool,
2030 make_class_data, register_class, alloc_name_constant): New
2031 function prototypes.
2032 * lang.c (lang_decode_option): Set argc argument unused. Fixed
2033 indentation. Added cast to remove warning.
2034 (lang_printable_name): Set v argument unused.
2035 (lang_print_error): Added argument to lang_printable_name call.
2036 (java_dummy_print, print_lang_decl, print_lang_type,
2037 print_lang_identifier, lang_print_xnode): All argument marked
2038 unused.
2039 * lex.c (java_unget_unicode): Removed unnecessary argument.
2040 (java_allocate_new_line): Unused local variable is gone.
2041 (java_read_char): Added parenthesis in expressions to remove
2042 warnings. Added final return statement.
2043 (java_read_unicode): Added parenthesis in expression to remove
2044 warning.
2045 (java_parse_end_comment): Fixed java_unget_unicode invocation.
2046 (java_parse_escape_sequence): Likewise.
2047 (java_lex): Unused local variables are gone. Fixed
2048 java_unget_unicode invocation.
2049 * lex.h (set_float_handler): Prototype added when JC1_LITE not
2050 defined.
2051 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
2052 lang_printable_name invocation in macro.
2053 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
2054 Likewise.
2055 (duplicate_declaration_error): Suppressed unused argument in
2056 prototype.
2057 (identical_subpath_p): Function declaration is gone.
2058 (patch_invoke): Suppressed unused argument in prototype.
2059 (patch_cast, build_labeled_block, check_thrown_exceptions):
2060 Likewise.
2061 * parse.y (setjmp.h): Included
2062 (toplev.h): Likewise.
2063 (field_declaration:): Suppressed unused local
2064 (label_decl:): Fixed build_labeled_block invocation.
2065 (java_pop_parser_context): Put extra parenthesis around assignment
2066 in if.
2067 (yyerror): Suppressed unused local variables.
2068 (variable_redefinition_error): Fixed lang_printable_name
2069 invocation.
2070 (create_interface): Suppressed unused local variables.
2071 (create_class): Likewise.
2072 (duplicate_declaration_error): Suppressed unused argument. Fixed
2073 lang_printable_name invocation.
2074 (register_fields): Suppressed unused local variable. Fixed
2075 duplicate_declaration_error invocation.
2076 (method_header): Suppressed unused local variable.
2077 (method_declarator, parser_check_super): Likewise.
2078 (java_complete_class): Suppressed unused local variable. Fixed
2079 fatal error message.
2080 (complete_class_report_errors): Added default: in switch.
2081 (java_check_regular_methods): Fixed lang_printable_name
2082 invocations.
2083 (check_throws_clauses): Likewise.
2084 (java_check_abstract_methods): Suppressed unused local
2085 variable. Fixed lang_printable_name invocation.
2086 (read_import_entry): Added supplemental return statement.
2087 (read_import_dir): Suppressed unused local variables.
2088 (check_pkg_class_access, declare_local_variables): Likewise.
2089 (source_start_java_method): Suppressed unused extern variable
2090 declarations
2091 (expand_start_java_method): Suppressed unused extern and local
2092 variable declarations.
2093 (java_complete_expand_methods): Likewise.
2094 (java_complete_expand_method): Suppressed unused local variables.
2095 (make_qualified_name): Likewise.
2096 (resolve_qualified_expression_name): Added default: in
2097 switch. Fixed lang_printable_name invocation.
2098 (class_instance_creation_expression): Added parenthesis around
2099 expressions.
2100 (patch_method_invocation_stmt): Fixed lang_printable_name and
2101 patch_invoke invocations.
2102 (check_for_static_method_reference): Fixed lang_printable_name
2103 invocation.
2104 (patch_invoke): Suppressed unused arguments and local variables.
2105 (lookup_method_invoke): Suppressed unused local variables.
2106 (qualify_ambiguous_name): Added default: in switch.
2107 (identical_subpath_p): Function removed.
2108 (patch_assignment): Suppressed unused local variables. Suppressed
2109 unnecessary if statement. Fixed lang_printable_name invocations.
2110 (try_builtin_assignconv): Fixed lang_printable_name invocations.
2111 (valid_ref_assignconv_cast_p): Parenthesis around
2112 expression. Suppressed unused local variables.
2113 (build_binop): Suppressed unused local variables. fixed
2114 lang_printable_name invocations.
2115 (string_constant_concatenation): Suppressed unused local
2116 variables.
2117 (patch_unaryop): Fixed lang_printable_name invocation.
2118 (patch_cast): Suppressed unnecessary argument. Fixed
2119 lang_printable_name invocation.
2120 (patch_array_ref): Fixed lang_printable_name invocation.
2121 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
2122 (build_labeled_block): Suppressed unused argument.
2123 (generate_labeled_block): Fixed build_labeled_block invocation.
2124 (build_loop_body): Suppressed unused local variables.
2125 (patch_loop_statement): Likewise.
2126 (patch_exit): Fixed lang_printable_name invocation.
2127 (patch_switch_statement): Likewise.
2128 (case_identity): First argument marked unused.
2129 (patch_try_statement): Fixed lang_printable_name invocations.
2130 (patch_synchronized_statement, patch_throw_statement): Likewise.
2131 (check_thrown_exceptions): Fixed check_thrown_exceptions and
2132 lang_printable_name invocations.
2133 (check_thrown_exceptions_do): Suppressed unused argument.
2134
2135 1998-10-14 Tom Tromey <tromey@cygnus.com>
2136
2137 * jcf-write.c (write_classfile): Add output class file as target.
2138 * lang-options.h: Added -MD, -MMD, -M, and -MM.
2139 * jcf.h: Added declarations for dependency-tracking functions.
2140 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
2141 * lang.c (lang_decode_option): Recognize -MD and -MMD.
2142 (finish_parse): Call jcf_dependency_write.
2143 (dependency_tracking): New global.
2144 (DEPEND_SET_FILE): New define.
2145 (DEPEND_ENABLE): New define.
2146 (init_parse): Enable dependency tracking if required.
2147 Include "flags.h".
2148 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
2149 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
2150 (../gcjh$(exeext)): Likewise.
2151 (jcf-depend.o): New target.
2152 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
2153 (GCJH_SOURCES): Likewise.
2154 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
2155 dep_name argument.
2156 (find_classfile): Added dep_name argument.
2157 (find_class): Compute name of dependency.
2158 (open_in_zip): Call jcf_dependency_add_file.
2159 * gjavah.c (output_file): No longer global.
2160 (usage): Don't mention "gjavah".
2161 (help): Likewise.
2162 (java_no_argument): Likewise.
2163 (version): Likewise.
2164 (main): Recognize and handle -M family of options.
2165 (print_mangled_classname): Return is void.
2166 (process_file): Handle case where output is suppressed.
2167 (HANDLE_END_FIELD): Likewise.
2168 (HANDLE_METHOD): Likewise.
2169 * jcf-depend.c: New file.
2170
2171 Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
2172
2173 * java-tree.def: Add missing newline at EOF.
2174
2175 1998-10-13 Tom Tromey <tromey@cygnus.com>
2176
2177 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
2178 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
2179 function.
2180 Include <config.h> and "system.h".
2181 (disassemble_method): Undefine RET to avoid clash with
2182 config/i386/i386.h.
2183
2184 Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2185
2186 * decl.c (runtime_exception_type_node, error_exception_type_node):
2187 New global variables.
2188 (init_decl_processing): Initialized.
2189 * expr.c (java_lang_expand_expr): Set caught exception type to
2190 null if catch handler argument doesn't exit.
2191 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
2192 tree codes.
2193 * java-tree.h (runtime_exception_type_node,
2194 error_exception_type_node): Global variables declared.
2195 (DECL_FUNCTION_THROWS): New macro.
2196 (DECL_FUNCTION_BODY): Modified comment.
2197 (DECL_SPECIFIC_COUNT): Likewise.
2198 (struct lang_decl): New field throws_list.
2199 (IS_UNCHECKED_EXPRESSION_P): New macro.
2200 * lex.c (java_lex): Generate location information for THROW_TK.
2201 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
2202 EXCEPTIONS_P): New macros.
2203 (enum jdep_code): New value JDEP_EXCEPTION.
2204 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
2205 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
2206 PATCH_METHOD_RETURN_ERROR): New macros.
2207 (patch_method_invocation_stmt): Added new argument to prototype.
2208 (patch_synchronized_statement, patch_throw_statement,
2209 check_thrown_exceptions, check_thrown_exceptions_do,
2210 purge_unchecked_exceptions, check_throws_clauses): New function
2211 prototypes.
2212 * parse.y Fixed typo in keyword section.
2213 (throw:): Rule tagged <node>.
2214 (THROW_TK): Keyword tagged <operator>.
2215 (method_header:): Last argument to call to method_header passed
2216 from throws: rule.
2217 (throws:, class_type_list:, throw_statement:,
2218 synchronized_statement:, synchronized:): Defined actions.
2219 (method_header): New local variable current. Register exceptions
2220 from throws clause.
2221 (java_complete_tree): Complete and verify exceptions from throws
2222 clause.
2223 (complete_class_report_errors): Error message on exceptions not
2224 found
2225 (java_check_regular_methods): Fixed typo. Shortcut on private
2226 overriding methods. Changed error message on method
2227 redefinition. Check for throws clause compatibility.
2228 (check_throws_clauses): New function.
2229 (java_check_abstract_methods): Use DECL_NAME for wfl or current
2230 method. Changed error message on method redefinition.
2231 (currently_caught_type_list): New static variable.
2232 (java_complete_expand_methods): Purge unchecked exceptions from
2233 throws clause list. Call PUSH_EXCEPTIONS before walk and
2234 POP_EXCEPTIONS after.
2235 (resolve_qualified_expression_name): Pass new argument as NULL to
2236 patch_method_invocation_stmt.
2237 (patch_method_invocation_stmt): New argument ref_decl. Invoke
2238 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
2239 argument list when appropriate. Use new argument if non null to
2240 store selected method decl.
2241 (patch_invoke): Convert if necessary args of builtin types before
2242 forming CALL_EXPR. Argument list no longer reversed here.
2243 (invocation_mode): Treat final methods as static methods.
2244 (java_complete_tree): New cases for THROW_EXPR: and
2245 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
2246 function call.
2247 (complete_function_arguments): No more RECORD_TYPE
2248 conversion. Function parameter nodes no longer saved.
2249 (valid_ref_assignconv_cast_p): Avoid handling null type.
2250 (patch_binop): Fixed null constant reference handling.
2251 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
2252 BUILD_THROW macros.
2253 (patch_try_statement): Fixed comments. Record caught types in
2254 list, push the list, expand try block and pop the list.
2255 (patch_synchronized_statement, patch_throw_statement,
2256 check_thrown_exceptions, check_thrown_exceptions_do,
2257 purge_unchecked_exceptions): New functions.
2258 * typeck.c (lookup_argument_method): Allow WFL in place of method
2259 DECL_NAME during method definition check
2260
2261 1998-10-09 Tom Tromey <tromey@cygnus.com>
2262
2263 * gjavah.c (decode_signature_piece): New function.
2264 (print_c_decl): Use it. Added `name_override' argument.
2265 (print_method_info): Use name_override argument to print_c_decl.
2266 (seen_fields): Removed.
2267 (print_field_info): Don't update seen_fields.
2268 (struct method_name): New structure.
2269 (method_name_list): New global.
2270 (print_method_info): Add new method to list of methods.
2271 (name_is_method_p): New function.
2272 (print_field_info): If field name has same name as method, then
2273 change field name.
2274 (process_file): Parse methods before fields.
2275 (field_pass): New global.
2276 (HANDLE_END_FIELD): Take field_pass into account.
2277
2278 Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2279
2280 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
2281 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
2282
2283 Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
2284
2285 * jvspec.c: Fix bug in jvgenmain_spec patch.
2286
2287 Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2288
2289 * Makefile.in (lang.o:): Install dependency on java-tree.def.
2290 * decl.c (soft_exceptioninfo_call_node): New global variable.
2291 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
2292 takes extra integer argument. soft_exceptioninfo_call_node
2293 initialized.
2294 * except.c (java_set_exception_lang_code): New function
2295 (method_init_exceptions): Called here.
2296 (prepare_eh_table_type): New function.
2297 (expand_end_java_handler): Called here.
2298 * expr.c (build_java_throw_out_of_bounds_exception): Now features
2299 one argument. Modified generation of call to
2300 soft_badarrayindex_node to use new argument.
2301 (build_java_arrayaccess): Pass faulty index value to
2302 build_java_throw_out_of_bounds_exception.
2303 (generate_name): New function.
2304 (java_lang_expand_expr): New local variables node, current,
2305 has_finally_p. Expand TRY_EXPR node.
2306 (process_jvm_instruction): Replace top of the stack with thrown
2307 object reference when entering exception handler.
2308 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
2309 specific tree codes.
2310 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
2311 global.
2312 (DECL_SPECIFIC_COUNT): New macro.
2313 (prepare_eh_table_type, java_set_exception_lang_code,
2314 generate_name): New function declarations.
2315 (match_java_method): Declaration deleted.
2316 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
2317 macros.
2318 * lex.c (TRY_TK, CATCH_TK): Generate location information.
2319 * parse.h (redefinition_error, refine_accessible_methods_list,
2320 can_cast_to_p): Function declaration removed.
2321 (classitf_redefinition_error, variable_redefinition_error,
2322 parse_jdk1_1_error, find_applicable_accessible_methods_list,
2323 find_most_specific_methods_list, argument_types_convertible,
2324 enter_a_block, valid_builtin_assignconv_identity_widening_p,
2325 valid_cast_to_p, valid_method_invocation_conversion_p,
2326 try_reference_assignconv, add_stmt_to_compound,
2327 build_jump_to_finally, build_tree_list, patch_try_statement,
2328 java_get_catch_block): New function declarations.
2329 * parse.y (string_buffer_type): Global variable deleted.
2330 (group_of_labels, catches, catch_clause, catch_clause_parameter,
2331 finally): Rules tagged <node>.
2332 (TRY_TK, CATCH_TK): Token tagged <operator>.
2333 (class_body_declaration:, class_member_declaration:,
2334 formal_parameter:, explicit_constructor_invocation:,
2335 interface_member_declaration:, constant_declaration:,
2336 primary_no_new_array:, class_instance_creation_expression:,
2337 array_creation_expression:): Issue error on unsuported JDK1.1
2338 features.
2339 (try_statement:, catches:, finally:): Define actions.
2340 (catch_clause_parameter): New rule.
2341 (catch_clause:): Use new rule catch_clause_parameter.
2342 (parse_jdk1_1_error): New function.
2343 (redefinition_error): Renamed classitf_redefinition_error.
2344 (variable_redefinition_error): New function.
2345 (check_class_interface_creation): Call
2346 classitf_redefinition_error.
2347 (java_complete_tree): Added error message on JDEP_TYPE: case.
2348 (complete_class_report_errors): Fixed indentation.
2349 (declare_local_variables): Call variable_redefinition_error.
2350 (source_end_java_method): Call java_set_exception_lang_code and
2351 emit_handlers where appropriate.
2352 (java_method_add_stmt): Call add_stmt_to_block.
2353 (add_stmt_to_block): New function.
2354 (lookup_method_invoke): Fixed outside comment. new local variable
2355 candicates. Call find_applicable_accessible_methods_list and
2356 find_most_specific_methods_list when searching for a
2357 method. Modified error report to list possible candidates when
2358 applicable.
2359 (find_applicable_accessible_methods_list,
2360 find_most_specific_methods_list, argument_types_convertible): New
2361 function.
2362 (refine_accessible_methods_list): Function deleted.
2363 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
2364 expr (if applicable) before calling patch_array_ref.
2365 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
2366 (enter_block): Fixed comment.
2367 (enter_a_block): New function.
2368 (patch_assignment): Reorganized. Call try_reference_assignconv for
2369 references. Call valid_cast_to_p instead of can_cast_to_p.
2370 (try_reference_assignconv,
2371 valid_builtin_assignconv_identity_widening_p): New functions.
2372 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
2373 (valid_cast_to_p, valid_method_invocation_conversion_p): New
2374 functions.
2375 (build_string_concatenation): Don't resolve StringBuffer.
2376 (patch_cast): Fixed inverted arguments.
2377 (patch_array_ref): Code to save array expr deleted. Call
2378 valid_cast_to_p instead of can_cast_to_p.
2379 (generate_labeled_block): Call generate_name.
2380 (build_jump_to_finally, build_try_statement, java_get_catch_block,
2381 patch_try_statement): New functions.
2382 * typeck.c (match_java_method): Function deleted.
2383
2384 Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
2385
2386 * jvspec.c: jvgenmain_spec uses different temporary file names.
2387
2388 Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
2389
2390 * jvspec.c (lang_specific_driver): Fail if user specifies
2391 --main= when not linking.
2392
2393 Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
2394
2395 * class.c (make_class_data): Push value for `thread' field.
2396 * decl.c (init_decl_processing): Added `thread' field to class.
2397
2398 * class.c (add_field): Always make static fields externally
2399 visible.
2400
2401 Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
2402
2403 * expr.c (build_java_athrow,
2404 build_java_throw_out_of_bounds_exception, expand_invoke,
2405 build_newarray, expand_java_multianewarray, build_java_monitor):
2406 Update comments to reflect _Jv_* function names.
2407
2408 Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
2409
2410 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
2411 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
2412 * parse.y (expand_start_java_method): Likewise.
2413
2414 Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
2415
2416 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
2417
2418 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
2419 (add_field): No longer need to convert from RECORD_TYPE to pointer,
2420 * expr.c: Remove no-longer-needed calls to promote_type.
2421 * decl.c (give_name_to_locals): Liekwise.
2422 * jcf-parse.c (get_class_constant): Compensate for new signatures.
2423 * parse.y: Add/remove promote_type calls as appropriate.
2424 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
2425 (parse_signature_string): Likewise.
2426 (build_java_array_type): Fix for now signature convenions.
2427
2428 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
2429
2430 Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
2431
2432 * class.c (init_class_processing): libjava function renamed to
2433 _Jv_RegisterClass.
2434
2435 Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2436
2437 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
2438 * java-tree.def: Fixed DEFTREECODE third argument.
2439 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
2440 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
2441 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
2442 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
2443 JAVA_THIS_EXPR): Now replaced by tree code definitions.
2444 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
2445 * lang.c (java_tree_code_type, java_tree_code_length,
2446 java_tree_code_name): New arrays.
2447 (lang_init): Append Java tree node definitions to Gcc ones.
2448 * lex.c (expression_obstack): Declared as extern when JC1_LITE
2449 defined.
2450 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
2451 wfl_to_string.
2452 (java_lex): Allow declaration of empty string constants. Retain
2453 location information on CASE_TK and DEFAULT_TK.
2454 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
2455 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
2456 Modified to be more robust.
2457 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
2458 (build_new_invocation, try_builtin_assignconv,
2459 patch_switch_statement, string_constant_concatenation,
2460 build_string_concatenation, patch_string_cst, patch_string,
2461 java_expand_switch): New function declarations.
2462 * parse.y: Rules related to switch and EH tagged <node>.
2463 (label_id): Set to NULL_TREE
2464 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
2465 tree nodes.
2466 (this_or_super:): Fixed indentation.
2467 (statement:, statement_nsi:, statement_without_trailing_substatement:,
2468 statement_expression:): Removed call to RULE on all sub-rules.
2469 (switch_expression:, switch_labels:): New rules.
2470 (switch_statement:, switch_block:, switch_block_statement_groups:,
2471 switch_block_statement_group:, switch_labels:, switch_label:):
2472 Defined actions.
2473 (throw_statement:, synchronized_statement:, try_statement:):
2474 Defined temporary actions.
2475 (class_instance_creation_expression:): Call
2476 build_new_invocation. Fixed indentation.
2477 (field_access): Fixed indentation.
2478 (method_invocation): Likewise.
2479 (make_qualified_primary): Use THIS_EXPR.
2480 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
2481 resolving from SUPER, set *type_found.
2482 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
2483 (java_complete_tree): Removed unused local variable `location'. Case
2484 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
2485 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
2486 on MODIFY_EXPR: and all binary operator tree code cases. Removed
2487 STRING_CST: case. default: checks for patchable strings.
2488 (complete_function_arguments): Transform string constant or
2489 crafted StringBuffer if necessary.
2490 (build_method_invocation): Fixed comments.
2491 (build_new_invocation): New function.
2492 (patch_assignment): Call try_builtin_assignconv to figure a valid
2493 assignment conversion between builtin types.
2494 (try_builtin_assignconv): New function.
2495 (build_binop): Use URSHIFT_EXPR directly to call build.
2496 (operator_string): Use UNARY_PLUS_EXPR.
2497 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
2498 operator.
2499 (do_merge_string_cste, merge_string_cste,
2500 string_constant_concatenation, build_string_concatenation,
2501 patch_string, patch_string_cst): New function.
2502 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
2503 (patch_unaryop): Likewise. New test of valid ++/-- operands.
2504 (build_newarray_node): Use NEW_ARRAY_EXPR.
2505 (build_this): Use THIS_EXPR.
2506 (build_return): Enable debug information on return statement.
2507 (build_if_else_statement): Likewise.
2508 (complete_labeled_statement): Fixed related comment.
2509 (build_loop_body): Fixed comment.
2510 (build_bc_statement): Enable debug information on break/continue
2511 statements.
2512 (patch_bc_statement): Fixed typos. Handle SWITCH statement
2513 context.
2514 (patch_switch_statement, case_identity, java_expand_switch): New
2515 functions.
2516
2517 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
2518
2519 * buffer.h (BUFFER_INIT): New macro.
2520 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
2521 Pass (struct jcf_partial *state) to most functions.
2522 (jcf_block, jcf_relocation): New types.
2523 Support labels, branches, conditionals, loops.
2524
2525 Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
2526
2527 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
2528
2529 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
2530
2531 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
2532 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
2533 not integer_type_node (INT_TYPE_SIZ bits).
2534
2535 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
2536
2537 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
2538 * jcf-dump.c (print_exception_table): New function.
2539 (disassemble_method): Better handling of wide instructions.
2540 Make more robust for bad input.
2541
2542 Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
2543
2544 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
2545 FreeBSD.
2546
2547 Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
2548
2549 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
2550
2551 Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
2552
2553 * Makefile.in ($(PARSE_H)): Removed target.
2554
2555 Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
2556
2557 * Makefile.in (JAVA_OBJS): Add memmove.o
2558 (memmove.o): New target & rules.
2559
2560 Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
2561
2562 * expr.c (expand_invoke): Don't generate a call to the class init
2563 code.
2564
2565 Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
2566
2567 * Makefile.in: Add many missing dependencies.
2568 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
2569 as appropriate.
2570 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
2571 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
2572
2573 Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
2574
2575 * decl.c (complete_start_java_method): If method is static (and
2576 not private) call _Jv_InitClass.
2577 * expr.c (expand_invoke): Don't call build_class_init.
2578
2579 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
2580
2581 Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
2582
2583 * Make-lang.in (GCJ): Define before using.
2584
2585 Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
2586
2587 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
2588 losing due to namespace pollution in GNU getopt.h
2589
2590 Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
2591
2592 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
2593 (java.all.cross): Likewise.
2594 (java.rest.encap): Likewise.
2595
2596 Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
2597
2598 * gjavah.c (print_class_decls): Fix thinko in arglist
2599 * jcv-io.c (find_classfile): Similarly.
2600
2601 Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
2602
2603 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
2604
2605 Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
2606
2607 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
2608 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
2609 * Makefile.in (PARSE_C): New macro.
2610 (PARSE_H): Likewise.
2611 (PARSE_SCAN_C): Likewise.
2612 ($(PARSE_C)): Target renamed from parse.c.
2613 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
2614 (clean): Remove parse-scan.c as well.
2615 (parse.o): Depend on $(PARSE_C).
2616
2617 Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
2618
2619 * README, license.terms: Removed.
2620
2621 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
2622 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
2623 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
2624 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
2625 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
2626 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
2627 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
2628 and Java trademark attribution.
2629
2630 Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
2631
2632 * Makefile.in: Use gcjh, not gjavah.
2633 * config-lang.in (stagestuff): Use gcjh, not gjavah.
2634 * Make-lang.in: Changed gjavah to gcjh everywhere.
2635
2636 Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
2637
2638 * gjavah.c: Support new -prepend -add -append flags.
2639 (print_method_info): Method is not virtual if class is final.
2640
2641 Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
2642
2643 * jv-scan.c: Fixed copyright assignment.
2644 * keyword.gperf: Likewise.
2645 * keyword.h: Likewise.
2646 * lex.c: Fixed copyright assignment.
2647 (java_lex): Push unicode back when parsing '<'.
2648 * lex.h: Fixed copyright assignment.
2649 * parse-scan.y: Likewise.
2650 * parse.h: Fixed copyright assignment.
2651 (build_debugable_stmt, complete_for_loop): New function prototypes.
2652 * parse.y: Fixed copyright assignment.
2653 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
2654 size_zero_node when completing a loop with no exit condition.
2655 (for_statement_nsi:): Define action.
2656 (for_init:, for_update:): Return size_zero_node when empty.
2657 (declare_local_variables): Call build_debugable_stmt.
2658 (build_debugable_stmt): New function.
2659 (build_loop_body): Build debugable statement around loop
2660 condition part.
2661 (complete_loop_body): Take into account the debugable statement
2662 around the EXIT_EXPR.
2663 (complete_loop_body): New function.
2664 (patch_exit_expr): Fixed condition inversion.
2665
2666 Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
2667
2668 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
2669 name of thread define.
2670 * jvspec.c (THREAD_NAME): New macro.
2671 (GCLIB): Likewise.
2672 (THREADLIB): Likewise.
2673 (lang_specific_driver): Recognize attempt to link with thread
2674 library or gc library. Recognize -ljava on command line so it
2675 isn't linked against more than once.
2676
2677 Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2678
2679 * parse-scan.y (report_main_declaration): Name of the class
2680 containing `main' can be a qualified name.
2681
2682 Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
2683
2684 * config-lang.in: Changed gjavac to gjc everywhere.
2685 * Make-lang.in: Changed gjavac to gjc everywhere.
2686
2687 Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2688
2689 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
2690 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
2691 and install the files.
2692 * Makefile.in (JAVA_OBJS_LITE): New variable.
2693 (compiler:): Now include jv-scan as a dependency.
2694 (../jv-scan$(exeext), parse-scan.c): New targets.
2695 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
2696 * config-lang.in (compilers): Removed gcj, gjavah from the list.
2697 * jcf-parse.c (parse_source_file): Call java_layout_classes and
2698 check for errors even if parse_only.
2699 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
2700 defined.
2701 (yylex): New function. Uses java_lex body.
2702 (java_lex): Removed commented out statement. Remove local variable
2703 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
2704 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
2705 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
2706 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
2707 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
2708 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
2709 where appropriate.
2710 (java_lex_error): Empty if JC1_LITE is defined.
2711 (java_get_line_col): Return 0 if JC1_LITE is defined.
2712 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
2713 SET_MODIFIER_CTX): Moved into the section containing the macros
2714 conditionally defined by JC1_LITE.
2715 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
2716 argument if JC1_LITE is defined.
2717 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
2718 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
2719 is defined.
2720 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
2721 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
2722 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
2723 to different values according to JC1_LITE.
2724 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
2725 declared if JC1_LITE set.
2726 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
2727 defined if JC1_LITE not set.
2728 (struct parser_ctx): Reorganized and skip the jc1 front end part
2729 if JC1_LITE set.
2730 (java_layout_classes): New function definition.
2731 (java_push_parser_context, java_init_lex, yyparse, yylex,
2732 yyerror): Prototype always declared. All other static function
2733 prototypes declared only if JC1_LITE is not set.
2734 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
2735 declared in parse.h.
2736 (java_layout_classes): New function.
2737 (java_complete_expand_methods): No longer layout the class here.
2738 * parse-scan.y: New file.
2739 * jv-scan.c: New file.
2740
2741 Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
2742
2743 * gjavah.c (main): Handle -friend option.
2744 (friend_specs): New global.
2745 (generate_access): Handle friend_specs.
2746 (process_file): Likewise.
2747 (MAX_FRIENDS): New macro.
2748 (friend_count): New global.
2749 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
2750 Changed all callers.
2751
2752 Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
2753
2754 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
2755 (main): Handle processing all the entries of a named .zip archive.
2756 * jcf-io.c (jcf_trim_old_input): New function.
2757 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
2758
2759 Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
2760
2761 * lang.c (flag_assume_compiled): Make default be on.
2762
2763 Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
2764
2765 * jcf-dump.c: Add bunches of flags to control output more.
2766 (process_class): New function; support printing more than one class.
2767 (main): Support new --print-main and --javap flags.
2768 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
2769 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
2770
2771 Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
2772
2773 Change mangling of dispatch table to match C++ vtable (w/thunks).
2774 * class.c (build_dtable_decl), java-tree.h: New function.
2775 (make_class_data): Call it.
2776 * decl.c (init_decl_processing): Likewise.
2777
2778 Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
2779
2780 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
2781 soft_anewarray; adjust args passed.
2782 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
2783 match _Jv_NewObjectArray.
2784
2785 Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2786
2787 * decl.c (push_labeled_block, pop_labeled_block): New functions.
2788 * expr.c (loopup_label): Call create_label_decl.
2789 (create_label_decl): New function.
2790 (java_lang_expand_expr): Call expand_start_bindings with argument
2791 set to zero.
2792 * java-tree.h Added space after PROTO in function declarations
2793 when necessary.
2794 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
2795 (create_label_decl, push_labeled_block): New function
2796 declarations.
2797 * lex.c (label_id): Initialize.
2798 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
2799 switch.
2800 * parse.h Added space after PROTO in function declarations when
2801 necessary.
2802 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
2803 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
2804 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
2805 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
2806 macros.
2807 (struct parser_ctxt): New fields current_loop,
2808 current_labeled_block.
2809 (build_if_else_statement, patch_if_else_statement,
2810 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
2811 generate_labeled_block, complete_labeled_statement,
2812 build_bc_statement, patch_bc_statement, patch_loop_statement,
2813 build_new_loop, build_loop_body, complete_loop_body): New function
2814 declarations.
2815 * parse.y (java_warning_count): New global variable.
2816 (label_id): New static variable.
2817 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
2818 (block:): Return size_zero_node when block is empty.
2819 (empty_statement:): Return size_zero_node.
2820 (statement:): Implement supplemental action when for_statement: is
2821 reduced.
2822 (label_decl:): New rule.
2823 (labeled_statement:): Rewritten using label_decl. Actions
2824 implemented.
2825 (labeled_statement_nsi:): Likewise.
2826 (if_then_statement): Actions implemented.
2827 (while_expression): New rule.
2828 (while_statement:): Rewritten using while_expression. Actions
2829 implemented.
2830 (while_statement_nsi:): Likewise.
2831 (do_statement_begin:): New rule.
2832 (do_statement:): Rewritten using do_statement_begin. Actions
2833 implemented.
2834 (for_statement:): Rewritten using for_begin. Actions implemented.
2835 (for_statement_nsi:): Likewise.
2836 (for_header:, for_begin:): New rules.
2837 (for_init:): Actions implemented.
2838 (statement_expression_list:, break_statement:,
2839 continue_statement:): Likewise.
2840 (yyerror): Count number of issued warning(s).
2841 (java_report_errors): Report error(s) and/or warning(s).
2842 (java_complete_class): Use build_java_argument_signature to
2843 recompute completed method signature.
2844 (java_check_regular_methods): New locals method_wfl and aflags.
2845 Use method_wfl instead of lookup_cl during error reports. Fixed
2846 indentation and modified some error messages. Use
2847 lang_printable_name in method instead of the DECL_NAME. New code
2848 to issue warnings on methods not overriding corresponding methods
2849 private to a different package.
2850 (java_method_add_stmt): Call add_stmt_to_compound.
2851 (add_stmt_to_compound): New function.
2852 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
2853 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
2854 (build_if_else_statement, patch_if_else_statement,
2855 build_labeled_block, generate_labeled_block,
2856 complete_labeled_statement, build_new_loop, build_loop_body,
2857 complete_loop_body, patch_loop_statement, build_bc_statement,
2858 patch_bc_statement, patch_exit_expr): New functions.
2859 * typeck.c (build_java_signature): Build argument signature before
2860 enclosing it in between parenthesis.
2861
2862 Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
2863
2864 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
2865 (JAVA_OBJS): Added reminder comment
2866
2867 Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
2868
2869 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
2870 be interpreted as a long long.
2871
2872 Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
2873
2874 * decl.c (init_decl_processing): Use _Jv_InitClass, not
2875 soft_initialise_class. Use _Jv_NewMultiArray, not
2876 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
2877 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
2878 _Jv_CheckArrayStore, not soft_checkarraystore. Use
2879 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
2880
2881 Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
2882
2883 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
2884 length_identifier_node): New global tree node constants.
2885 * parse.y (kw_super, kw_this, kw_length): Removed globals.
2886 Replace uses by super_identifier_node etc.
2887 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
2888
2889 * parse.y (resolve_field_access): Don't special-case ".length" if
2890 flag_emit_class_files.
2891 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
2892 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
2893 and ARRAY.length.
2894
2895 Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
2896
2897 * decl.c (init_decl_processing): Remove unused method_type_node fields.
2898 * class.c (make_method_value): Remove init for removed fields.
2899
2900 * class.c (layout_class): Use build_java_argument_signature.
2901 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
2902
2903 * typeck.c (push_java_argument_signature): Removed. Merged into ...
2904 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
2905 (build_java_signature): Don't use push_java_argument_signature.
2906
2907 * typeck.c (lookup_argument_method): New function.
2908 * parse.y (java_check_regular_methods): Use lookup_argument_method
2909 instead of lookup_java_method2 followed by lookup_java_method.
2910
2911 * parse.y (check_method_redefinition): Minor optimization.
2912
2913 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
2914 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
2915
2916 Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
2917
2918 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
2919 c-pragma.o.
2920
2921 * gjavah.c (java_float_finite): Use K&R-style definition.
2922 (java_double_finite): Likewise.
2923 (generate_access): Now returns void. Changed all callers.
2924 (last_access_generated): Removed.
2925 (process_file): Only make a single pass over the .class file.
2926
2927 Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
2928
2929 * class.c (get_dispatch_table): Add extra dummy vtable entry,
2930 for compatibility for G++ (with -fvtable-thunks).
2931 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
2932
2933 * gjavah.c (process_file): Use public inheritance for super-class.
2934
2935 Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2936
2937 * lex.c (java_init_lex): Initialize ctxp->package.
2938 * parse.h (struct parser_ctxt): package and package_len replaced
2939 by tree package, an identifier node. Field method_decl_list is
2940 gone. Fixed comments.
2941 (lookup_field_wrapper, merge_qualified_name, not_accessible,
2942 class_in_current_package): New function prototypes.
2943 * parse.y (array_type:): Set class loaded flag on primitive type
2944 arrays.
2945 (package_declaration:): Assign ctxp->package to the
2946 identifier node.
2947 (method_invocation:): Handle invocation of method qualified by
2948 `super'.
2949 (single_type_import_declaration:): Removed ambiguity check.
2950 (java_pop_parser_context): New local variable `next'. Reset and
2951 set IMPORT_CLASSFILE_NAME flags on current and previous import
2952 list.
2953 (java_accstring_lookup): Use new local macro COPY_RETURN.
2954 (lookup_field_wrapper): New function.
2955 (parser_qualified_classname): Use merge_qualified_name.
2956 (parser_check_super_interface): Broaden error message.
2957 (do_resolve_class): Check for qualified class name in the current
2958 compilation unit if appropriate.
2959 (process_imports): Check for already defined classes.
2960 (check_pkg_class_access): Got rid of call to
2961 get_access_flags_from_decl.
2962 (java_complete_expand_methods): Call safe_layout_class based on
2963 the current class size.
2964 (make_qualified_primary): Build a WFL qualification on primary if
2965 none exists.
2966 (merge_qualified_name): New function.
2967 (make_qualified_name): Use merge_qualified_name.
2968 (resolve_expression_name): Use safe_lookup_field.
2969 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
2970 (resolve_qualified_expression_name): Likewise. Check on resolved
2971 element accessibility.
2972 (not_accessible_p, class_in_current_package): New functions.
2973 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
2974 (patch_method_invocation_stmt): Merged common pieces. Check
2975 accessibility of invoked method.
2976 (check_for_static_method_reference): Add returned type in error
2977 message.
2978 (invocation_mode): Get rid of bogus check on PRIVATE methods.
2979 (refine_accessible_methods_list): Merged two conditions in test.
2980 (java_complete_class): Sanity check on stabilize_ref gone.
2981 * zextract.c (read_zip_archive): Cast lseek second argument to long.
2982
2983 Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
2984
2985 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
2986
2987 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
2988
2989 * gjavah.c (F_NAN): Removed.
2990 (F_NAN_MASK): New macro.
2991 (F_POSITIVE_INFINITY): Removed.
2992 (F_NEGATIVE_INFINITY): Likewise.
2993 (java_float_finite): Rewrote.
2994 (D_NAN_MASK): Renamed.
2995 (java_double_finite): Rewrote.
2996 (D_POSITIVE_INFINITY): Removed.
2997 (D_NEGATIVE_INFINITY): Likewise.
2998
2999 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
3000 If verbose, print underlying representation of value in hex.
3001
3002 Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
3003
3004 * buffer.h, buffer.c: New files.
3005 * Makefile.in (JAVA_OBJS): Add buffer.o.
3006
3007 Support locals variables and writing their debug entries to .class.
3008 * jcf-write.c: Simplify some by user new buffer type.
3009 (vode_buffer_grow): Removed.
3010 (struct localvar_info): New type.
3011 (localsvars, localvartable): New buffers.
3012 (localvar_alloc, localvar_free): New functions.
3013 (generate_bytecode_insns): Handle local variables.
3014 (generate_classfile): Write LocalVariableTable attribute.
3015
3016 Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3017
3018 * jcf-io.c (open_in_zip): Check the zipfile magic number.
3019 * zipfile.h (ZIPMAGIC): New macro.
3020
3021 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
3022
3023 * Makefile.in (gjavah.o): Updated dependencies.
3024 (jcf-dump.o): Likewise.
3025 (all.indirect): Use ../gjavah.
3026 (../gjavah$(exeext)): Likewise.
3027 (clean): Don't remove gjavah.
3028 (clean): Remove parse.c, not java/parse.c.
3029 * Make-lang.in (java): Added gjavah.
3030 (gjavah$(exeext)): New target.
3031 (GJAVAH_SOURCES): New macro.
3032 (java.all.build): Added gjavah.
3033 (java.all.cross): Likewise.
3034 (java.rest.encap): Likewise.
3035 * config-lang.in (compilers, stagestuff): Added gjavah.
3036
3037 Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
3038
3039 * gjavah.c (java_float_finite): New function.
3040 (java_double_finite): Likewise.
3041 (F_POSITIVE_INFINITY): New macro.
3042 (F_NEGATIVE_INFINITY): Likewise.
3043 (F_NAN): Likewise.
3044 (D_POSITIVE_INFINITY): Likewise.
3045 (D_NEGATIVE_INFINITY): Likewise.
3046 (D_NAN): Likewise.
3047 (print_field_info): Use java_float_finite and java_double_finite.
3048
3049 Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
3050
3051 * parse.y (method_header): Name "this" implicit argument.
3052
3053 Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
3054
3055 * jcf-write.c: Write out LineNumberTable attribute in .class file.
3056 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
3057 (put_linenumber): New function.
3058 (generate_bytecode_insns, generate_classfile): Write line numbers.
3059
3060 Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3061
3062 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
3063 (lookup_name, build_known_method_ref, build_class_init,
3064 build_invokevirtual, invoke_build_dtable, match_java_method,
3065 build_field_ref, pushdecl_force_head, build_java_binop,
3066 binary_numeric_promotion, build_decl_no_layout,
3067 build_java_arrayaccess, build_newarray, build_anewarray,
3068 build_java_array_length_access, build_java_arraynull_check): New
3069 extern function prototypes.
3070 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
3071 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
3072 java-tree.h.
3073 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
3074 to NULL
3075 * jcf.h (jcf_out_of_synch): New extern function prototype.
3076 * parse.h: Static/global function implemented in parse.y
3077 prototyped and declarations moved at the end of the file.
3078 (DECL_P): Check that the argument isn't null.
3079 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
3080 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
3081 (QUAL_DECL_TYPE): New macro.
3082 (PARAMS): Macro definition removed.
3083 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
3084 (return_statement:): Call build_return.
3085 (field_access:): Call make_qualified_primary in sub rule.
3086 (method_invocation:): Build method invocation and call
3087 make_qualified_primary when processing primaries.
3088 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
3089 get_type_from_signature.
3090 (java_check_regular_method): Extra integer 0 argument when calling
3091 lookup_java_method2.
3092 (lookup_java_interface_method2): Extra method DECL argument when
3093 calling lookup_java_interface_method2.
3094 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
3095 COMPOUND_EXPR node.
3096 (java_complete_expand_method): Layout current class iff not
3097 already done. Don't process interface's methods.
3098 (java_complete_expand_method): Use super class only if it
3099 exists. Use current class otherwise.
3100 (make_qualified_primary): New function.
3101 (resolve_expression_name): Process qualified expression or
3102 expression from primary the same way.
3103 (resolve_expression_name): Two last arguments to
3104 resolve_field_access are now NULL_TREEs.
3105 (resolve_field_access): New variable is_static. Local field must
3106 be DECLs. is_static computed on field DECLs only. Append code in
3107 where_found to the field access if necessary. Use QUAL_DECL_TYPE
3108 to initialize field_type.
3109 (resolve_qualified_expression_name): New local variable,
3110 previous_call_static and is_static. Handle primaries with function
3111 calls, casts, array references and `this'. `super' now handled as
3112 `(super_class)this'. Use is_static to clarify boolean expressions.
3113 Added code to handle case where a proper handle is required to
3114 access a field. Use QUAL_DECL_TYPE where applicable.
3115 (maybe_access_field): New function.
3116 (patch_method_invocation_stmt): New arguments primary, where,
3117 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
3118 deleted. Use `where' as a type to search from if specified. Check
3119 for static method reference where forbidden. Append primary or
3120 current_this to the argument list if not calling constructor nor
3121 static methods.
3122 (check_for_static_method_reference): New function.
3123 (patch_invoke): Layout the class on which new is done if
3124 necessary.
3125 (lookup_method_invoke): Changed format to report errors on
3126 methods.
3127 (qualify_ambiguous_name): New local variable this_found. Now
3128 handle things from primaries. Method call are considered
3129 expression names.
3130 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
3131 changed into NULLs.
3132 (not_initialized_as_it_should_p): Comply with the new DECL_P.
3133 (java_complete_tree): New case fo RETURN_EXPR. Process function
3134 call arguments in separate function.
3135 (complete_function_arguments): New function.
3136 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
3137 anymore.
3138 (patch_assignment): Take the return function slot into account as
3139 a RHS. Distinguish assignment from a return.
3140 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
3141 when checking methods in interfaces.
3142 (resolve_type_during_patch): NULL argument to unresolve_type_p
3143 instead of NULL_TREE.
3144 (patch_newarray): Fixed typo in comment.
3145 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
3146 (build_return, patch_return): New functions.
3147 * typeck.c (lookup_java_constructor): Fixed typo in comment.
3148
3149 Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
3150
3151 * constants.c (find_name_and_type_constant, find_fieldref_index,
3152 find_methodref_index): New methods.
3153 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
3154 just return given method. Also, rename to build_known_method_ref.
3155 (expand_invoke): Rename call to build_invoke_non_interface.
3156 * java-tree.h, parse.h: Update prototype.
3157 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
3158 (such as expand_expr_stmt) if flag_emit_class_files.
3159 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
3160 STACK_TARGET, IGNORE_TARGET): New macros.
3161 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
3162 (generate_bytecode_insn): New function to generate method's bytecode.
3163 (generate_classfile): Node generate Code attribute for a method.
3164 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
3165 push_long_const, field_op, adjust_typed_op, maybe_wide):
3166 New functions used by generate_bytecode_insn.
3167
3168 * typeck.c (signature_include_return): Remove variable.
3169 (push_java_argument_signature, build_java_argument_signature): New.
3170 (build_java_signature): Use push_java_argument_signature.
3171 * parse.y: Use build_java_argument_signature instead of fiddling
3172 with signature_include_return.
3173
3174 Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
3175
3176 * gjavah.c (print_c_decl): Always generate JArray<>* for array
3177 types.
3178
3179 * Makefile.in (all.indirect): Added gjavah$(exeext).
3180 (gjavah$(exeext)): Added $(exeext).
3181 (clean): Likewise.
3182
3183 Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3184
3185 * class.c (layout_class): Call to java_layout_parsed_class replace
3186 by safe_layout_class.
3187 * expr.c (build_java_array_length_access): Removed static storage
3188 class in the function definition.
3189 (build_java_arraynull_check): Likewise.
3190 Also fixed typos in two comments.
3191 * lex.c (java_init_lex): Initialize static global kw_length.
3192 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
3193 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
3194 java_lex_error.
3195 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
3196 * parse.h (resolve_no_layout): New static function declaration.
3197 (get_identifier_in_static): Declaration removed.
3198 (java_layout_parsed_class): Function name declaration changed to
3199 safe_layout_class.
3200 (build_newarray_node, patch_newarray, resolve_type_during_patch,
3201 not_initialized_as_it_should_p, build_this): New static function
3202 declarations.
3203 (pushdecl_force_head, build_java_binop, int_fits_type_p,
3204 binary_numeric_promotion, stabilize_reference,
3205 build_decl_no_layout, build_java_arrayaccess): Extern function
3206 declarations moved into their own section.
3207 (build_newarray, build_anewarray, build_java_array_length_access,
3208 build_java_arraynull_check): New extern function declarations.
3209 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
3210 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
3211 fake tree codes.
3212 (CALL_CONSTRUCTOR_P): New macro.
3213 * parse.y (kw_length): New static global tree node.
3214 (return_statement): Tagged <node>.
3215 (RETURN_TK): Tagged <operator>.
3216 (variable_declarator_id:): Build variable declaration with an
3217 empty initialization value if a syntax error was found in the
3218 initialization part of the variable declaration.
3219 (statement_without_trailing_substatement:): return_statement: now
3220 uses the default rule.
3221 (return_statement:): Temporarily fixed to return NULL_TREE.
3222 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
3223 (class_instance_creation_expression:): Class creation rules now
3224 call build_method_invocation upon reduction.
3225 (array_creation_expression:): Rules call build_newarray_node upon
3226 reduction.
3227 (dim_exprs:): Build a list of dimension expressions.
3228 (dim_expr:): Store location of the OSB_TK in the dimension
3229 expression node.
3230 (method_invocation:): Added a new error rule.
3231 (build_unresolved_array_type): WFL argument may also be an array
3232 on a primitive type. Name of the argument changed to reflect this.
3233 (method_declarator): Insert argument type at the beginning of the
3234 argument type list and later reverse the list.
3235 (unresolved_type_p): Argument 'returned' may be optionally
3236 NULL_TREE.
3237 (java_layout_class_from_source): Function renamed
3238 safe_layout_class.
3239 (resolve_and_layout): Now call resolve_no_layout and
3240 safe_layout_class.
3241 (resolve_no_layout): New function.
3242 (purify_type_name): New function.
3243 (complete_class_report_errors): Call purify_type_name during error
3244 report on a type not found.
3245 (process_imports): error_found local variable doesn't need to be
3246 initialized to zero.
3247 (declare_local_variables): New local type_wfl. Fixed typo in error
3248 message. type_wfl assigned to unresolved type and used to register
3249 incomplete type. Build a WFL around the variable initialization
3250 statement so that debug info can be generated on it.
3251 (source_start_java_method): Reverse argument list after they've
3252 been processed.
3253 (current_this): New static global variable.
3254 (java_complete_expand_methods): Set current_this when appropriate.
3255 (resolve_expression_name): Build correct static and non static
3256 field access bearing a simple name.
3257 (resolve_field_access): Resolve the length field of arrays. Handle
3258 f.m() cases.
3259 (patch_method_invocation_stmt): Set the type of the method
3260 invocation to error_mark_node. This value is later overridden by a
3261 valid type, if any. Don't handle qualified constructor invocation
3262 as qualified method invocation. Call lookup_method_invoke with its
3263 new flag. It's no longer necessary to access the selected method
3264 as the value of a tree list. Handle constructor invocation.
3265 (patch_invoke): Reverse argument list when invoking non interface
3266 methods. Insert call to new as the first argument of the
3267 constructor.
3268 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
3269 defined within a final class. Return INVOKE_STATIC if the invoked
3270 method is a constructor.
3271 (lookup_method_invoke): New lc argument is a flag to indicate a
3272 constructor lookup. Now handle constructor lookup. Choose the most
3273 specific method in case several were matching the invocation
3274 requirements. Return a method decl instead of a tree list featuring
3275 one single method decl element.
3276 (refine_accessible_methods_list): New lc flag argument to
3277 indicate that a constructor is being looked up.
3278 (not_initialized_as_it_should_p): New function.
3279 (java_complete_tree): Now process fake tree codes
3280 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
3281 save_expr on resolved function call arguments. Case on
3282 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
3283 (patch_assignment): LHS can be a field access expression. When
3284 dealing with reference, lhs_type is the promoted type of the
3285 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
3286 applicable.
3287 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
3288 (patch_binop): Use not_initialized_as_it_should_p where
3289 applicable.
3290 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
3291 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
3292 where applicable.
3293 (resolve_type_during_patch): New function.
3294 (patch_cast): Call resolve_type_during_patch to resolve type and
3295 report error accordingly.
3296 (patch_array_ref): Use not_initialized_as_it_should_p where
3297 applicable. Array base expression is saved before being
3298 used. Promote the type of an array elements if it contains non
3299 builtin types.
3300 (build_newarray_node, patch_newarray, build_this): New functions.
3301
3302 Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
3303
3304 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
3305 increment it in `for' statement.
3306 (print_field_info): If number is inf or nan, don't print it.
3307 (print_method_info): If method name is `delete', just ignore it.
3308 (print_c_decl): Special-case jstringArray.
3309
3310 * gjavah.c (help): New function.
3311 (no_argument): New function.
3312 (usage): Changed text.
3313 (main): Rewrote argument handling. Now handles -v, --help,
3314 --version.
3315 (version): New function.
3316 (found_error): New global.
3317 (main): Return found_error.
3318 (generate_access): Set found_error.
3319 (print_c_decl): Likewise.
3320
3321 Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
3322
3323 * gjavah.c (print_c_decl): Don't print "," when examining field.
3324 Skip type name when looking at "[L" types.
3325 (process_file): Now static.
3326 (generate_access): Now returns int.
3327 (last_access_generated): New global.
3328 (process_file): Clear last_access_generated; make multiple passes
3329 over the class.
3330 (print_field_info): Just return if generate_access returns true.
3331 (print_method_info): Likewise. Also, allow <init> functions to
3332 pass through.
3333 (print_c_decl): Added is_init argument. Print constructors
3334 properly.
3335 (print_cxx_classname): Use UTF8_GET to extract characters from
3336 string.
3337 (print_base_classname): New function.
3338 (print_class_decls): New function.
3339 (process_file): Use it.
3340 (utf8_cmp): New function.
3341
3342 Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
3343
3344 * lang-options.h: Format changed to match changes in gcc/toplev.c
3345 to implement a --help option.
3346
3347 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
3348
3349 * decl.c (init_decl_processing): Revert change to dtable_type.
3350
3351 Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
3352
3353 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
3354
3355 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
3356
3357 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
3358
3359 * lang.c (lang_init): Default flag_exceptions to 1, without
3360 checking to see if it's 2 first.
3361
3362 Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
3363
3364 * constants.c: Include "system.h".
3365 * decl.c: Likewise.
3366 * lang.c (flag_new_exceptions): Get via extern now.
3367 (lang_init_options): New functions. Turn on flag_new_exceptions.
3368
3369 Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3370
3371 * lex.c (java_lex): Return 0 when we see an invalid character in
3372 the input.
3373
3374 * lex.c (java_read_char): Specify extra argument when calling
3375 java_lex_error.
3376 (java_read_unicode, java_parse_end_comment,
3377 java_parse_escape_sequence): Likewise,
3378 (java_lex): Specify extra argument when calling
3379 java_lex_error. Test that IDs are beginning with a legal character
3380 for IDs. Handle invalid characters with an error message and a
3381 call to java_lex_error.
3382 (java_lex_error): Adjust column position by new argument
3383 `forward'. Issue an error even if in the middle of reporting an
3384 other error.
3385
3386 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
3387
3388 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
3389 we don't explicitly put a null pointer when we're copying it.
3390
3391 Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
3392
3393 * gjavah.c (print_cxx_classname): New function.
3394 (super_class_name): Likewise.
3395 (print_super_fields): Removed.
3396 (in_super): Removed.
3397 (print_field_info): Never generate #defines.
3398 (print_c_decl): Changed generated types to match JNI. No longer
3399 print class name before method name.
3400 (print_method_info): Print "static" before static methods.
3401 Print "virtual" before non-final methods.
3402 (usage): Use exit(1), not exit(-1).
3403 (main): Likewise.
3404 (print_field_info): Use %.17g to print a double.
3405 (last_access): New globals.
3406 (process_file): Initialize last_access.
3407 (usage): Now static.
3408 (ACC_VISIBILITY): New define.
3409 (generate_access): New function.
3410 (print_field_info): Call it.
3411 (print_method_info): Likewise. Also, generate information for all
3412 methods, not just native methods. Return void.
3413 (print_c_decl): Return void.
3414 (print_field_info): Return void.
3415
3416 Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3417
3418 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
3419 processing the jc1 grammar file. Prefix bison functions and
3420 variables with java_.
3421 (parse.c): Dependencies on parse.h and lex.h
3422 * expr.c (build_java_arrayaccess): Function now global.
3423 * java-tree.h: Comment reorganized to carry on previous
3424 classification effort.
3425 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
3426 RESOLVE_TYPE_NAME_P): New flags on WFLs.
3427 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
3428 java_parse (new prefix java_ generated by bison).
3429 (java_layout_parsed_class, java_register_parsed_class): Function
3430 call removed.
3431 (yyparse): Removed unnecessary call to init_outgoing_cpool.
3432 * lex.c (static tree wfl_op): Variable deleted.
3433 (java_init_lex): Initialize kw_super and kw_this. Initialize more
3434 ctxp fields to NULL_TREE.
3435 (java_lex): No longer create WFL for operators. Filename caching
3436 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
3437 created as STRING_CST and later expanded. Removed extra argument
3438 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
3439 and SUPER.
3440 (build_wfl_node): Removed code in comments.
3441 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
3442 store token and location data in the current bison token.
3443 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
3444 static/extern function declaration at the beginning of the file.
3445 (struct qualification): Data structure definition deleted.
3446 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
3447 (qualify_ambiguous_name): Function declaration modified. Function
3448 now returns nothing.
3449 (build_array_ref, patch_array_ref, make_qualified_name,
3450 resolve_qualified_expression_name, maybe_generate_clinit,
3451 resolve_field_access): New static function declarations.
3452 (build_java_arrayaccess): New extern function declaration.
3453 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
3454 (CALL_EXPR_PRIMARY): Macro deleted.
3455 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
3456 (struct parser_ctxt): Field initialized_final
3457 removed. non_static_initialized, static_initialized: New fields.
3458 * parse.y (static tree kw_super, static tree kw_this): New global
3459 static.
3460 (%union): tree wfl field of operator member replaced by int
3461 location. WFLs are non longer created for operators.
3462 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
3463 (qualified_name:): Now calls make_qualified_name to build the
3464 identifier.
3465 (type_declaration:): Consider generating <clinit> when class
3466 parsing completed.
3467 (variable_declarator:): Directly build an assignment node when the
3468 variable is initialized when declared.
3469 (this_or_super:): Build a WFL and set current location when THIS
3470 or SUPER are parsed.
3471 (expression_statement:): Wrap statement around a WFL.
3472 (primary_no_new_array:): Fixed typo. Changed value returned by
3473 THIS_TK because of its new type (temporary).
3474 (dim_exprs:): Temporary fix because of OSB_TK's new type.
3475 (field_access:): Build qualified name with SUPER.
3476 (method_invocation:): Fixed returned value because of SUPER's new
3477 type.
3478 (array_access:): Use OSB_TK location information.
3479 (post_increment_expression:, post_decrement_expression:,
3480 unary_expression:, pre_increment_expression:,
3481 pre_decrement_expression:, unary_expression_not_plus_minus:,
3482 cast_expression:, multiplicative_expression:,
3483 additive_expression:, shift_expression:, relational_expression:,
3484 equality_expression:, and_expression:, exclusive_or_expression:,
3485 inclusive_or_expression:, conditional_and_expression:,
3486 conditional_or_expression:, assignment:): Use new location/token
3487 information available on operators.
3488 (create_class): Set super_decl_type to NULL_TREE when processing
3489 java.lang.Object.
3490 (register_fields): Field initialization is now a MODIFY_EXPR
3491 node. Chain initialization code to the matching lists (according
3492 the the field declaration modifiers).
3493 (maybe_generate_clinit): New function.
3494 (method_header): Don't set method's DECL_NAME to a WFL when adding
3495 methods to java.lang.Object.
3496 (resolve_and_layout): Now can return NULL_TREE if the type
3497 resolution fails. Otherwise, return the class DECL instead of its
3498 TYPE.
3499 (check_method_redefinition): Don't patch method DECL_NAME if it
3500 belongs to java.lang.Object.
3501 (process_imports): Simply assign error_found to the value returned
3502 by check_pkg_class_access.
3503 (declare_local_variables): Don't use their init statements (if
3504 any) when parsing error were previously found. Reuse MODIFY_EXPR
3505 build during parsing as an init statement.
3506 (java_method_add_stmt): Now return the current method body.
3507 (java_layout_parsed_class, java_register_parsed_class): Functions
3508 removed.
3509 (java_complete_expand_methods): Initialize the constant pool on a
3510 per class basis. Layout the classes before expanding their method
3511 bodies. Don't try expand artificial constructor code if error were
3512 found. Make the classes data and register them if no error were
3513 found.
3514 (java_complete_expand_method): Retrieve an artificial constructor
3515 argument list before entering its body. Assign the top block to
3516 the artificial constructor function body and set types of declared
3517 blocks and compound statements to void. Walk method body if not an
3518 artificial constructor.
3519 (make_qualified_name, cut_identifier_in_qualified): New functions.
3520 (resolve_expression_name): Fixed comments. Save/restore the
3521 current class CLASS_LOADED_P flag value. Build non qualified
3522 static field access and handle qualified expression names.
3523 (resolve_field_access, resolve_qualified_expression_name): New
3524 functions.
3525 (patch_method_invocation_stmt): Use the new expression resolution
3526 scheme, calling resolve_field_access when the function call is
3527 resolved as an expression.
3528 (qualify_ambiguous_name): Function rewritten to work on qualified
3529 expression produced by make_qualified_name.
3530 (java_complete_tree): Promote type when function's argument are
3531 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
3532 the assignment to discover further errors if RHS is a expression
3533 name that fails to evaluate. Declare LHS initialized even though
3534 the assignment failed. Don't use the location variable and removed
3535 extra argument in patch function calls. Now handle the ARRAY_REF
3536 case and build internal string representation when STRING_CSTs are
3537 walked.
3538 (build_method_invocation): Don't wrap function call around a WFL.
3539 (build_assignment): Likewise. Use the operator location
3540 information.
3541 (patch_assignment): Handle array access LHSs. Handle error
3542 provenance, resulting in a better error report.
3543 (build_binop): Use op_location from operator as binop location
3544 information.
3545 (build_unaryop, build_incdec, build_cast): Likewise.
3546 (patch_binop): Extract location information from the node. Fixed
3547 typo in error message.
3548 (patch_unary_op): Extract location information from the node.
3549 (build_array_ref, patch_array_ref): New functions.
3550
3551 Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
3552
3553 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
3554 match _Jv_IsInstanceOf.
3555 * decl.c (init_decl_processing): Use _Jv_NewArray, not
3556 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
3557
3558 Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
3559
3560 * decl.c (init_decl_processing): Functions are now named
3561 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
3562
3563 Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
3564
3565 * java-tree.h (load_class): Add prototype.
3566 * class.c (is_compiled_class): Add missing arg to load_class.
3567 * expr.c (expand_java_NEW): Call load_class.
3568 * parse.y (process_import): Removed bogus use of void return value.
3569
3570 Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
3571
3572 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
3573 Function name is "_Jv_Throw" instead of "soft_athrow".
3574 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
3575 Function name is "_Jv_AllocObject" instead of "soft_new".
3576 Takes an extra parameter (object size).
3577 * expr.c: Update calls.
3578
3579 Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
3580
3581 * lex.c (java_get_line_col): Handle end-of-file.
3582 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
3583
3584 Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
3585
3586 * lang.c (lang_init): Make -fexceptions the default.
3587 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
3588 exception handling is not turned on.
3589
3590 Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
3591
3592 * lang.c (flag_new_exceptions): Make this this default.
3593 * decl.c (end_java_method): Call emit_handlers.
3594 * except.c (method_init_exceptions): Set language code and version.
3595 (expand_start_java_handler): Enable exception, and call
3596 expand_eh_region_start.
3597 (expand_end_java_handler): Enable exception, and set up catch blocks.
3598 (emit_handlers): New routine to generate the saved handlers.
3599 * java-except.h (emit_handlers): Add prototype.
3600
3601 Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
3602
3603 We used to have three different representations of the constant pool:
3604 the CPool structure, the tree_constant_pool, and the constructures
3605 used to build the Class object (which may need class and string
3606 constants) in compiled code. None were appropriate for compiling
3607 to .class files, so I did a major overhaul.
3608
3609 First, the tree_constant_pool array was removed. Things were
3610 modified to the CPool structure in the JCF could be used.
3611 Second, a "capacity" field was added to the CPool, and functions
3612 written to search for a matching constant, adding one if not found.
3613 The code that generated the Class object was changed to use a CPool.
3614 The actual TREE_LISTs used to build the CONSTRUCTORs used for
3615 the static Class object are now only in build_constants_constructor.
3616 Finally, I wrote code which can generate a .class file (including its
3617 constant pool) from the RECORD_TYPE of a class. This is a big step
3618 on the way to compiling Java source into .class files.
3619
3620 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
3621 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
3622
3623 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
3624 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
3625 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
3626 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
3627 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
3628 (lang_type): Removed constant_pool field.
3629 * jcf.h (CPool): Renamed size to count. Added field capacity.
3630 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
3631 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
3632 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
3633
3634 * constants.c (current_constant_pool_tags, current_constant_pool_data,
3635 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
3636 * constants.c (build_constants_constructor): Use new outgoing_cpool.
3637 (set_constant_entry, find_constant1, find_constant2,
3638 find_class_constant, count_constant_pool_bytes, write_constant_pool,
3639 find_utf8_constant, find_class_or_string_constant): New functions.
3640
3641 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
3642 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
3643 (give_name_to_class, get_class_constant): Likewise.
3644 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
3645 (get_name_and_type_constant, get_ref_constant): Removed.
3646 * parse.h (parser_ctxt): Remove field tree_constant_pool.
3647 * parse.y: Don't save/restore tree_constant_pool.
3648 * verify.c (verify_jvm_instructions): Update for new approach.
3649 * expr.c (expand_invoke, expand_java_field_op): Likewise.
3650
3651 * lang-options.h: Added -femit-class-file, -femit-class-files.
3652 * lang.c (flag_emit_class_files), java-tree.h: New flag.
3653 (lang_f_options): Added "emit-class-file(s)".
3654
3655 * expr.c (build_java_arrayaccess): Generate more efficient array
3656 bounds checking, by using unsigned compare.
3657
3658 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
3659
3660 Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3661
3662 * parse.h: New comment on the handling of unresolved type
3663 identifiers. JDEPs are now part of the jdep_code enum.
3664 (typedef struct jdep): Now use enum jdep_code or int, depending on
3665 availability. Both are narrowed down to an 8 bits bitfield.
3666 (CALL_EXPR_PRIMARY): Fixed comment.
3667
3668 Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
3669
3670 * Make-lang.in (java): Added gjavac and jvgenmain.
3671 (java.start.encap): Depend on gjavac.
3672 (java.rest.encap): Depend on jvgenmain.
3673
3674 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
3675 (JAVA_CROSS_NAME): Likewise.
3676 (java.all.build): Depend on jvgenmain and gjavac.
3677 (java.all.cross): Depend on jvgenmain and gjavac-cross.
3678 (jvgenmain$(exeext)): New target.
3679 (java.install-common): Wrote.
3680 * config-lang.in (compilers, stagestuff): Added gjavac and
3681 jvgenmain.
3682
3683 Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
3684
3685 * lang.c (lang_decode_option): New argc/argv interface.
3686
3687 Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3688
3689 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
3690 * decl.c (build_decl_no_layout): New function.
3691 * expr.c (java_lang_expand_expr): Layout declarations found in
3692 blocks before they're pushed.
3693 * jcf-parse.c (load_class): Save current line when parsing class
3694 file.
3695 (parse_source_file): Register class before expanding their
3696 methods.
3697 * lang.c (put_decl_node): Produce `null' when `void *' is
3698 processed.
3699 * lex.c (static tree wfl_op): New static global, for error report
3700 on casts.
3701 (java_init_lex): wfl_operator and wfl_op initialized
3702 here. Filename caching added for wfl_op. Return wfl_op when `(' is
3703 parsed.
3704 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
3705 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
3706 build_unresolved_array_type): New static function definitions.
3707 (build_decl_no_layout): New extern function declared.
3708 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
3709 faulty modifier exists.
3710 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
3711 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
3712 (UNARY_PLUS_EXPR): New fake operator.
3713 (struct parser_ctxt): New field osb_number.
3714 * parse.y (static tree wfl_operator): New static WFL for operator
3715 bound error messages.
3716 (DECR_TK, INCR_TK): Moved.
3717 (OP_TK): Tagged <operator>.
3718 (array_type:): Now call build_unresolved_array_type.
3719 (dim_expr:): Count the number of '[' seen.
3720 (post_increment_expression, post_decrement_expression,
3721 pre_increment_expression, pre_decrement_expression,
3722 unary_expression_not_plus_minus, unary_expression:): Actions are
3723 now building the corresponding unary expressions.
3724 (cast_expression:): Actions are now building cast expressions.
3725 (build_unresolved_array_type): New function.
3726 (create_interface): Reset the number of declared interfaces.
3727 (create_class): Likewise.
3728 (method_header): Methods declared within the scope of an interface
3729 are now implicitly set public and abstract.
3730 (java_complete_class): Variable's and parameter's type are patched
3731 with a promoted type.
3732 (declare_local_variables): Resolved non builtin types are promoted
3733 before being used to build a variable decl. Removed type patch
3734 posted on variable initialization statement.
3735 (source_start_java_method): Use build_decl_no_layout to build the
3736 decl of a parameter of incomplete type.
3737 (java_register_parsed_class): Process interfaces too. Call
3738 rest_of_decl_compilation on each processed class declarations.
3739 (java_complete_expand_methods): Don't attempt to expand things in
3740 interfaces.
3741 (java_complete_tree): Process CONVERT_EXPR, even though it always
3742 has a type. Propagate error_mark_node to node's type too. Promote
3743 method's call argument type and return error_mark_node if
3744 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
3745 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
3746 handle unary operator nodes.
3747 (build_assignment): Added comment.
3748 (print_int_node): New function.
3749 (patch_assignment): New second argument. New error handling. Use
3750 print_int_node. Handle references. Use can_cast_to_p to issue
3751 different error message according to the context and check upon
3752 the initialization of the RHS.
3753 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
3754 (operator_string): Handle more operators.
3755 (patch_binop): No longer use a function static
3756 wfl_operator. Improved error message on shift distance.
3757 (build_unaryop, build_incdec, build_cast, patch_unaryop,
3758 patch_cast): New functions.
3759
3760 Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
3761
3762 * jvspec.c: New file.
3763 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
3764
3765 * java-tree.h (identifier_subst): Add declaration.
3766
3767 Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
3768
3769 * jvgenmain.c (main): Generate call to JvRunMain.
3770
3771 * class.c (make_class_data): Push value for "sync_info" field.
3772 * decl.c (init_decl_processing): Push "sync_info" field.
3773
3774 Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
3775
3776 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
3777 Java (source) name, not signature.
3778 Set TYPE_ALIGN to (at least) that of element_type.
3779
3780 Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
3781
3782 * class.c: Moved classname-mangling-rekated code to ...
3783 * mangle.c: ... this new file.
3784 * jvgenmain.c: New program (needs mangle.c) to generate main program.
3785 * Makefile.in: Update for above changes.
3786
3787 Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3788
3789 * expr.c (truthvalue_conversion): Convert integer and floating
3790 point value to their truth value.
3791 * lex.c (java_lex): Handle the `null' literal.
3792 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
3793 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
3794 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
3795 New macros.
3796
3797 * parse.y: Reorganization/documentation on token declaration.
3798 (binop_lookup[]): New added new tree codes.
3799 (relational_expression): Build corresponding binary operators.
3800 (equality_expression, conditional_and_expression,
3801 conditional_or_expression): Likewise.
3802 (java_complete_class): Fix crash in debug message.
3803 (java_complete_tree): Check initialization of method call
3804 arguments. Further bogus node evaluation to detect more error
3805 during assignments. Handles more binary operators.
3806 (patch_assignment): Use DECL_P.
3807 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
3808 code.
3809 (operator_string): Handle more case. Compacted source.
3810 (patch_binop): Changed function comment. Checking for
3811 uninitialized first operand takes the compound assignment into
3812 account and uses DECL_P. Checking for uninitialized second operand
3813 delayed to routine's end. Use macros to issue type bound error
3814 messages and issue messages on both operands if their types are
3815 different. Force fixed type into node. Handle all binary
3816 operators.
3817
3818 Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3819
3820 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
3821 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
3822 build operator node and return tokens.
3823 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
3824 * parse.h (java_complete_tree): Changed returned type in prototype.
3825 (build_method_invocation, build_assignment, patch_assignment,
3826 patch_binop): New static function declarations.
3827 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
3828 BUILD_EXPR_WFL): New macros.
3829 * parse.y (enum tree_code binop_lookup[]): New static for token to
3830 TREE_CODE lookup.
3831 (%union): Parser union has new sub-structure `operator'.
3832 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
3833 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
3834 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
3835 ASSIGN_ANY_TK): Tokens tagged `operator'.
3836 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
3837 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
3838 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
3839 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
3840 (assignment_operator:): Rule tagged `operator'.
3841 (expression_statement:): Re-installed default rule.
3842 (method_invocation:): Sub rules call build_method_invocation.
3843 (postfix_expression:): Don't attempt to resolve name here. Just
3844 return an ID.
3845 (multiplicative_expression:): Sub-rules build corresponding binop
3846 expression node.
3847 (additive_expression:, shift_expression:, and_expression:,
3848 exclusive_or_expression:, inclusive_or_expression:): Likewise.
3849 (assignment:): Sub rule invoke build_assignment.
3850 (assignment_operator:): Default rules on sub rules.
3851 (force_error): Added documentation on this variable.
3852 (declare_local_variables): Build initialization calling
3853 build_assignment.
3854 (expand_start_java_method): Removed unused rtx declaration. Mark
3855 arguments as already initialized.
3856 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
3857 (java_complete_expand_methods): Don't process next method if
3858 completion of the previous one triggered errors.
3859 (java_complete_expand_method): Call source_end_java_method if no
3860 error were found during completion.
3861 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
3862 locals declaratilon. Handle names found within a class. Return
3863 error_mark_node when things aren't found.
3864 (patch_method_invocation_stmt): Return error_mark_node on failures.
3865 (patch_invoke): Removed unused local. Return the correct node.
3866 (java_complete_tree): Now returns a value. The BLOCK section binds
3867 local identifiers and the type of a BLOCK is now void. Assign the
3868 result of operand completion on COMPOUND_EXPR. Assign the
3869 encapsulated node of a WFL to the result of its completion, except
3870 when the node is an identifier. Now handle MODIFY_EXPR and several
3871 binary operators. Return error_mark_node on errors.
3872 (build_method_invocation, build_assignment, patch_assignment,
3873 build_binop, operator_string, patch_binop): New functions.
3874 * typeck.c (binary_numeric_promotion): New function.
3875
3876 Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
3877
3878 * class.c (identifier_subst): New convenience wrapper for ident_subst.
3879 Replace most uses of ident_subst by identifier_subst.
3880
3881 * class.c (push_class_static_dummy_field): Removed function.
3882 (build_class_ref): Find Class object decl by looking up "CNAME.class",
3883 instead of looking got "class" static field. Create that decl here.
3884 (class_identifier_node): Removed; no longer needed.
3885 (init_class_processing): Don't init class_identifier_node.
3886 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
3887 Do nreverse 0 times (instead of twice) for Object and Class.
3888 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
3889
3890 Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
3891
3892 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
3893 while initializing linenumber_count and linenumber_table.
3894 Do it before init_function_start (which calls emit_line_note).
3895 * expr.c (expand_byte_code): Don't need to clear lineno here.
3896
3897 Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
3898
3899 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
3900 then mangle number as _N_.
3901
3902 * class.c (mangle_class_field): New function.
3903 (build_class_ref): Set assembler name of class reference using
3904 mangle_class_field.
3905 (push_class_static_dummy_field): Likewise.
3906
3907 Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
3908
3909 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
3910 of assigning to TREE_CODE. The latter method exploits a feature
3911 of GCC that is not ANSI compliant.
3912
3913 Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3914
3915 * decl.c (pushdecl_force_head): New function.
3916 (pushlevel): Removed conditional printf.
3917 (complete_start_java_method): Don't enter local variable scope if
3918 function is compiled from source code.
3919 * expr.c: parse.h now included
3920 (java_lang_expand_expr): New function.
3921 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
3922 printf. Terminate buffer when doing directories.
3923 * jcf-parse.c (parse_source_file): Call lang_init_source before
3924 parsing and before code generation.
3925 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
3926 use printf if the macro is defined.
3927 * lang.c (lang_init): Install lang_expand_expr hook on
3928 java_lang_expand_expr.
3929 (java_dummy_print): New function.
3930 (lang_init_source): New function.
3931 * lex.c (java_lex): Remember location of an opening brace at the
3932 second nesting level.
3933 (java_is_eol): Unget character seen after a CR if it is EOF.
3934 * parse.h: Now includes lex.h
3935 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
3936 printf if the macro is defined.
3937 (expand_start_java_method, build_expr_block, enter_block,
3938 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
3939 New static function declarations.
3940 (pushdecl_force_head): New extern function declaration.
3941 (INCOMPLETE_TYPE_P): New macro.
3942 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
3943 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
3944 BLOCK_EXPR_ORIGIN): New macros.
3945 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
3946 DECL_SOURCE_LINE_LAST): New macros.
3947 (struct parser_ctxt): Removed field current_method_decl, redundant
3948 with the field current_function_decl. Added fields
3949 first_ccb_indent1 and pending_block.
3950 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
3951 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
3952 tagged <node>
3953 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
3954 (compilation_unit:): Cosmetic on sub rule.
3955 (type_declaration:): Cosmetic on sub rules. Added an error rule.
3956 (variable_initializer:): Installed default rule on expression:.
3957 (method_declaration:): method_header: starts a new
3958 method. method_body: installs the function body, absorbs blocks
3959 emitted for temporary variable scopings, pops function's body block
3960 and merges function's last statement lineno in DECL_SOURCE_LINE.
3961 (method_body:): Installed default rules.
3962 (block:): Call enter_block when an opening brace is seen. Absorb
3963 scoping blocks and call exit_block when a closing brace is seen.
3964 (block_statement:): Cosmetic changes.
3965 (method_invocation:): Create WFL around CALL_EXPR node.
3966 (patch_stage): Added comment around definition.
3967 (method_header): Try to use first_ccb_indent1 as the first line of
3968 the method, so BP debug info are emitted at the first opening
3969 brace of the function. If the function has no body, use the
3970 location of the function's name. Override currently defined method
3971 name with the matching WFL so we can point redefinition errors
3972 using the location where the function's name was declared.
3973 (check_abstract_method_header): Interprets DECL_NAME as an
3974 identifier or as a WFL, accordingly.
3975 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
3976 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
3977 location and name information out of it and reinstall DECL_NAME to
3978 its original identifier node value.
3979 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
3980 function's source code).
3981 (read_import_dir): Test the value returned by find_class and issue
3982 a fatal accordingly.
3983 (declare_local_variables): Push a new block for the scope of the
3984 new variable(s) if code has been already generated at that nesting
3985 level. Pinpoint redefinition errors using the variable id
3986 WFLs. Generate initialization code if necessary. If the variable
3987 type is incomplete, register a patch on its decl.
3988 (source_start_java_method): Rewritten. Define a new block for the
3989 function's parameters. Build parameter decl out of function's
3990 arguments and register them for a patch if their types are
3991 incomplete.
3992 (expand_start_java_method): Includes the part of
3993 source_start_java_method that was pushing the parameter decls and
3994 completing the method start code.
3995 (source_end_java_method): Removed call the expand_end_bindings and
3996 poplevel (already taken care of). Reinstall function's arguments
3997 and get function's last line of code before calling
3998 expand_function_end.
3999 (java_method_add_stmt): New comment before the function's
4000 code. Complement the second operand of the current COMPOUND_EXPR
4001 if necessary.
4002 (java_complete_expand_methods): Don't generate debug info on line
4003 zero when expanding a generated constructor.
4004 (java_complete_expand_method): Set start and end line numbers for
4005 a artificially generated constructor to one and manually call
4006 enter_block and exit_block when defining it. For all methods:
4007 expand function's start calling the new expand_start_java_method
4008 and invoke java_complete_tree on the effective method's body, if
4009 any.
4010 (resolve_expression_name): Now use lookup_name_in_blocks to search
4011 local variable decls and print out an error when variables are
4012 undefined.
4013 (patch_method_invocation_stmt): Inserted comment before the
4014 function's code.
4015 (lookup_method_invoke): Chain method's arguments using chainon
4016 with the current arg list as a second argument. Inserted missing
4017 IDENTIFIER_POINTER when reporting an error on methods not found.
4018 (refine_accessible_methods_list): Don't retain constructors.
4019 (patch_arguments): Function removed.
4020 (java_complete_tree): Inserted comment before the function's
4021 code. New case for BLOCKs. Moved the WFL case a bit
4022 further. Complete function's arguments.
4023 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
4024 maybe_absorb_scoping_blocks): New functions.
4025
4026 Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4027
4028 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
4029 previously set.
4030 * jcf-parse.c (parse_source_file, java_error_count): New forward
4031 and extern declarations.
4032 (java_parse_abort_on_error): Macro moved.
4033 (jcf_parse_source): fatal called if fopen fails. Now calls
4034 parse_source_file.
4035 (parse_source_file): New parse_only parameter. Reflects the
4036 elimination of the second pass.
4037 (yyparse): parse_source_file called with argument set to 0.
4038 * jcf.h (JCF_ZERO): Sets java_source to zero.
4039 * lex.c (java_init_lex): pass argument is gone. Function modified
4040 to be called once during the analysis of a file.
4041 (java_unget_unicode): Fixed typo in fatal message.
4042 (java_get_line_col): Likewise.
4043 (java_lval): Likewise. String literals no longer built during
4044 second pass.
4045 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
4046 account.
4047 * parse.h (MODIFIER_WFL): New macro.
4048 (parse_check_super, parser_check_super_interface): Now return int.
4049 (parser_chain_incomplete_item, not_builtin_p,
4050 complete_method_decl): Declarations removed.
4051 (build_method_invocation_stmt, build_invoke): Renamed using the
4052 `patch' instead of `build'
4053 (register-incomplete_type, obtain_incomplete_type,
4054 java_complete_tree, java_complete_expand_method,
4055 unresolved_type_p, create_jdep_list): New function declarations.
4056 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
4057 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
4058 (jdep): New typedef on new struct _jdep.
4059 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
4060 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
4061 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
4062 JDEP_RESOLVED_P): New macros.
4063 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
4064 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
4065 JDEP_VARIABLE): New enum values and jdep kinds.
4066 (jdeplist): New typedef on struct _jdeplist.
4067 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
4068 macros.
4069 (CALL_EXPR_PRIMARY): New macro.
4070 (struct parser_ctxt): Fields java_pass, current_method_decl,
4071 method_decl_list deleted. New field jdeplist.
4072 (INCOMPLETE_P): Macro deleted.
4073 * parse.y (single_type_import_declaration:): Removed pass switch.
4074 (type_import_on_demand_declaration): Likewise.
4075 (field_declaration:): Removed pass switch on all sub rules.
4076 (class_declaration:): Call the complete_class_decl removed on
4077 class_body rules.
4078 (method_declaration:): Removed second pass switch. No longer chain
4079 methods decl when method_header reduced.
4080 (method_header:): Sub rules no longer depend on pass switch.
4081 (method_declarator:): Likewise.
4082 (method_body:): Likewise.
4083 (abstract_method_declaration:): Likewise.
4084 (block_statement:): Likewise.
4085 (local_variable_declaration:): Likewise.
4086 (argument_list:): Likewise.
4087 (method_invocation:): Likewise. Call to build_method_invocation_stmt
4088 removed. Partial CLASS_EXPR tree node built instead.
4089 (postfix_expression:): Removed pass switch on all sub rules.
4090 (java_pop_parser_context): Free classd_list content.
4091 (yyerror): Call obstrack_grow0 to finalize error message.
4092 (check_class_interface_creation): Comment modified to reflect new
4093 returned value meaning. Removed second pass switch. Return 1 if an
4094 error was found, 0 otherwise. Adjust pointer on filename if a
4095 leading path separator was found.
4096 (maybe_create_class_interface_decl): Removed first pass switch
4097 when linking the class decl to the class_list. Install a new
4098 jdep_list for the class.
4099 (add_superinterfaces): List of unresolved interfaces is
4100 gone. Unresolved interfaces are directly added to the current
4101 dependencies list.
4102 (create_interface): Second pass shortcut removed.
4103 ctpx->modifier_ctx access through MODIFIER_WFL.
4104 (create_class): Second pass shortcut removed. Call to
4105 register_incomplete_type replaces the call to
4106 parser_chain_incomplete_item.
4107 (complete_class_decl): Function removed.
4108 (duplicate_declaration_error): New way of retrieving redeclared
4109 item type.
4110 (register_fields): Call to lookup_modifier_cl replaced by
4111 MODIFIER_WFL. New way of handling unresolved type, using
4112 unresolved_type_p and obtain_incomplete_type.
4113 register_incomplete_type replaces call to parser_chain_incomplete_item.
4114 (patch_stage): New static global variable.
4115 (method_header): New way of handling unresolved type, using
4116 unresolved_type_p and obtain_incomplete_type. patch_stage used to
4117 indicates that the method decl needs to be patched.
4118 (check_abstract_method_header): Call to lookup_modifier_cl
4119 replaced by MODIFIER_WFL.
4120 (method_declarator): Incomplete argument type are registered
4121 calling register_incomplete_type. Patch on the declared method is
4122 issued in that case.
4123 (unresolved_type_p): New function.
4124 (parser_check_super_interface): New comment to reflect function's
4125 modified returned type (int). Function and has a new argument
4126 this_wfl. Call to parse_error_context uses this_wfl instead of
4127 relying on lookup_cl.
4128 (parser_check_super): Comment reflects function's new returned
4129 type (int). Function returns non zero value on error.
4130 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
4131 register_incomplete_type, jdep_resolve_class): New functions to
4132 handle incomplete types in declarations.
4133 (java_complete_class): Rewritten to work with the new incomplete
4134 type handling scheme.
4135 (complete_class_report_errors): Likewise.
4136 (complete_method_decl): Removed: it jobs is now handled by
4137 java_complete_class.
4138 (do_resolve_class): Class loaded in not already loaded and not
4139 found in Java source code.
4140 (java_check_regular_methods, java_check_abstract_methods): Don't
4141 call complete_method_decl anymore.
4142 (lookup_modifier_cl, not_builtin_p): Functions deleted.
4143 (read_import_dir): Got rid of the pass number dependency.
4144 (declare_local_variables): New handling of unresolved types (patch
4145 issued).
4146 (source_start_java_method): New parameter level. Function called
4147 with level set to 1 when argument types are potentially
4148 unresolved. Called to complete the job with level set to 2 once
4149 types are complete.
4150 (source_end_java_method): Call to permanent_allocation
4151 removed. Waiting to be replaced by a more suitable obstack
4152 management.
4153 (java_complete_expand_methods, java_complete_expand_method,
4154 java_expand_finals): New functions.
4155 (build_method_invocation_stmt): Renamed
4156 patch_method_invocation_stmt. Extracts function call expression
4157 (wfl) and arguments (args) from CALL_EXPR tree operands.
4158 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
4159 call. Patch the function and argument operand of the CALL_EXPR
4160 tree argument.
4161 (patch_argument, java_complete_tree): New functions.
4162
4163 Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
4164
4165 Recover from missing fields and methods (i.e. error instead of fatal).
4166 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
4167 * expr.c (expand_invoke): Recover from missing method.
4168 (expand_java_field_op): Recover from missing field.
4169 Inline references to java.lang.{Integer,Char,...}.TYPE.
4170 * typeck.c (get_type_from_signature), java-tree.h: New function.
4171 * class.c (add_method): Use get_type_from_signature.
4172 (build_class_ref): Handle a class that was not found.
4173 * typeck.c (convert): Handle conversion to pointers (for convenience).
4174 * verify.c (verify_jvm_instructions): Use get_type_from_signature
4175 instead of lookup_field to handle missing fields.
4176
4177 * jcf-parse.c (process_zip_dir): Set java_source.
4178
4179 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
4180
4181 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
4182
4183 Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4184
4185 * jcf-parse.c (load_class): Don't change input_filename before
4186 calling jcf_parse_source (but still do it before calling
4187 jcf_parse).
4188 (jcf_parse_source): Assign input_filename after having saved the
4189 parser context.
4190 * lex.c (java_init_lex): Chain a WFL node to the import on demand
4191 list. ctxp->modifier_ctx zeroed according to its new
4192 definition. ctxp->filename initialized. Removed
4193 JAVA_MODIFIER_CTX_UNMARK.
4194 (java_unget_unicode): Update the character based column position.
4195 (java_allocate_new_line): ref_count not used anymore. Always free
4196 ctxp->p_line. Initialize c_line->char_col to 0.
4197 (java_get_unicode): Update the character based column position.
4198 (java_lex): Use ctxp->elc to store current position in source
4199 file, at the beginning of the parsed token. Set modifier_ctx entry
4200 corresponding to the parse modifier to a WFL node. Return a WFL
4201 node when an identifier is parsed.
4202 (java_lex_error): Now uses ctxp->elc to store current position in
4203 source.
4204 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
4205 * lex.h (build_wfl_node): New function definitions.
4206 (struct java_line): ref_count and next fields are gone. New field
4207 char_col.
4208 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
4209 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
4210 (JAVA_COLUMN_DELTA): New macro.
4211 (java_lc): New typedef on new struct _java_lc.
4212 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
4213 (parse_error_context, parse_warning_context): Changed prototypes.
4214 (java_get_line_col): Added as an available global function.
4215 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
4216 (IC_DECL): Replaced by macro IC_TYPE
4217 (DEPEND_WFL): New macro.
4218 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
4219 wrong modifier.
4220 (exit_java_complete_class): Removed a commented out statement.
4221 (struct parser_ctxt): Added comments on fields. modifier_ctx is
4222 now an array of tree nodes. Deleted fields line_list and
4223 e_line. New field elc, to replace e_line.
4224 * parse.y (array_type:): Build WFL node.
4225 (qualified_name:): Build a single WFL node out of two. Retain
4226 the location information of the first node in the resulting node.
4227 (package_declaration:): Use package name as a WFL node
4228 (single_type_import_declaration:): Use imported name as a WFL node.
4229 (type_import_on_demand_declaration:): Use root of the imported
4230 packages as a WFL node.
4231 (field_declaration:): Removed unused local variable cl.
4232 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
4233 (yyerror): New static elc. Removed static error_line, error_pos.
4234 New local code_from_source. Save ctxp->elc into elc at the first
4235 pass. Call java_get_line_col to get a string of the line where
4236 the error occured.
4237 (debug_line): Removed static function.
4238 (parse_error_context, parse_warning_context): Parameter cl is now
4239 a WFL node. Use its value to initialize ctxp->elc.
4240 (redefinition_error): Parameter cl is now a WFL node.
4241 (parse_add_interface): New parameter wfl. No longer call
4242 lookup_cl, use wfl instead.
4243 (check_class_interface_creation): Parameter cl is now a WFL node.
4244 (maybe_create_class_interface_decl): Likewise.
4245 (add_superinterfaces): New function.
4246 (create_interface): Removed local cl, node, super_decl,
4247 super_decl_type. Function now uses id as a WFL node. Better
4248 warning/error report on obsolete or forbidden mix of
4249 modifiers. Now calls add_superinterfaces to register interfaces.
4250 (create_class): Removed local cl, node. Local variable id is used
4251 as a WFL node. Better error report on forbidden modifier
4252 mix. Uses add_superinterfaces to register interfaces.
4253 (find_field): Argument cl is now a WFL node. Now store the WFL
4254 node of a fields that needs to be checked for their
4255 initialization.
4256 (method_header): Local variable node non longer used. Local
4257 variable id replaces cl.
4258 (check_modifiers_consistency): Local variable cl is now a WFL
4259 node.
4260 (method_declarator): Local variable cl replaced by parameter id.
4261 (parser_qualified_name): Now uses parameter name as a WFL node.
4262 (parser_check_super_interface): New parameter wfl, for achieve
4263 greater accuracy during error reports.
4264 (parser_chain_incomplete_item): New parameter named location. Used,
4265 along the decl, to construct the incomplete item node.
4266 (java_complete_class): resolve_class now uses WFL node extracted
4267 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
4268 where appropriate.
4269 (complete_method_decl): Unresolved function's argument types are WFL.
4270 (resolve_class): Parameter cl is now a WFL node.
4271 (resolve_and_layout): Likewise.
4272 (do_resolve_class): Likewise. Try first to use cl and then do the
4273 lookup on the decl when calling check_pkg_class_access.
4274 (complete_class_report_errors): Use IC_TYPE in place of
4275 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
4276 instead of doing a lookup over the decl.
4277 (java_check_final): Use WFL info from field tree list.
4278 (lookup_cl): Rewritten and returns a statically defined WFL node.
4279 (lookup_modifier_cl): Now uses information from WFL nodes.
4280 (process_imports): Likewise.
4281 (read_import_dir): name and cl arguments replaced by a single WFL
4282 node. Function modified accordingly.
4283 (find_in_imports_on_demand): Now uses WFL node.
4284 (check_pkg_class_access): cl argument is now a WFL node.
4285 (declare_local_variables): Fixed to use WFL nodes.
4286 (resolve_expression_name): Likewise.
4287 (build_method_invocation_stmt): name_combo argument renamed
4288 wfl. Function modified to use WFL nodes.
4289 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
4290 (lookup_method_invoke): cl is now a WFL node. Added missing
4291 IDENTIFIER_POINTER to class type decl name.
4292
4293 Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
4294
4295 * lang.c (init_parse): Now returns char* containing the filename.
4296
4297 Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
4298
4299 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
4300
4301 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
4302 * class.c (make_class_data): If flag_assume_compiled, initial class
4303 state is CSTATE_PREPARED; make superclass and interfaces direct
4304 references, rather than constant pool indexes.
4305
4306 Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4307
4308 * parser.y: Include flags.h. Removed debug variable pl.
4309 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
4310 (block:): Likewise.
4311 (labeled_statement_nsi:): Generate debug info when reducing
4312 expression_statement:.
4313 (check_pkg_class_access): get_access_flags_from_decl invokation
4314 fixed for new CLASS_* flags location.
4315 (source_end_java_method): Save/restore parser context when
4316 entering/leaving this routine. Restore lineno to its right value
4317 before calling expand_end_bindings.
4318 (build_method_invocation_stmt): build_invoke called with the
4319 current line information.
4320 (build_invoke): New argument cl. Wrap the function call around a
4321 wfl node.
4322 (refine_accessible_methods_list): Changed comment, removed
4323 unnecessary code.
4324 * parse.h: Fixed typo in comments.
4325 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
4326 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
4327 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
4328 parser_ccb_indent.
4329 * lex.c (java_lex): Record the last closing curly bracket of a
4330 function.
4331 * jcf-parse.c (jcf_parse_source): Now calls
4332 java_check_methods. Clarified comment, fixed typo.
4333
4334 1998-04-09 Dave Brolley <brolley@cygnus.com>
4335
4336 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
4337 (finish_parse): Expose for non USE_CPPLIB builds.
4338
4339 Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
4340
4341 * lang.c (lang_print_xnode): New function.
4342
4343 Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
4344
4345 * decl.c (class_dtable_decl), java-tree.h: New tree node.
4346 * class.c (get_dispatch_vector, get_dispatch_table): New functions
4347 used to build a class's dispatch table.
4348 (make_class_data): Generate dispatch table if flag_assume_compiled.
4349 Set dtable of class object to address of class_dtable_decl.
4350
4351 * decl.c (int_decl_processing): Make soft_badarrayindex_node
4352 be volatile and have side effects - generates better code.
4353
4354 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
4355 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
4356
4357 * expr.c (expand_invoke): If class is final, method is
4358 effectively final, so can call it directly.
4359
4360 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
4361
4362 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
4363
4364 Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4365
4366 * parse.y (build_method_invocation_stmt): Removed extra argument
4367 to build_invoke.
4368
4369 Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4370
4371 * expr.c (dtable_indent): Now static global.
4372 (expand_invoke): Now call invoke_build_dtable and
4373 build_invokevirtual.
4374 (invoke_build_dtable, build_invokevirtual): New functions.
4375 * jcf-io.c (find_class): Defer issuing a warning by setting
4376 jcf->outofsynch to 1.
4377 * jcf-parse.c (jcf_out_of_synch): New function.
4378 (load_class): Test this_jcf.outofsynch flag and call
4379 jcf_out_of_synch accordingly.
4380 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
4381 comment indentation.
4382 * lex.c (java_get_unicode): Fixed code indentation.
4383 (java_lex): Create string literal. Fixed typo. Removed several
4384 premature obstack_free.
4385 * parse.h: New enums for name resolution and invocation mode.
4386 (struct qualification): New data structure.
4387 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
4388 (do_resolve_class, build_method_invocation_stmt,
4389 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
4390 debug_line, identical_subpath_p, invocation_mode,
4391 refine_accessible_methods_list, build_invoke,
4392 lookup_method_invoke): New functions declared.
4393 (build_invokevirtual, invoke_build_dtable, match_java_method,
4394 build_field_ref, jcf_out_of_synch): New references to external
4395 functions.
4396 (struct parse_ctxt): Removed artificial_constructor field.
4397 * parse.y: (array_type:): Type defined for this rule.
4398 (class_type:): Installed default rule for interface_type:.
4399 (array_type:): Now build Java array type.
4400 (qualified_name:): Now use obstack_grow0.
4401 (method_declaration:): Skip the artificial constructor added to
4402 the list, if any.
4403 (abstract_method_declaration:): Execute the code only during pass 1.
4404 (block:): Installed default rule in block_statements:.
4405 (block_statement:): Add the statement to the method during pass 2.
4406 (statement_expression): Installed default rule for
4407 method_invocation:.
4408 (argument_list:): Added code to build the argument list.
4409 (method_invocation:): Added call to create the method invocation
4410 node.
4411 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
4412 (debug_line): New function for debug.
4413 (complete_class_decl): No longer do something during pass 1.
4414 (method_header): Use BUILD_PTR_FROM_NAME.
4415 (parser_qualified_classname): Use obstack_grow0. Removed bogus
4416 obstack_free.
4417 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
4418 function's main comment.
4419 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
4420 classes.
4421 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
4422 (resolve_class): Now works with arrays.
4423 (do_resolve_class, resolve_and_layout): New functions.
4424 (java_check_regular_methods): Reverse method list before and after
4425 having processed it. No longer set ctxp->artificial_constructor.
4426 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
4427 accordingly. Fixed typo in issued error message. Now use
4428 obstack_grow0.
4429 (find_in_imports_on_demand): Now use obstack_grow0.
4430 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
4431 (source_end_java_method): Call expand_expr_stmt instead of
4432 expand_expr. Calls it before calling expand_function_end.
4433 (java_method_add_stmt): Do nothing if errors were found during
4434 parsing.
4435 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
4436 (build_method_invocation_stmt, build_invoke, invocation_mode,
4437 lookup_method_invoke, refine_accessible_methods_list,
4438 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
4439 New functions.
4440 * typeck.c (build_java_signature): Properly end method signature
4441 if return type skipped.
4442 (match_java_method): New function.
4443
4444 Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
4445
4446 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
4447
4448 Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4449
4450 * expr.c (build_invoke_non_interface): New function.
4451 (methods_ident, ncode_ident): Now static globals.
4452 (expand_invoke): Use build_invoke_non_interface.
4453 * java-tree.h (struct lang_decl): New field function_decl_body.
4454 (DECL_FUNCTION_BODY): New macro.
4455 * jcf-parse.c (jcf_parse_source): Deeper check before setting
4456 CLASS_FROM_SOURCE_P.
4457 (parse_source_file): Fixed typos. Call java_layout_parsed_class
4458 before starting pass 2. Call to java_generate_parsed_class replaced
4459 by java_register_parsed_class.
4460 * lex.c: Fixed typo in header. Some line width related formating.
4461 * lex.h: Some line width related formating.
4462 * parse.h (source_end_java_method, resolve_expression_name,
4463 complete_class_decl, maybe_create_class_interface_decl,
4464 check_class_interface_creation): New static function declarations.
4465 (java_layout_parsed_class, java_method_add_stmt): New function
4466 declarations.
4467 (struct parser_ctxt): Field mark_class_generate removed. New
4468 fields class_list and artificial_constructor.
4469 * parse.y: Fixed typo in header.
4470 (class_declaration:): Call complete_class_decl when class body
4471 parsed.
4472 (method_declaration:): Call source_end_java_method in pass 2 when
4473 the method body is defined.
4474 (postfix_expression:): Do expression name resolution on sub-rule
4475 name during pass 2.
4476 (create_class, create_interface): Merged common pieces.
4477 (check_class_interface_creation, maybe_create_class_interface_decl):
4478 New functions.
4479 (complete_class_decl): New function.
4480 (register_fields): Fixed line width related typo.
4481 (method_header): Correctly skip first argument when fixing
4482 argument line. Changed the loop.
4483 (java_check_circular_reference): Now use ctxp->class_list.
4484 (java_complete_class): Removed start/stop marking.
4485 (java_check_regular_methods): Now takes a class decl as an
4486 argument. Add default constructor if none were encountered.
4487 (java_check_methods): Now use ctxp->class_list. Changed call to
4488 java_check_regular_methods.
4489 (source_start_java_method): Set DECL_ARG_TYPE for each function
4490 arguments.
4491 (source_end_java_method, java_method_add_stmt): New functions.
4492 (java_generate_parsed_class): No longer exists.
4493 (java_layout_parsed_class, java_register_parsed_class): New functions.
4494 (resolve_expression_name): New function.
4495
4496 Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4497
4498 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
4499 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
4500 until pass initializations are done. Call read_import_dir with
4501 pass set to 0.
4502 * parse.h: (lookup_modifier_cl): New function declared.
4503 (INTERFACE_FIELD_MODIFIERS): New macro.
4504 (OBSOLETE_MODIFIER_WARNING): New macro.
4505 * parse.y: (register_fields): Class type and current field name in
4506 local variables. Check modifier(s) if adding field(s) to an interface.
4507 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
4508 and report errors using the faulty modifier line context.
4509 (lookup_modifier_cl): New function.
4510 (read_import_dir): Detect and report default import processing
4511 failure.
4512
4513 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
4514
4515 Add a pair of -fassume-compiled/-fno-assume-compiled options.
4516 * class.c (is_compiled_class): Return 1 after making sure it
4517 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
4518 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
4519 * java-tree.h (flag_assume_compiled): Add decl.
4520 * lang.c (lang_f_options): Add the flag.
4521 (flag_assume_compiled): Add decl, default to 0.
4522
4523 Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4524
4525 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
4526 (is_compiled_class): Likewise.
4527 (layout_class): Likewise.
4528 (layout_class): Detect and lay out classes defined in source code.
4529 (interface_of_p, add_interface_do, may_add_interface): New
4530 function.
4531 (add_interface): Now use add_interface_do.
4532 (add_method_1): New function.
4533 (add_method): Now use add_method_1.
4534 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
4535 (complete_start_java_method): New function.
4536 (start_java_mehod): Now call complete_start_java_method.
4537 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
4538 (expand_invoke): Likewise and fixed typo.
4539 *gjava.c: (print_super_field): Use new argument to find_class
4540 DO_CLASS_FILE.
4541 (main): Likewise.
4542 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
4543 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
4544 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
4545 IDENTIFIER_NODE.
4546 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
4547 (add_method_1, push_class): New prototypes.
4548 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
4549 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
4550 directory where the class was found.
4551 (find_class): New argument DO_CLASS_FILE. Function find_class
4552 modified accordingly.
4553 *jcf-parse.c: (fix_class_path): New function.
4554 (load_class): Use new VERBOSE argument. load_class now finds and
4555 loads/parses .class/.java files. Save read_state of current_jcf
4556 if necessary.
4557 (java_parser_abort_on_error): New macro.
4558 (jcf_parse_source, parse_source_file): New function.
4559 (jcf_parse): Fixed typo.
4560 (yyparse): Call parse_source_file () only.
4561 (process_zip_dir): Fixed typo, fix zdir->filename_length when
4562 writing the real class name back in the zip directory entry.
4563 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
4564 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
4565 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
4566 (find_class): Prototype fixed.
4567 *lex.c: Added 1998 time stamp.
4568 Removed all static global variables, moved into the parser
4569 context data structure.. Now include unistd.h if SEEK_SET not
4570 defined.
4571 (java_init_lex): Rewritten.
4572 (java_sneak_unicode): Modified current unicode access in current line.
4573 (java_unget_unicode): Likewise.
4574 (java_allocate_new_line): New allocation management.
4575 (java_read_char): Modified access and storage of unget_utf8_value.
4576 New way of processing current unicode.
4577 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
4578 (java_get_unicode): Now use the parser context.
4579 (java_lineterminator): Likewise.
4580 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
4581 of the reentrant parser implementation. Function now use the
4582 parser context data structure and java_lval. Fixed production of
4583 the float and double constant "out of range" error message. Fixed
4584 obstack use. Return integer value when hitting a modifier. Now
4585 return type for TRUE, FALSE and other predefined types. Return
4586 identifier as a TREE_LIST list containing the current line context
4587 as the TREE_VALUE sub-node.
4588 (java_unicode_2_utf8): Fixed typo in declaration.
4589 (java_lex_error): Now use the parser context data structure.
4590 *lex.h: Added 1998 time stamp.
4591 (struct java_line): New fields ref_count and next.
4592 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
4593 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
4594 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
4595 *parse.h: Added 1998 time stamp.
4596 (java_parse_source_file): Renamed from parse_source_file.
4597 (YYERROR_NOW, YYNOT_TWICE): Fixed.
4598 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
4599 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
4600 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
4601 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
4602 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
4603 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
4604 (struct parser_ctxt): New data structure to keep the parser context.
4605 *parse.y: Added 1998 time stamp, got rid of static global variables.
4606 (java_error_count, ctxp): New global variables.
4607 (%union): New value field.
4608 (numeric_type, integral_type): Rules removed.
4609 (primitive_type): Rule defined to handle integral, float, double and
4610 boolean types.
4611 (qualified_name, package_declaration,
4612 single_type_import_declaration, type_import_on_demand_declaration,
4613 modifiers, class_declaration, super, interfaces,
4614 interface_type_list, class_body, field_declaration,
4615 field_declaration, variable_declarators, variable_declarator,
4616 variable_declarator_id, method_declaration, method_header,
4617 formal_parameter_list, formal_parameter, method_body, block,
4618 static, interface_declaration, extends_interfaces,
4619 abstract_method_declaration, local_variable_declarators): Rules now
4620 define actions.
4621 (force_error, do_warning): New global statics.
4622 (push_parser_context, parser_context_save_global,
4623 parser_context_restore_global, pop_parser_context): New functions.
4624 (yyerror): Now uses the global parser context. Fixed use of obstack.
4625 (parse_error, parse_error_context, parse_warning_context,
4626 java_accstring_lookup, redefinition_error, check_modifiers,
4627 parser_add_interface, create_interface, create_class, find_field,
4628 duplicate_declaration_error, register_fields, method_header,
4629 check_modifiers_consistency, check_abstract_method_header,
4630 method_declarator, parser_qualified_classname,
4631 parser_check_super_interface, parser_check_super,
4632 parser_chain_incomplete_item, java_check_circular_reference,
4633 layout_class_from_source, java_complete_class,
4634 complete_method_decl, resolve_class, complete_class_report_errors,
4635 java_check_final, check_method_redefinition,
4636 java_check_regular_methods, java_check_abstract_methods,
4637 java_check_methods, lookup_java_interface_method2,
4638 lookup_java_method2, lookup_cl, find_name_in_single_imports,
4639 process_imports, find_in_imports, read_import_entry,
4640 read_import_dir, find_in_imports_on_demand,
4641 check_pkg_class_access, not_builtin_p, declare_local_variables,
4642 source_start_java_method, java_generate_parsed_class): New
4643 functions.
4644 *typeck.c: (signature_include_return): New global variable.
4645 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
4646 to add the function returned type in the signature.
4647
4648 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
4649
4650 * jcf-io.c (open_in_zip): Use strncmp and LEN.
4651
4652 Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
4653
4654 * Make-lang.in (java.info): Added.
4655 (java.install-info): Added
4656
4657 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
4658
4659 * Makefile.in (clean): Also remove java/parse.c.
4660
4661 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
4662
4663 Add a pair of -fbounds-check/-fno-bounds-check options.
4664 * lang.c (lang_decode_option): Add code to grok arguments.
4665 (flag_bounds_check): Add decl.
4666 (lang_f_options): New array w/ the option in it.
4667 * java-tree.h (flag_bounds_check): Add decl.
4668 * lang-options.h: New file.
4669 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
4670 of a static macro value.
4671 (JAVA_ARRAY_EXCEPTION): Delete macro.
4672
4673 Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
4674
4675 * typeck.c (build_java_array_type): Fix two bugs in previous change.
4676 * expr.c (build_anewarray): Add missing promote_type.
4677
4678 Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
4679
4680 Add array types with known length to optimize bounds checking.
4681 * typeck.c (build_java_array_type): Take length parameter.
4682 (java_array_type_length, build_prim_array_type): New functions.
4683 * java-tree.h: Update for new functions.
4684 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
4685 * class.c: Use build_prim_array_type.
4686 * expr.c (can_widen_reference_to): Handle known-length array types.
4687 (verify_jvm_instructions): Keep track of integer push instructions
4688 followed by newarray/anewarray, so we can build known-length arrays.
4689 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
4690 (java_array_data_offset): New function.
4691 (build_java_array_length_access): New function. Optimize if constant.
4692 (build_java_arrayaccess): Constant fold bounds check.
4693 (expand_java_newarray, expand_java_anewarray): Replaced by ...
4694 (build_newarray, build_anewarray): New functions.
4695 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
4696 * verify.c (merge_types): Handle known-lengh array types.
4697
4698 Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
4699
4700 * expr.c (expand_byte_code): Fix performace bug, which caused
4701 searching linenumber_table to be linear rather than constant.
4702
4703 Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
4704
4705 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
4706
4707 * decl.c, java-tree.h (soft_fmod_node): New global.
4708 * decl.c (init_decl_processing): Define __builtin_fmod.
4709 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
4710 using __builtin_fmod.
4711
4712 Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4713
4714 * keyword.h: New file, output of keyword.gperf as processed by
4715 gperf.
4716 * lex.c (java_lex_init): Initialize java_error_flag.
4717 * parse.c (YYERROR_NOW): Uses java_error_flag.
4718 * parse.y: New static java_error_flag. Useless definition of
4719 buffer_error gone.
4720 * parse.y (java_error): Portable error recovery using
4721 java_error_flag (not yet completely tuned).
4722
4723 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
4724
4725 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
4726
4727 Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4728
4729 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
4730 (parse.c, lex.c, keyword.h): New rules for Java source code
4731 front-end.
4732 * parse.c: Renamed into jcf-parse.c.
4733 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
4734 * keyword.gperf: New file, Java keywords.
4735 * parse.y: New file, Java language grammar.
4736 * parse.h: New file, Java language grammar definitions.
4737 * lex.c: New file, Java language lexer.
4738 * lex.h: New file, Java language lexer definitions.
4739
4740 Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
4741
4742 * decl.c (clinit_identifier_node), java-tree.h: New global.
4743 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
4744 * verify.c (verify_jvm_instructions): Inline use of removed macros.
4745 * expr.c (expand_java_field_op): Check for invalid assignment
4746 to final field.
4747
4748 * jcf-reader.c (get_attribute): Test for wrong attribute length.
4749
4750 Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
4751
4752 * verify.c (verify_jvm_instructions): When processing a handler,
4753 attempt to set the current_subr to the right value.
4754 (More complicated code combines Sep 17 and Oct 22 versions.)
4755
4756 Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
4757
4758 * class.c (push_class): Figure out (guess) name of source file.
4759 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
4760 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
4761 (parse_class_file): Change return type from int to void.
4762 Call debug_start_source_file/debug_end_source_file.
4763
4764 * expr.c (build_java_binop): Fix masking 2nd operand.
4765 * decl.c (init_decl_processing): Set sizetype first.
4766
4767 Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
4768
4769 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
4770 (Revert Sep 17 change.)
4771
4772 Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4773
4774 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
4775 .class extension in their name and fix thing so we don't process
4776 them parse_zip_file_entries().
4777 (parse_zip_file_entries): Cleaned unused local variables.
4778
4779 Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
4780
4781 * expr.c (can_widen_reference_to): Allows equal array element types.
4782 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
4783 * jcf-dump.c (RET): Get (and print) index.
4784
4785 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
4786 Promote element type to POINTER_TYPE.
4787
4788 Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4789
4790 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
4791 find_in_current_zip, jcf_figure_file_type): Moved from
4792 jcf-reader.c to parse.c.
4793 * zextract.c: (read_zip_archive): takes file_comment_length possible
4794 field into account.
4795
4796 Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
4797
4798 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
4799
4800 * verify.c (merge_types): Handle array types even better ...
4801
4802 Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
4803
4804 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
4805
4806 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
4807 * class.c (make_class_data): Don't build fields_decl if no fields.
4808 When building fields_decl, skip if DECL_ARTIFICAL.
4809
4810 * expr.c (java_stack_swap): Update stack_type_map.
4811 * verify.c (merge_types): Handle array types better.
4812
4813 Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
4814
4815 * class.c (add_field): Don't promote short integral fields to
4816 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
4817 * expr.c (push_value): Promote and convert short integral values.
4818
4819 * decl.c, java-tree.h (integer_two_node): New constant node.
4820 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
4821
4822 Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4823
4824 * class.c (append_gpp_mangled_type): Use function argument
4825 unpromoted type to generate mangled name.
4826
4827 Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4828
4829 * constants.c (build_constant_data_ref): Now uses current_class
4830 instead of main_class.
4831 (build_constants_constructor): Now uses current_class instead of
4832 main_class.
4833 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
4834 of the global variable SeepZipFiles done here.
4835 * zextract.c (read_zip_archive): extra_field optional field taken
4836 into account while computing the position of the class file in the
4837 archive.
4838 * verify.c (verify_jvm_instructions): Use current_jcf to search
4839 the constant pool.
4840 * parse.c (load_class): First search for the class to load in the
4841 current zip file. Saves current_jcf (restored before returning
4842 from that function). Don't call JCF_FINISH in the class was found
4843 in the current ZIP file.
4844 (jcf_parse): If the class was found in the current ZIP file, save
4845 its tree_constant_pool (for later reuse).
4846 (parse_class_file): New function. Process each method defined in
4847 the current class and record the class as to be later registered.
4848 (yyparse): Rewritten. Figure the type of the current file and switch
4849 accordingly.
4850 * lang.c: New global variable current_jcf.
4851 (lang_init): Removed compiling_from_source test (done later, in
4852 yyparse). Removed call the jcf_parse ().
4853 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
4854 (typedef struct JCF): New fields seen_in_zip (to mark a class found
4855 in the current ZIP file) and zip_offset (offset to the class data in
4856 the current zip file).
4857 * jcf-reader.c: zipfile.h included.
4858 localToFile: New ZipFileCache static global variable
4859 (parse_zip_file_entries): New function. Browse the current ZIP
4860 file directory and process each class found.
4861 (process_zip_dir): New function. Register each class found in the
4862 ZIP file directory. The class aren't parsed but a valid JCF is
4863 link to each of them.
4864 (find_in_current_zip): New function. Search for a class in the
4865 current ZIP file directory. If found, prepare the class so that it
4866 can be loaded.
4867 (jcf_figure_file_type): New function. Examine the file structure
4868 to figure a class file, a ZIP file. If none of these categories are
4869 matched, a source file is assumed.
4870 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
4871 SeenZipFile: New global variable.
4872 (open_in_zip): Use zipmember's length to accelerate the search for
4873 a member. If zipmember was NULL and zip file successfully read,
4874 return 0.
4875 * java-tree.h: New global variable current_jcf declared. Added
4876 declaration for current_constant_pool_tags, current_constant_pool_data,
4877 current_constant_pool_length, current_constant_pool_data_ref.
4878 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
4879 store the JCF of classes seen in a zip file) and tree *constant_pool
4880 (to save a loaded class constant pool). current_class declared here.
4881 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
4882 retrieve method_ref_constant.
4883 (PUSHC): java_push_constant_from_pool now uses current_jcf.
4884 (OBJECT): get_class_constant now uses current_jcf.
4885 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
4886 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
4887 (expand_invoke): Now uses current_class instead of main_class
4888 (build_class_init): Now uses current_class instead of main_class
4889 * class.c: New static global variable registered_class.
4890 (register_class): New function.
4891 (emit_register_class): Modified to use registered_class instead of
4892 main_class
4893 (is_compiled_class): Now take into account class seen in the archive.
4894
4895 Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
4896
4897 * except.h: Renamed to: java-except.h.
4898 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
4899 * except.c: Add semi-working (commented out) implementation.
4900
4901 * expr.c (expand_iinc): Add needed flush_quick_stack.
4902 * parse.c (set_source_filename): New function.
4903 (give_name_to_class): Set input_filename from package.classname.java.
4904
4905 * jcf-io.c (find_class): Don't look first in ".".
4906
4907 Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4908
4909 * zextract.c (read_zip_archive): Now takes into account the
4910 extra_field field.
4911 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
4912
4913 Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
4914
4915 * constants.c, java-tree.h (build_internal_class_name): New function.
4916 (alloc_class_constant): Re-implement using build_internal_class_name.
4917 * class.c (make_class_data): Likewise.
4918 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
4919
4920 Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
4921
4922 * verify.c (verify_jvm_instructions): Temporarily set current_subr
4923 to NULL before pushing an exception handler target.
4924
4925 * expr.c (flush_quick_stack): Save from low stack indexes to high.
4926 (java_stack_swap, java_stack_dup): Re-write to be safe from
4927 clobbering registers.
4928 (build_class_init): New function.
4929
4930 Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4931
4932 * typeck.c (build_java_array_type): Temporary use
4933 permanent_obstack to create the array 'length' field.
4934 * expr.c (lookup_label): Temporay use permanent_obstack to create
4935 label if not found.
4936 * class.c (push_super_field): Tempory use permanent_obstack.
4937
4938 Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4939
4940 * typeck.c (type_for_mode): Now handles double_type_node and
4941 float_type_node.
4942 * verify.c (verify_jvm_instructions): The instruction following
4943 the wide bytecode is checked. OPCODE_ret added to the list of
4944 wide.
4945
4946 Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
4947
4948 * class.c (make_class): Temporary use permanent_obstack. Set the
4949 class CLASS_P field to 1.
4950 (push_class): Temporary use permanent_obstack.
4951 (set_super_info): Temporary use permanent_obstack.
4952 (add_method): Temporary use permanent_obstack, set
4953 METHOD_TRANSIENT().
4954 (add_field): Temporary use permanent_obstack. Sets
4955 FIELD_VOLATILE() and FIELD_TRANSIENT().
4956 (build_class_ref): Temporary use permanent_obstack if the class
4957 isn't compiled.
4958 (build_static_field_ref): Temporary use permanent_obstack when
4959 creating field's rtl.
4960 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
4961 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
4962 and fields. Function finalized, as far as flag handling.
4963 (push_class_static_dummy_field): Temporary use permanent_obstack.
4964 (emit_register_class): Force generation of class registration at
4965 -O3 or deeper.
4966 * decl.c (end_java_method): Call permanent_allocation() before
4967 returning.
4968 * expr.c (can_widen_reference_to): Added comment to interface
4969 handling, fixed typo.
4970 (lookup_field): Now uses CLASS_P() to correct FIXME
4971 (expand_invoke): Verification on public && !static &&
4972 !abstract moved into soft_lookupinterfacemethod (kaffe).
4973 Use Object class dtable if objectref is an array when expanding
4974 invokeinterface.
4975 (java_push_constant_from_pool): Temporary use permanent_obstack
4976 for CONSTANT_string
4977 * parse.c (get_ref_constant): Temporary use permanent_obstack to
4978 create constant references.
4979 (get_constant): Temporary use permanent_obstack to create constant.
4980 (load_class): Temporary use permanent_obstack to load class.
4981 (jcf_parse): Temporary use permanent_obstack to perform class
4982 layout.
4983 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
4984 (build_java_signature): Temporary use permanent_obstack.
4985 * verify.c: (verify_jvm_instruction): removed unecessary verification
4986 on ACC_SUPER flag.
4987 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
4988 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
4989 (CLASS_P): Defined
4990
4991 Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
4992
4993 * class.c (append_gpp_mangled_type): Fix typo.
4994 (emit_register_class): Use main_class to get class object, rather
4995 than looking for no-longer-existing static decl starting with _CL.
4996 * typeck.c (parse_signature_type): Promote array element type
4997 if it is a RECORD_TYPE.
4998
4999 Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
5000
5001 * class.c (push_class_static_dummy_field): New function.
5002 (mangle_static_field): New. Do G++-style mangling of static fields.
5003 (layout_class): Mandle static fields here, not in add_field.
5004 (build_class_ref): The class object is now a dummy static field.
5005 * decl.c (find_local_variable): Look for best, instead of first match.
5006 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
5007 (build_java_athrow): Don't check here if exception is Throwable.
5008 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
5009 (TYPE_USED): Removed. No longer used ...
5010 * parse.c (jcf_parse): Call push_class_static_dummy_field.
5011 * verify.c (push_pending_label): New function.
5012 (push_pending_block): Renamed to check_pending_block.
5013 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
5014 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
5015 re-checking possible handlers) after a store (less wasted work).
5016 Check for null handler (finally) before calling add_handler.
5017 Various changes to (finally?) correctly handle try/finally.
5018
5019 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
5020
5021 * class.c: Include stdio.h.
5022
5023 Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
5024
5025 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
5026 to make sure class is initialized before static/special invoke.
5027
5028 * verify.c (verify_jvm_instructions): On a store instruction,
5029 call find_local_variable to force pre-allocation of decl and rtx.
5030 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
5031
5032 Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
5033
5034 * class.c (build_class_ref): Strip off "promoted_" if need be.
5035 (make_field_value): Call build_java_signature when needed.
5036 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
5037 * expr.c (build_java_athrow): Don't push_value of exception.
5038 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
5039 match specification of [fd]cmp[lg] for NaNs.
5040 (expand_byte_code): Add support for exception handler ranges.
5041 * except.c: Add skeleton for EH code-generation.
5042 * verify.c (merge_types): Treat all promoted integral types as equal.
5043 * constants.c (build_constants_constructor): To force creation of
5044 current_constant_pool_data_ref, call build_constant_data_ref.
5045
5046 * javaop.def (lload): Fix typo.
5047 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
5048
5049 Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
5050
5051 * parse.c: Don't include function.h.
5052
5053 Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
5054
5055 * except.[ch]: New files.
5056 * Makefile.in (JAVA_OBJS): Add except.o
5057 * expr.c: Temporary warning about unimplemented exceptions.
5058 * verify.c: Verify exception handlers.
5059
5060 * jcf-dump.c (disassemble_method): Print exception table.
5061
5062 Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5063
5064 * expr.c (verify_jvm_instructions): Started a thorough
5065 verification of invoke* bytecodes.
5066 (expand_byte_code): flush quick stack if PC is the target of a
5067 branch. and undef RET (conflicting with config/i386/i386.h).
5068 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
5069 used.
5070 (expand_invoke): Now handles invokeinterface and do more
5071 verification according to the bytecode.
5072 (lookup_field): Don't try to load the class if processing
5073 dtable_type.
5074 (can_widen_reference_to): Now handles interfaces.
5075 * decl.c (init_decl_processing): New global variable
5076 soft_lookupinterfacemethod_node, declared in java-tree.h.
5077 Call set_super_info on string_type_node.
5078 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
5079 defined.
5080 * class.c (set_super_info): Fills the CLASS_* flags according to
5081 access_flags.
5082 (get_access_flags_from_decl): Handles all class flags.
5083
5084 Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
5085
5086 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
5087 * parse.c (yyparse): Check for abstract method, and missing code.
5088 * expr.c (expand_byte_code): Change interface.
5089 * lang.c (put_decl_node): Print promoted types prettier.
5090 * verify.c (verify_jvm_instruction): Change interface.
5091 Partial support for scanning exception table.
5092 For load instructions, handle promoted integral types.
5093
5094 Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
5095
5096 * verify.c: New file, with contents moved from expr.c.
5097 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
5098 * typeck.c (is_array_type_p): Moved here from expr.c.
5099 * java-tree.h: Add some now-needed function declarations.
5100 * Makefile.in (JAVA_OBJS): Added verify.o.
5101
5102 Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5103
5104 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
5105 METHOD_ABSTRACT flag.
5106
5107 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
5108 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
5109 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
5110
5111 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
5112 variables.
5113 (start_java_method): Hook for SYNCHRONIZED methods.
5114
5115 * expr.c (build_java_jsr, build_java_ret): New functions
5116 (JSR,PRE): New macros
5117 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
5118 (verify_jvm_instructions): tableswitch, lookupswitch,
5119 monitorenter, monitorexit, goto_w: verified.
5120 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
5121 (build_java_monitor): New function.
5122 (MONITOR_OPERATION): Modified to call build_java_monitor()
5123 (verify_jvm_instructions): Started a thorough verification of
5124 invoke* bytecodes.
5125
5126 Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
5127
5128 Support verification of jsr/ret subroutines (used for try/finally).
5129 * decl.c (return_address_type_node): New type node.
5130 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
5131 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
5132 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
5133 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
5134 TYPE_USED): New macros for special types in type_map.
5135
5136 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
5137 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
5138 BCODE_JUMP_TARGET.
5139 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
5140
5141 * expr.c (can_widen_reference_to): New function.
5142 (pop_type): Use it.
5143 (merge_type_state): Support handling start of subroutine.
5144 (push_pending_block): Return char* error message, instead of calling
5145 fatal on an error. Also handle subroutines.
5146 (verify_jvm_instructions): Handle errors from push_poending_block.
5147 Support jsr and ret instructions.
5148
5149 Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
5150
5151 * jcf-io.c (find_classfile): Fix thinko.
5152 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
5153
5154 Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
5155
5156 * Makefile.in (BISON): Remove.
5157
5158 Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
5159
5160 * Makefile.in: Convert to autoconf.
5161 * config-lang.in (outputs): Added java/Makefile.
5162
5163 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
5164 Rename cc1java to jc1.
5165
5166 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
5167 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
5168
5169 * class.c (class_depth): Do load_class if needed.
5170
5171 Mostly better verification.
5172 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
5173 (init_decl_processing): Change return type of soft_checkcast.
5174 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
5175 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
5176 lang_print_error): New functions.
5177 (lang_init): Set global hook print_error_function to lang_print_error.
5178 * expr.c: In the type_map ptr_type_node is only used for null now.
5179 (pop_type, merge_types): Hence ptr_type_node matches any reference.
5180 (merge_types): Dererence pointer to record types before comparing.
5181 (decode_newarray_type, merge_types): On error just return NULL.
5182 (build_java_binop): Add preliminary implementation (with warning)
5183 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
5184 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
5185 (expand_compare, expand_java_goto, expand_java_call): Don't
5186 push_pending_block, since that only makes sense when verifying.
5187 (merge_type_state): Different return codes.
5188 (push_pending_block): A block may need to be verified more than once.
5189 (expand_byte_code): Warn about unused code at code generation time.
5190 (verify_jvm_instruction): Changed logic, since code may need to be
5191 re-verified if type-state has changed. Also, better error handling.
5192 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
5193 Improve newarray, anewarray, ?aload, athrow,
5194 * java-tree.h (LABEL_CHANGED): New macro.
5195
5196 Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5197
5198 * decl.c (soft_athrow_node): New global variable initialized.
5199 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
5200 * typeck.c (convert): Added support for REAL_TYPE.
5201 (convert_to_char): New function.
5202 (convert): Handle CHAR_TYPE.
5203 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
5204 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
5205 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
5206 promoted type.
5207 (verify_jvm_instructions): Added break a the end of bogus unop: label.
5208 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
5209 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
5210 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
5211 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
5212 to Use The Right Things.
5213 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
5214 compatible with INT. BOOLEAN is made equivalent to BYTE.
5215 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
5216 OPCODE_ifnonnull): Now supported.
5217 (build_java_athrow): New function.
5218
5219 Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
5220
5221 Rename method name <init> to match G++ (and fix mangling).
5222 * class.c (layout_class): Replace method name of <init> by class name.
5223 (make_method_value): Do inverse renaming of constructor from <init>.
5224 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
5225 * typeck.c (lookup_java_constructor): New function.
5226 * expr.c (expand_invoke): If method_name is <init>, call
5227 lookup_java_constructor to find constructor.
5228
5229 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
5230
5231 Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5232
5233 * parse.c (get_class_constant): Modified to handle array "classes"
5234 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
5235 wide type.
5236 (convert): Modified to handle real type.
5237 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
5238 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
5239 variables declared.
5240 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
5241 soft_multianewarray, soft_newarray_node, soft_throw_node): New
5242 global variables initialized.
5243 (find_local_variable): Handles the case of a pointer
5244 (end_java_method): Restore the use of one more scope
5245 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
5246 build_java_array_length_access, expand_java_arrayload,
5247 expand_java_arraystore, expand_java_array_length,
5248 expand_java_multianewarray, expand_java_anewarray,
5249 build_java_check_indexed_type, is_array_type_p,
5250 build_java_throw_out_of_bound_exception): New functions.
5251 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
5252 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
5253 OPCODE_<t>aload): Implemented code for verification.
5254 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
5255 ARRAY_NEW_MULTI): Macro defined.
5256 (CONVERT): Modified to invoke convert().
5257 (case OPCODE_aload2): Fixed index typo from 2 to 1.
5258
5259 Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
5260
5261 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
5262 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
5263 (make_class_data): Field name needs '/' as package prefix.
5264 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
5265
5266 Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
5267
5268 Implement debug information for local variables.
5269 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
5270 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
5271 DECL_LOCAL_SLOT_CHAIN): New macros.
5272 (struct lang_decl_var): New type.
5273 * parse.c (give_name_to_locals): Move to decl.c.
5274 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
5275 (start_java_method): Re-write parameter handling.
5276 (pending_local_decls): New global variable.
5277 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
5278 (find_local_variable): Accept pc so we can skips decls not in range.
5279 (struct binding_level): Add end_pc field.
5280 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
5281 (various): Change so current pc gets passed to find_local_variable.
5282
5283 * decl.c (init_decl_processing): Re-arrange fields in
5284 class_type_node and and method_type_node to match kaffe 0.9.1.
5285 * class.c (make_method_value, make_class_data): Update
5286 initializations to match.
5287
5288 Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
5289
5290 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
5291 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
5292 (push_super_field): New function.
5293 (make_class_data): Handle inheritance of class static initializer.
5294 (layout_class): New name mangling.
5295 * constants.c (build_constant_data_ref): Init type of data array
5296 to a one-element array.
5297 (build_constants_constructor): Set DECL_SIZE from complete array type.
5298 * decl.c: Rename class_type, object_type etc to class_type_node,
5299 object_type_node etc. Make former inherit from latter.
5300 * expr.c (expand_invoke): Add cast of function address.
5301 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
5302 * parse.c (yyparse): Don't call layout_class here.
5303 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
5304
5305 Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
5306
5307 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
5308 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
5309 (alloc_class_constant): New.
5310 * expr.c (expand_invoke): Make sure method's class is initialized.
5311 * class.c (interits_from_p, emit_register_class): New functions.
5312 * parse.c (yyparse): Call emit_register_class.
5313
5314 Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
5315
5316 * constants.c: New file, to handle constant pool.
5317 * Makefile.in (JAVA_OBJS): Add constants.o.
5318 * decl.c (init_decl_processing): Update, fix, finish various structs.
5319 (pushdecl_top_level): New.
5320 * parse.c (layout_class): Moved to class.c.
5321 * expr.c (java_push_constant_from_pool): New function.
5322 * class.c (build_class_ref): Make work fully
5323 (make_class_data): Emit super-class, constant pool, interface vector.
5324
5325 Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
5326
5327 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
5328 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
5329 * class.c (class_depth): New function.
5330 (lookup_named_class): Replaced by new function lookup_class.
5331 * decl.c (object_type_node, string_type_node): New.
5332 Remove various types that we no longer need.
5333 * expr.c (verify_jvm_instructions): New separate verifier pass.
5334 (push_type, pop_type): New functions for verifier.
5335 (type_stack_dup, pop_argument_types, merge_types): Likewise.
5336 (expand_byte_code): Simplify, since we assume already verified.
5337 (expand_invoke): Now mostly works.
5338 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
5339 * lang.c (main_class): Move to parse.c. Don't make_class yet.
5340 * parse.c: Wait to allocate class object until we know its name.
5341 (layout_class): Calculate DECL_VINDEX for each virtual method.
5342 * typeck.c (get_array_type): Rename to ...
5343 (build_java_array_type): ... and provide working implementation.
5344 (build_java_signature): New function - build Java signature of type.
5345 (set_java_signature): New function - cache signature with type.
5346 (lookup_java_method): New function.
5347
5348 Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
5349
5350 * class.c (ident_subst): Take extra SUFFIX parameter.
5351 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
5352 (set_constant_value, build_static_field_ref, is_compiled_class): New.
5353 (build_class_ref): Actually implement.
5354 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
5355 * decl.c (builtin_function): New.
5356 (init_decl_processing): Update for current Kaffe. Declare some
5357 builtin Kaffe functions.
5358 * expr.c (build_address_of): New.
5359 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
5360 Renamed (from expand_java_new etc), and added working implementations.
5361 (build_field_ref): Now also handle static fields.
5362 (expand_invoke): Implement invokestatic, and start implement rest.
5363 * java-opcodes.h: Use javaop.def to avoid duplicated list.
5364 * javaop.def: Rename invokevirt -> invokevirtual.
5365 * lang.c (use_handles): Removed.
5366 * parse.c: Add support for ConstantValue atribute.
5367 Handle nested loading of a class. (JPOOL_UTF): New.
5368
5369 Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
5370
5371 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
5372
5373 Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
5374
5375 * Make-lang.in (java.install-man): New empty rule.
5376 * typeck.c (set_local_type): New function.
5377 * expr.c (STORE_INTERNAL): Call find_local_variable,
5378 not find_stack_slot. Call set_local_type.
5379
5380 Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
5381
5382 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
5383 and building RECORD_TYPE CONSTRUCTORs.
5384 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
5385
5386 * lang.c (use_handles): Change the default to 0.
5387 * decl.c: Define and build class_type, field_type, utf8const_type.
5388 * class.c (make_class_data, make_field_value,
5389 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
5390 hashUtf8String, strLengthUtf8, mangled_classname:
5391 Functions to build reflective data structures.
5392 * parse.c (yyparse): Call make_class_data.
5393
5394 * jcf-io.c (open_class, find_classfile): New functions.
5395 * jcf-dump.c: Support reading classfile from explicitly-named
5396 class file (without CLASSPATH searching).
5397
5398 Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
5399
5400 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
5401 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
5402 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
5403 (get_constant): Now trivial for CONSTANT_Utf8.
5404
5405 * jcf.h: Make NEW_CPOOL the default.
5406 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
5407
5408 Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>
5409
5410 New directory.