1 Mon Aug 16 01:29:24 PDT 1999 Jeff Law (law@cygnus.com)
5 Tue Aug 10 00:28:31 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
7 * jvgenmain.c (main): NUL-terminate name_obstack.
9 Wed Jul 28 21:39:31 PDT 1999 Jeff Law (law@cygnus.com)
13 Sun Jul 25 23:40:51 PDT 1999 Jeff Law (law@cygnus.com)
17 1999-06-29 Tom Tromey <tromey@cygnus.com>
19 * jvspec.c (lang_specific_driver): Recognize --help.
21 Fri Jun 25 13:35:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
25 * parse.y (resolve_package): Fixed bogus return statement.
26 (patch_method_invocation): Resolve method invocation beginning with
27 a package name qualifier.
29 * parse.y (java_complete_lhs): When doing cross referencing, don't
30 try to keep file location on a WFL expanded as a CALL_EXPR.
32 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
33 compiling to class file a void method with an empty method body.
34 As a side effect, the bytecode backend will generate the
35 appropriate `return' instruction.
37 * parse.y (lookup_package_type_and_set_next): New function prototype.
38 (resolve_package): Search current and imported packages.
39 (lookup_package_type_and_set_next): New function.
41 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
43 * Make-lang.in (java.stage1): Depend on stage1-start.
44 (java.stage2): Likewise for stage2-start.
45 (java.stage3): Likewise for stage3-start.
46 (java.stage4): Likewise for stage4-start.
48 1999-06-22 Andrew Haley <aph@cygnus.com>
50 * verify.c (verify_jvm_instructions): Check for pending blocks
51 before invalid PC test and opcode switch, not after.
53 1999-06-21 Andrew Haley <aph@cygnus.com>
55 * except.c (find_handler_in_range): The upper limit for exception
56 ranges is exclusive, not inclusive: (start <= pc < end).
57 (link_handler): find child pointer which points to outer by
58 searching sibling list: previous code incorrectly assumed that
59 outer->outer->first_child must point to outer.
60 * verify.c (verify_jvm_instructions): FIXME added to code for
62 (verify_jvm_instructions): Do not assume that the last block
63 processed in a subroutine is a block which ends with a `ret'
64 instruction. With some control flows it is possible that the last
65 block ends with an `athrow'.
67 Mon Jun 14 13:13:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
69 * parse.y (qualify_ambiguous_name): Reorganized the post
70 evaluation of non WFL leading expression nodes.
72 Fri Jun 11 21:37:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
74 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
77 Thu Jun 10 22:26:17 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
79 * parse.y (qualify_ambiguous_name): Handle qualified expression
80 beginning with a STRING_CST.
82 Thu Jun 10 20:27:25 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
84 * parse.y (register_fields): Set DECL_INITIAL on both
85 pre-initialized static and public fields.
86 (resolve_field_access): Static field access expressions to always
88 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
89 qualification. CONVERT_EXPR to be resolved as an expression name.
90 (java_complete_lhs): Identify and access qualified final
91 initialized field in switch statement case expression.
92 (fold_constant_for_init): Pre-initialized field decl constant to
95 Mon Jun 7 16:09:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
97 * parse.y (note_possible_classname): Mark returned node with
98 QUALIFIED_P only if the original class name contained a '/'.
100 Sat Jun 5 11:46:59 1999 Anthony Green <green@cygnus.com>
102 * Make-lang.in (gcjh): More parallel build fixes.
104 1999-06-03 Mike Stump <mrs@wrs.com>
106 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
108 Wed Jun 2 10:44:38 1999 Anthony Green <green@cygnus.com>
110 * except.c (link_handler): Chain exception handlers in order.
112 Wed Jun 2 10:41:24 1999 Anthony Green <green@cygnus.com>
114 * expr.c (expand_byte_code): Fill unreachable bytecode regions
115 with nops and process as usual in order to always set correct EH
116 ranges. Emit detailed warnings about unreachable bytecodes.
118 Wed Jun 2 10:35:13 1999 Anthony Green <green@cygnus.com>
120 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
123 Fri May 28 18:22:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
125 * parse.y (lookup_field_wrapper): Unified returned value to NULL
126 or the searched field decl.
128 Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
130 * parse.y (fold_constant_for_init): Convert numerical constant
131 values to the type of the assigned field.
133 Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
135 * expr.c (lookup_field): Relaxed the test on class loading error
137 * parse.y (fold_constant_for_init): Enabeled old code.
139 Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
141 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
142 decide the validity of the cast of a java.lang.Cloneable reference
144 (patch_conditional_expr): Fixed first argument passed to
145 binary_numeric_promotion.
147 Wed May 26 15:33:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
149 * parse.y (qualify_ambiguous_name): Take into account that a
150 CONVERT_EXPR might specify a type as a WFL.
152 Tue May 25 15:06:13 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
154 * parse.y (patch_assignment): Save the rhs before using it as an
155 argument to _Jv_CheckArrayStore.
157 Tue May 25 11:23:59 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
159 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
161 Mon May 24 13:26:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
163 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
164 floating point litteral only when the exponent indicator has been
167 Sat May 22 13:54:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
169 * parse.y (formal_parameter:): Construct argument tree list
170 element even if a yet unsupported final parameter was encountered.
172 Tue May 18 00:28:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
174 * parse.y (finish_method_declaration): Issue errors for native or
175 abstract methods declared with a method body, as well as for non
176 native or non abstract methods with no method body.
178 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
180 * class.c (build_utf8_ref): Initialize variable `field'.
182 * decl.c (init_decl_processing): Initialize variable `field'.
184 * expr.c (build_known_method_ref): Mark parameters `method_type',
185 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
186 (process_jvm_instruction): Likewise for parameter `length'.
188 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
189 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
192 * parse.y (maybe_generate_clinit): Remove unused variable
193 `has_non_primitive_fields'.
194 (find_in_imports_on_demand): Initialize variables `node_to_use'
196 (patch_binop): Likewise for variable `prom_type'.
197 (patch_unaryop): Likewise for variable `prom_type'.
199 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
201 * xref.c (xref_table): Add missing initializer.
203 1999-05-14 Tom Tromey <tromey@cygnus.com>
205 * java-except.h (struct eh_range): Removed unused `next' member.
206 * verify.c (verify_jvm_instructions): Call check_nested_ranges
207 after adding all exception handlers. Sort exception ranges in
209 (struct pc_index): New structure.
210 (start_pc_cmp): New function.
211 * except.c (add_handler): Return `void'. Don't call link_handler;
212 instead construct an ordinary linked list and do range
214 (check_nested_ranges): New function.
215 (link_handler): Changed interface to allow merging of eh_ranges.
216 Split overlapping ranges. Return `void'.
218 Mon May 17 19:20:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
220 * parse.y (constructor_block_end:): New rule, tagged <node>.
221 (constructor_body:): Use `constructor_block_end' instead of
224 Mon May 17 18:01:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
226 * parse.y (statement_nsi:): Pop `for' statement block.
227 (java_complete_lhs): Labeled blocks containing no statement are
228 marked as completing normally.
230 Fri May 14 12:31:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
232 * xref.c (xref_set_current_fp): New function, defined.
233 * xref.h (xref_set_current_fp): New function, prototyped.
235 Fri May 14 11:57:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
237 * check-init.c (check_init): Take into account that
238 LABELED_BLOCK_STMT can be empty.
240 Thu May 13 18:30:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
242 * parse.y (java_check_regular_methods): Warning check on not
243 overriding methods with default access in other packages does not
245 (java_complete_lhs): If block body is an empty_stmt_node, replace
246 it by NULL_TREE. This prevents gcc from generating an irrelevant
249 Thu May 13 13:23:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
251 * check-init.c (check_init): Removed code accepting to see things
252 falling through default:, when doing xrefs.
253 * java-tree.h (do_not_fold): New global variable, declared.
254 * parse.y (do_not_fold): New global variable, defined.
255 (java_complete_expand_method): Set `do_not_fold' to the value of
256 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
257 and reinstall them after them have been purged; do not check for
258 initializations; do not issue missing return errors.
259 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
261 (patch_binop): Skip the fold part when doing xrefs.
262 (build_string_concatenation): Skip the concatenation part when
264 (patch_synchronized_statement): Do not generate a try-finally when
266 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
267 and keep the location where the throw was seen.
268 * typeck.c (convert): When `do_not_fold' is set, do not attempt
269 any treatment on the converted node an simply return a NOP_EXPR of
271 * xref.c (xref_get_data): New function, defined.
272 * xref.h (xref_get_data): New function, declared.
273 (XREF_GET_DATA): Use xref_get_data.
275 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
277 * gjavah.c (print_include): Cast the result of `strlen' to int
278 when comparing against a signed value.
279 (add_namelet): Likewise.
281 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
283 * expr.c (expand_invoke): Mark parameter `nargs' with
285 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
287 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
290 * jcf-reader.c (get_attribute): Cast a value to long
291 when comparing against a signed expression. Likewise.
293 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
296 1999-05-11 Andrew Haley <aph@cygnus.com>
298 * parse.y (source_end_java_method): If the current method contains
299 any exception handlers, force asynchronous_exceptions: this is
300 necessary because signal handlers in libjava may throw exceptions.
301 * decl.c (end_java_method): Ditto.
303 1999-05-11 Tom Tromey <tromey@cygnus.com>
305 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
307 * jvspec.c (THREAD_NAME): Removed.
310 (WITHLIBC): Likewise.
312 (THREADLIB): Likewise.
313 (MATH_LIBRARY): Likewise.
314 (lang_specific_driver): Don't add `-l' options to command line.
315 Instead, add a single --specs option. Recognize `-L' options and
316 use them to search for spec file.
317 (find_spec_file): New function.
318 (SPEC_FILE): New define.
320 Tue May 11 11:46:36 1999 Dave Brolley <brolley@cygnus.com>
322 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
323 cpplib-enabled build.
325 1999-05-05 Per Bothner <bothner@cygnus.com>
327 * class.c (make_field_value): DECL_INITIAL may be a string literal;
328 temporarily zero it while calling rest_of_decl_compilation.
330 * java-tree.h (string_ptr_type_node): Add declaration.
331 * decl.c: Define and initialize string_ptr_type_node.
332 * parse.y (patch_string_cst): Use string_ptr_type_node.
334 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
335 * parse.y (for_statement): Now unconditionally exit_block.
336 (finish_labeled_statement): No longer exit_block if for-loop.
337 (patch_loop_statement): Check harder if the loop is already labeled.
339 * parse.y (patch_initialized_static_field): Removed function.
340 (maybe_generate_clinit): Removed special handling for interfaces.
341 (java_complete_expand_methods): Do a preliminary java_complete_tree
342 on <clinit> to determine if it can be removed.
343 (java_complete_expand_method): Remove special handling for <clinit>.
344 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
345 optimize if we get back empty_stmt_node.
346 For MODIFY_EXPR, re-do checking of static initializers.
347 (fold_constant_for_init): Don't return immediate if VAR_DECL.
348 For VAR_DECL, pass correct context.
350 * verify.c (verify_jvm_instructions): Better error messages.
352 1999-05-03 Tom Tromey <tromey@cygnus.com>
354 * parse-scan.y (interface_declaration): Call
355 report_class_declaration for interfaces.
357 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
359 * Makefile.in: Remove -v from bison command lines.
361 Fri Apr 30 17:54:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
363 * check-init.c (check_init): Exclude a case of error when doing
365 * class.c (layout_class_method): Don't generate the error message
366 twice when compiling from source.
367 * lang-options.h: Added `-Wredundant-modifers' and
368 `-Wunusupported-jdk11' flags and help text.
369 * lang.c (lang_decode_option): Added support for
370 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
371 flag_static_local_jdk11 and flag_redundant set accordingly.
372 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
373 * parse.h (EXPR_WFL_ADD_COL): New macro.
374 (DECL_END_SOURCE_LINE): Likewise.
375 (DECL_INHERITED_SOURCE_LINE): Likewise.
376 * parse.y (static_ref_err): New function, prototyped.
377 (CCB_TK): Now tagged <operator>.
378 (class_body:): Remember the location of the closing '}' of a class
379 definition when doing xrefs.
381 (block_end:): Likewise.
382 (create_class): Remember the location of the inherited class
383 identifier when doing xrefs.
384 (register_fields): Added test on first operand of `init' before
385 testing it TREE_CODE.
386 (method_header): Store the location of the class identifier in the
387 class decl when doing xrefs.
388 (finish_method_declaration): Don't combine first/last method line
390 (java_check_regular_methods): Warning check on not overriding
391 methods with default access on other packages move before check on
392 static methods. Initialization of `aflags' also moved up.
393 (resolve_expression_name): Call static_ref_err to report the error.
394 (static_ref_err): New function, implemented.
395 (resolve_field_access): Returned simplified static field access
397 (resolve_qualified_expression_name): Check for illegal use of
398 static fields in a non static context. Call static_ref_err to
399 report error in various places.
400 (java_complete_tree): Do not fold initialized static fields when
402 (java_complete_lhs): Likewise.
404 1999-04-29 Anthony Green <green@cygnus.com>
406 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
407 create internal labels.
408 (lookup_label): Ditto.
410 Sat Apr 24 16:50:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
412 * class.c (layout_class_method): Generate <clinit>'s rtl for
414 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
415 for interfaces' <clinit>.
416 * expr.c (lookup_field): Search for fields in interfaces.
417 (expand_invoke): Fixed indentation.
418 (expand_java_field_op): Likewise. Use IS_CLINIT.
419 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
420 (IS_CLINIT): New macro.
421 * parse.y (type_declaration:): Call maybe_generate_clinit after an
422 interface was parsed.
423 (maybe_generate_clinit): Don't generate if the current class is an
424 interface with only fields of primitive types.
425 (reset_method_name): Use IS_CLINIT.
426 (java_complete_expand_method): Expand <clinit> when it exists for
427 interfaces. Use IS_CLINIT.
428 (resolve_expression_name): Use DECL_CONTEXT instead of
429 current_class to build static field references.
430 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
431 ARRAY_REF when doing xreferencing.
432 (check_final_assignment): Fixed typo in leading comment. Use
434 (patch_array_ref): Don't fully expand array references when
436 (patch_return): Use IS_CLINIT.
437 (patch_throw_statement): Likewise.
439 1999-04-22 Tom Tromey <tromey@cygnus.com>
441 * Make-lang.in (JAVA_SRCS): Added check-init.c.
443 Wed Apr 21 11:13:36 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
445 * decl.c (predef_filenames, predef_filenames_size): New globals
446 (init_decl_processing): predef_filenames and predef_filenames_size
448 * java-tree.h (predef_filenames, predef_filenames_size): Declared
450 * jcf-parse.c (predefined_filename_p): New function.
451 (yyparse): Check that files on the command line are specified only
452 once and issue a warning otherwise.
453 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
454 * parse.y (source_end_java_method): Nullify NOP method bodies, to
455 avoid a gcc warning with -W -Wall turned on.
456 (java_expand_classes): Abort if errors were encountered.
457 (java_complete_lhs): If the cross reference flag is set, wrap
458 field DECL node around a WFL when resolving expression name.
460 Mon Apr 19 14:44:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
462 * lang.c (lang_decode_option): Fixed returned value when parsing
463 `-fxref=...' and `-Wall'.
464 * parse.y (source_end_java_method): Do not generate code when
465 flag_emit_xref is set.
466 (resolve_expression_name): Do not build static field access when
467 flag_emit_xref is set.
468 (resolve_field_access): No special treatment on `length' when
469 flag_emit_xref is set. Do not build qualified static field access
470 when flag_emit_xref is set.
471 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
472 when flag_emit_xref is set.
473 (patch_assignment): Do not generate array store runtime check when
474 flag_emit_xref is set.
475 * xref.c (xref_flag_value): Fixed function declaration
477 (xset_set_data): New function.
478 * xref.h (xref_set_data): Added prototype for new function.
479 (typedef struct xref_flag_table): New field data.
480 (XREF_GET_DATA): New macro.
482 1999-04-19 Tom Tromey <tromey@cygnus.com>
484 * xref.h (enum): Removed trailing comma.
486 * parse.y (resolve_qualified_expression_name): Added missing
489 Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com>
491 * gjavah.c: New prototypes for java_float_finite and
494 Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
496 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
499 Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com)
501 * Makefile.in (TREE_H): Add tree-check.h.
502 (RTL_H): Add genrtl.h.
504 Tue Apr 6 15:15:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
506 * parse.y (patch_assignment): Added ArrayStoreException runtime
509 1999-04-06 Per Bothner <bothner@cygnus.com>
511 * expr.c (pop_type_0): New function.
512 (pop_type): Use pop_type_0.
513 * java-tree.h (pop_type_0): New declaration.
514 * verify.c (verify_jvm_instructions): Check return instructions.
516 * parse.y (patch_binop): Don't fold if non-constant and emiting
519 Mon Apr 5 16:06:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
521 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
523 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
524 (main_jcf): Don't define.
525 (process_file): Don't set `main_jcf'.
527 * java-tree.h (main_jcf): Don't declare.
529 * jcf-parse.c (main_jcf): Add static definition.
531 * lang.c (main_jcf): Don't define.
533 Mon Apr 5 15:43:51 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
535 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
537 * decl.c (copy_lang_decl): Likewise for `bcopy'.
539 * jcf-depend.c: Include "config.h", not <config.h>.
541 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
544 * jcf-path.c: Include "config.h", not <config.h>.
546 * lex.c: Don't include various system header files.
547 (java_init_lex): Cast the argument of `bzero' to PTR
549 * parse-scan.y (java_push_parser_context): Likewise.
551 * parse.y (java_push_parser_context): Likewise.
552 (patch_bc_statement): Match format specifier to variable argument.
554 * xref.c: Don't include <stdio.h>.
556 Mon Apr 5 11:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
558 * parse.y (struct parser_ctxt *ctxp): Now global.
559 (declare_local_variables): Use WFL compound value for the
560 declaration source line value, when doing cross-referencing.
562 1999-03-31 Tom Tromey <tromey@cygnus.com>
564 * gjavah.c (print_field_info): Allow constants of other types.
565 (print_include): Generate include when new name is proper prefix
566 of already printed name.
567 (add_namelet): Likewise.
568 (cxx_keyword_subst): New function.
569 (print_method_info): Use it.
570 (print_field_name): New function.
571 (get_field_name): New function.
572 (print_field_info): Use get_field_name and print_field_name.
574 Wed Mar 31 11:00:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
576 * Makefile.in (keyword.h): Generate using gperf language 'C', not
577 'KR-C', so gperf uses the `const' keyword on strings.
579 * keyword.gperf (java_keyword): Const-ify a char*.
581 Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
583 * parse.y (patch_bc_statement): Fixed identation and a bogus
586 Tue Mar 30 11:29:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
588 * parse.y (patch_assignment): Allow static variables in other
589 classes to be assigned.
591 Sun Mar 28 22:12:10 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
593 * class.c (maybe_add_interface): Remove unused variable
595 (make_class_data): Use = for assignment, not ==. Likewise.
596 (emit_register_classes): Remove unused variable `decl'.
598 * lex.c: Fix comment so as not to contain an embedded `/*'.
600 * verify.c (verify_jvm_instructions): Remove unused variable
603 Sat Mar 27 15:49:18 1999 Per Bothner <bothner@cygnus.com>
605 * parse.y (complete_loop_body): Rename to finish_loop_body.
606 (complete_labeled_statement): Rename to finish_labeled_statement.
607 (complete_for_loop): Rename to finish_for_loop.
608 (complete_method_declaration): Rename to finish_method_declaration.
610 * java-tree.h (continue_identifier_node): New global node.
611 * decl.c: Define and initialize continue_identifier_node.
612 * parse.y (generate_labeled_block): Remove - no longer needed.
613 (build_loop_body): Use continue_identifier_node for continue block.
614 (finish_labeled_statement): Also do pop_labeled_block actions.
615 (java_complete_lhs): POP_LOOP even if error.
616 (build_labeled_block): Special handling for continue_identifier_node.
617 (patch_loop_statement): Re-organize.
618 (patch_bc_statement): Re-write.
620 Sat Mar 27 15:13:21 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
622 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
623 using a WFL compound value.
624 * parse.y (xref.h): Include.
625 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
627 (register_fields): Set WFL compound value to lineno if doing
629 (java_complete_expand_method): Call expand_xref if flag_emit_xref
631 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
632 * xref.h (expand_xref): Prototype renamed from xref_generate.
634 Sat Mar 27 14:16:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
636 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
637 (GET_CURRENT_BLOCK): New macro.
638 * parse.y (current_static_block): New global variable.
639 (method_body:): Define action.
640 (complete_method_declaration): Set current_function_decl to NULL
641 when work on the current method is done.
642 (declare_local_variables): Use GET_CURRENT_BLOCK.
643 (java_method_add_stmt): Likewise.
644 (java_complete_expand_method): Disable the use of `this' when
646 (enter_a_block): If no current method exist, use
647 current_static_block to link static initializer blocks.
648 (exit_block): Rewritten to use current_static_block when no current
650 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
651 (patch_return): Forbid the use of `return' in static initializers.
652 (patch_throw_statement): Fixed indentation. Issue specific error
653 for uncaught thrown checked exception in static initializer
654 blocks. Removed FIXME.
656 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
658 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
661 Tue Mar 23 10:48:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
663 * parse.y (find_applicable_accessible_methods_list): When dealing
664 with interface: ensure that a given interface or java.lang.Object
665 are searched only once.
667 Tue Mar 23 10:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
669 * gjavah.c (print_c_decl): Remove unused argument `flags'.
671 * jcf-dump.c (print_access_flags): Add braces around if-else.
673 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
676 * lex.c (build_wfl_node): Add static prototype.
678 * lex.h (build_wfl_node): Remove static prototype.
680 * parse.y: Include lex.c early enough to declare everything needed.
681 Ensure calls to `build_wfl_node' pass the proper arguments.
682 (create_class): Remove unused variable `super_decl'.
683 (get_printable_method_name): Initialize variable `name'.
685 Mon Mar 22 20:14:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
687 * Changelog: Fixed 1999-03-22 typos.
688 * lang.c (lang_decode_option): Fixed typo in error string in the
691 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
693 * Makefile.in (JAVA_OBJS): Added entry xref.o.
695 * java-tree.h (flag_emit_xref): Declared extern.
696 * lang.c (xref.h): Included.
697 (flag_emit_xref): New global variable.
698 (lang_decode_option): Added support for -fxref.
702 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
704 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
707 Sun Mar 21 08:30:30 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
709 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
710 $(srcdir)/../system.h and $(JAVA_TREE_H).
711 (jcf-io.o): Depend on $(JAVA_TREE_H).
712 (mangle.o): Likewise.
714 * check-init.c (check_cond_init): Add static prototype.
716 * class.c (build_java_method_type, hashUtf8String,
717 make_field_value, get_dispatch_vector, get_dispatch_table,
718 append_gpp_mangled_type, mangle_static_field): Likewise.
719 (strLengthUtf8): Hide unused definition.
720 (hashUtf8String): Const-ify.
721 (make_field_value): Un-ANSI-fy.
723 * constants.c: Move inclusion of jcf.h above java-tree.h.
724 (set_constant_entry, find_class_or_string_constant,
725 find_name_and_type_constant, get_tag_node,
726 build_constant_data_ref): Add static prototype.
728 * decl.c (push_jvm_slot, builtin_function,
729 lookup_name_current_level): Likewise.
730 (builtin_function): Const-ify.
732 * except.c (expand_start_java_handler, expand_end_java_handler):
733 Add static prototype.
735 * expr.c (flush_quick_stack, push_value, pop_value,
736 java_stack_swap, java_stack_dup, build_java_athrow,
737 build_java_jsr, build_java_ret, expand_java_multianewarray,
738 expand_java_arraystore, expand_java_arrayload,
739 expand_java_array_length, build_java_monitor, expand_java_pushc,
740 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
741 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
742 expand_compare, expand_test, expand_cond, expand_java_goto,
743 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
744 expand_java_field_op, java_push_constant_from_pool): Likewise.
746 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
747 (build_java_arraynull_check): Mark parameters `node' and `type'
748 with ATTRIBUTE_UNUSED.
749 (note_label): Likewise for parameter `current_pc'.
750 (expand_java_call, expand_java_ret): Hide unused definition.
752 * java-tree.h (make_class, build_constants_constructor,
753 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
754 init_outgoing_cpool, register_class, emit_register_classes,
755 java_layout_seen_class_methods): Prototype.
756 (unicode_mangling_length): Const-ify.
757 (append_gpp_mangled_name, append_gpp_mangled_classtype,
758 emit_unicode_mangled_name, format_int, format_uint,
759 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
760 jcf_print_utf8_replace, open_class): Prototype.
762 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
763 <stdio.h>. Include tree.h/java-tree.h.
764 (utf8_equal_string usage, process_class): Add static prototype.
765 (open_class): Don't prototype this here.
766 (utf8_equal_string): Match arguments to format specifiers.
767 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
768 TABLE_SWITCH, disassemble_method): Likewise.
770 * jcf-io.c: Include tree.h/java-tree.h.
771 (open_class, find_classfile, jcf_print_utf8,
772 jcf_print_utf8_replace): Const-ify.
774 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
775 parse_class_file): Add static prototype.
776 (find_in_current_zip): Match definition to existing static
779 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
780 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
781 finish_jcf_block, define_jcf_label, get_jcf_label_here,
782 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
783 write_chunks, adjust_typed_op, generate_bytecode_conditional,
784 generate_bytecode_return, perform_relocations, init_jcf_state,
785 init_jcf_method, release_jcf_state, generate_classfile):
786 Add static prototype.
787 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
788 (make_class_file_name): Const-ify.
790 * jcf.h (find_classfile): Const-ify.
792 * jv-scan.c (reset_report): Remove prototype.
794 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
795 (error): Rewrite to allow varargs.
797 * lang.c (lang_f_options): Const-ify.
799 * lex.c (java_parse_escape_sequence): Add static prototype.
800 (java_allocate_new_line): Match definition to existing static
803 * mangle.c Include tree.h/java-tree.h.
804 (unicode_mangling_length, emit_unicode_mangled_name,
805 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
807 * parse.h (jdep_code): Remove trailing comma in enumeration.
808 (java_get_line_col): Move prototype outside of !JC1_LITE test.
809 (reset_report): Add prototype.
811 * verify.c (push_pending_label, merge_types): Add static
814 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
816 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
818 * parse.y (find_applicable_accessible_methods_list): Extend the
819 search to superinterfaces when relevant.
820 (search_applicable_methods_list): New function.
822 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
824 * class.c (unmangle_classname): Implemented stricter testing
825 before setting the QUALIFIED_P flag on an identifier.
827 Tue Mar 16 15:15:41 1999 Per Bothner <bothner@cygnus.com>
829 * parse.y (java_complete_lhs): Call force_evaluation_order
830 after patch_newarray.
831 (patch_binop): Don't call fold if there are side effects.
833 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
835 * parse.y (java_stabilize_reference): Use save_expr instead of
836 building a SAVE_EXPR node.
837 (java_complete_lhs): Patch the resulting string of the `+='
838 operator (if necessary) and complete the RHS after having built
841 Mon Mar 15 12:18:29 1999 Per Bothner <bothner@cygnus.com>
843 * class.c (make_class): Don't set CLASS_P here (because
844 this function is also called by build_java_array_type).
845 (push_class): Set CLASS_P here instead.
846 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
848 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
849 context. If the context is class, perfer "super" over "synchronized".
850 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
852 * parse.y (create_class): Don't call parser_check_super here;
853 it is not robust. Always wait until later.
855 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
856 match what JDK 1.2 does), but don't set ACC_PUBLIC.
858 Sat Mar 13 18:16:34 1999 Per Bothner <bothner@cygnus.com>
860 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
861 * lex.h (UNGETC): Change misleading macro.
863 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
865 * parse.y (java_stabilize_reference): Return NODE when patching a
867 (java_complete_lhs): Put parenthesis around truth values.
869 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
871 * class.c (layout_class_method): Don't make rtl for interface
873 * parse.h (GET_TYPE_NAME): New macro.
874 * parse.y (if_then_statement:): Fixed indentation.
875 (if_then_else_statement:): Likewise.
876 (for_statement:): Fixed spacing.
877 (try_statement:): Fixed indentation.
878 (create_interface): Don't force interfaces to be abstract.
879 (method_header): Abstract methods are OK in interfaces.
880 (declare_local_variables): Fixed typo in comment.
881 (java_complete_expand_method): Fixed indentation.
882 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
883 non accessible fields.
884 (java_stabilize_reference): New function.
885 (java_complete_lhs): Fixed indentation. Use
886 java_stabilize_reference in compound assignement. Insert the
887 cast. If not processing `+' fix string constants before processing
890 Fri Mar 12 19:42:55 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
892 * constants.c (find_class_or_string_constant): Cast variable `j'
893 to a `jword' when comparing against one.
895 * expr.c (java_lang_expand_expr): Remove unused variables
896 `has_finally_p' and `op0'.
898 * gjavah.c (print_field_info): Cast a value to jint when comparing
899 against one. Likewise for a jlong.
900 (add_namelet): Likewise cast a `sizeof' to an int when comparing
901 against a signed quantity.
903 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
904 (print_signature): Don't needlessly dereference variable `str'
906 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
907 `max_locals' with ATTRIBUTE_UNUSED.
908 (jcf_parse_class): Likewise for variable `index'.
910 * parse.h (reverse_jdep_list): Remove static prototype.
912 * parse.y (build_jump_to_finally): Remove prototype and definition.
913 (reverse_jdep_list): Add static prototype.
915 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
916 `assignment' and `expr_decl'.
918 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
920 1999-03-12 Andrew Haley <aph@cygnus.com>
922 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
923 we'll need a directory separator and a null character.
925 Wed Mar 10 23:20:11 1999 Per Bothner <bothner@cygnus.com>
927 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
929 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
931 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
934 Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
936 * lex.c (java_parse_end_comment): Take extra parameter (next char).
938 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
940 * class.c (layout_class_method): A static method in a base class
941 is never overridden, so treat it like it doesn't exist.
942 However, do complain about private non-static method overriding
943 public static method.
945 * parse.y: Don't set unused INITIALIZED_P flag.
946 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
948 * parse.y (find_expr_with_wfl): Optimize tail-calls.
949 (build_array_from_name): Re-order &index[string] to &string[index].
951 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
952 error_mark (it might catch more errors, but it is more likely to lose).
954 Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
956 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
957 (parse-scan.o): Depend on toplev.h.
959 * class.c (make_method_value): Add prototype. Make it static.
960 Remove unused second argument, caller changed.
962 * expr.c (java_lang_expand_expr): Remove unused variable
965 * java-tree.h: Don't prototype find_in_current_zip.
966 Add prototypes for verify_constant_pool, start_java_method,
967 end_java_method, give_name_to_locals, expand_byte_code,
968 open_in_zip, set_constant_value, find_constant1, find_constant2,
969 find_utf8_constant, find_string_constant, find_class_constant,
970 find_fieldref_index, find_methodref_index, write_constant_pool,
971 count_constant_pool_bytes and encode_newarray_type.
973 * jcf-dump.c: Remove unused variable `LONG_temp'.
975 * jcf-parse.c: Include parse.h.
976 (jcf_parse_source): Remove unused parameter, all callers changed.
977 (jcf_figure_file_type): Add static prototype.
978 (find_in_current_zip): Likewise. Also remove unused parameter,
980 (read_class): Initialize variable `saved_pos'.
982 * jcf-reader.c (jcf_parse_preamble): Mark variables
983 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
985 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
986 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
987 (java_parse_doc_section): Initialize variable `seen_star'.
988 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
989 (java_lex_error): Mark parameters `msg' and `forward' with
991 (java_get_line_col): Mark parameters `filename' and `line' with
994 * parse-scan.y: Include toplev.h.
995 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
997 * parse.h: use `struct JCF', not plain `JCF'.
998 (java_parser_context_save_global, java_expand_classes
999 java_parser_context_restore_global, java_parse): Add prototypes.
1001 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
1004 Wed Feb 24 16:13:59 1999 Per Bothner <bothner@deneb.cygnus.com>
1006 * check-init.c (check_init): COPYN takes word count, not bit count.
1008 Fri Feb 26 14:06:21 1999 Per Bothner <bothner@cygnus.com>
1010 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
1011 explicit build_decl. (Avoids crash in reload when optimizing.)
1013 Thu Feb 25 21:05:04 1999 Per Bothner <bothner@cygnus.com>
1015 * decl.c (complete_start_java_method): Handle synchronized method
1016 even when compiling from bytecode.
1018 1999-02-26 Tom Tromey <tromey@cygnus.com>
1020 * gjavah.c (add_class_decl): Only generate `#include' if outer
1021 class is not the name of the class we are processing. Correctly
1022 append `.h' in #include.
1023 (process_file): Clean up newlines around generated `#include's.
1024 (decode_signature_piece): Correctly handle inner classes.
1025 (struct include): New structure.
1026 (all_includes): New global.
1027 (print_include): New function.
1028 (add_class_decl): Use it.
1029 (process_file): Likewise.
1030 (add_class_decl): Generate include for java-array.h if array
1032 (process_file): Don't generate java-array.h include.
1034 * gjavah.c (add_namelet): Check for standard package names here.
1035 (add_class_decl): Don't check for standard package names here.
1037 1999-02-25 Tom Tromey <tromey@cygnus.com>
1039 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
1040 When reading a zip file, only use strncmp if both strings are
1041 bigger than the buffer length. Initialize `k' when looping
1044 1999-02-24 Tom Tromey <tromey@cygnus.com>
1046 * gjavah.c (struct namelet): New structure.
1047 (add_namelet): New function.
1048 (print_namelet): New function.
1049 (print_class_decls): Use add_namelet and print_namelet to generate
1050 namespaces and not classes.
1051 (method_printed): New global.
1052 (HANDLE_END_METHOD): Examine method_printed.
1053 (print_method_info): Set method_printed when required. Print
1054 error if function to be ignored is marked virtual. Handle $finit$
1056 (METHOD_IS_FINAL): New macro.
1057 (print_field_info): Use it.
1058 (HANDLE_METHOD): Clear method_printed.
1059 (method_pass): New global.
1060 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
1061 (process_file): Do two passes over both fields and methods.
1062 (HANDLE_METHOD): Examine method_pass.
1064 (add_class_decl): New function.
1065 (print_class_decls): Don't scan over entire constant pool.
1067 1999-02-23 Tom Tromey <tromey@cygnus.com>
1069 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
1070 disable linking in that case.
1072 1999-02-20 Tom Tromey <tromey@cygnus.com>
1074 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
1077 Sun Feb 21 14:56:11 1999 Per Bothner <bothner@cygnus.com>
1079 * decl.c (build_result_decl), java-tree.h: New method.
1080 (complete_start_java_method): Handle synchronized methods.
1081 Don't build DECL_RESULT here. (Ordering dependency problem.)
1082 (start_java_method): Call build_result_decl here instead ...
1083 * parse.y (java_complete_expand_method): ... and here.
1084 (expand_start_java_method): Don't call complete_start_java_method here.
1085 (java_complete_expand_method): Call it here instead.
1086 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
1087 * java-tree.h: ... here.
1089 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
1090 * parse.y (java_complete_lhs): Don't call force_evaluation_order
1091 for ARRAY_REF - it doesn't work when array bounds are checked.
1092 (patch_array_ref): Handle it here instead.
1094 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
1096 Fri Feb 19 15:35:01 1999 Per Bothner <bothner@cygnus.com>
1098 Force left-to-right evaluation of binary operations etc.
1099 * expr.c (force_evaluation_order), java-tree.h: New function.
1100 * parse.y (java_complete_lhs): Pass binary operations, procedure
1101 calls, and ARRAY_REFs to force_evaluation_order.
1102 (various): Set TREE_SIDE_EFFECTS more carefully.
1104 Tolerate random (non-UTF8) encoding in comments without complaining.
1105 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
1106 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
1108 * parse.y (resolve_qualified_expression_name): Handle error_mark.
1109 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
1111 * parse.y (java_complete_lhs): Ignore an empty statement in a
1112 COMPOUND_EXPR. Don't complain about empty statement after return.
1114 Fri Feb 19 13:00:56 1999 Per Bothner <bothner@cygnus.com>
1116 * parse.y (obtain_incomplete_type): Don't wrap unknown types
1117 in TREE_LIST - just chain the POINTER_TYPEs together.
1118 (resolve_class): If type already resolved, return decl.
1119 After resolving, update TREE_TYPE(class_type), and name (if array).
1120 * parse.h (do_resolve_class), parse.y: Make non-static.
1121 * class.c (maybe_layout_super_class): Take this_class argument.
1122 Do do_resolve_class if necessary.
1123 (layout_class, layout_class_methods): Adjust calls appropriately.
1124 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
1125 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
1126 * typeck.c (build_java_array_type): Don't call layout_class.
1128 Wed Feb 17 15:47:20 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1130 * parse.y (check_pkg_class_access): Allow private class access
1131 within the same package.
1132 (strip_out_static_field_access_decl): New function.
1133 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
1134 operator argument before testing its nature.
1136 Wed Feb 3 12:38:43 1999 Per Bothner <bothner@cygnus.com>
1138 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
1139 (TRY_EXPR): Simplify - it no longer has a finally clause.
1140 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
1141 Simpler handling of TRY_EXPR, which no longer has a finally clause.
1142 * expr.c (java_lang_expand_expr): Likewise.
1143 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
1144 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
1145 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
1146 (build_try_statement): Remove finally parameter and handling.
1147 (build_try_finally_statement): New function.
1148 (patch_try_statement): No longer need to support finally clause.
1149 (try_statement): Update grammar action rules.
1150 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
1151 Simpler handling of TRY_EXPR, which no longer has a finally clause.
1153 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
1155 * jcf-parse.c (get_constant): Add braces around computation of 'd'
1156 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
1158 1999-02-17 Andrew Haley <aph@cygnus.com>
1160 * class.c (build_utf8_ref): Back out broken patch which was
1161 intended to to output signatures using '.' as a separator.
1163 * class.c (make_class_data): Output signatures using '.' as a
1164 separator, rather than '/'.
1165 (mangled_classname): Likewise.
1166 (make_field_value): Likewise.
1167 (make_method_value): Likewise.
1168 * constants.c (alloc_class_constant): Likewise.
1169 * expr.c (build_invokeinterface): Likewise.
1171 Thu Feb 11 21:25:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1173 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
1174 of an ancient workaround.
1176 Wed Feb 10 23:27:33 1999 Jeffrey A Law (law@cygnus.com)
1178 * jvspec.c (xmalloc): Kill the prototype. It does not belong
1181 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
1183 * lex.c (yylex): Encode \0 as UTF8.
1185 1999-02-10 Tom Tromey <tromey@cygnus.com>
1187 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
1188 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
1189 (libgcj_zip): Renamed.
1190 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
1192 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
1194 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
1195 (GC_NAME): Renamed -lgc to -lgcjgc.
1197 Tue Feb 9 19:31:09 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1199 * lex.c (java_lang_cloneable): Initialize.
1200 * parse.y (java_lang_cloneable): New static variable.
1201 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
1202 doing one more qualification round.
1203 (valid_ref_assignconv_cast_p): Reject null source or
1204 destination. Allow an array to be cast into java.lang.Cloneable.
1205 (patch_cast): Swapped two first arguments to first call to
1206 valid_ref_assignconv_cast_p.
1208 Mon Feb 8 11:50:50 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1210 * parse.h: DECL_P renamed JDECL_P.
1211 * parse.y: DECL_P replaced by JDECL_P.
1212 (build_array_from_name): Always use pointer's type.
1213 (patch_bc_statement): Extra code to search continue target in a
1214 for loop. Fixed comments. Continue target is current loop when
1217 1999-02-05 Andrew Haley <aph@cygnus.com>
1219 * class.c (make_class_data): The superclass of an interface should
1220 be null, not class Object.
1222 * lex.c (java_lex): Sign extend hex literals.
1224 1999-02-04 Andrew Haley <aph@cygnus.com>
1226 * class.c (build_utf8_ref): Output signatures using '.' as a
1227 separator, rather than '/'.
1228 (make_class_data): Likewise.
1230 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
1232 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
1233 mkstemp.o. Get them from libiberty now.
1235 Tue Feb 2 19:49:12 1999 Jeffrey A Law (law@cygnus.com)
1237 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
1239 Tue Feb 2 20:04:50 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1241 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
1244 Tue Feb 2 10:39:47 1999 Per Bothner <bothner@cygnus.com>
1246 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
1247 * jcf-write.c (generate_bytecode_return): New function.
1248 (generate_bytecode_insns): Use it, for RETURN_EXPR.
1250 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
1251 generate special [fd]const_[01] instructions.
1253 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
1255 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
1256 handling OPCODE_lookupswitch or OPCODE_tableswitch.
1258 Mon Feb 1 20:44:47 1999 Per Bothner <bothner@cygnus.com>
1260 * parse.y (patch_method_invocation): Handle calling static methods,
1261 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
1263 * parse.y (java_complete_lhs): Don't complain about unreachable
1264 exit condition in a do-while statement.
1266 Fri Jan 29 18:19:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1268 * lex.c (java_read_char): Fixed utf8 decoding.
1269 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
1271 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
1272 comments. Local variable `all_primitive' is gone. Broadened
1273 acceptance of `0' to floating point targets. `long' can now be
1274 widened to `double' or `float'.
1275 (valid_method_invocation_conversion_p): Added leading
1276 comment. Fixed tabulation.
1277 (build_string_concatenation): Optimize out left or right empty
1280 Thu Jan 28 18:51:26 1999 Per Bothner <bothner@cygnus.com>
1282 * jcf-write.c (localvar_alloc): Only emit entry for
1283 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
1284 (generate_bytecode_insns): Only call put_linenumber if
1285 debug_info_level > DINFO_LEVEL_NONE.
1286 * jvspec.c (lang_specific_driver): If no -O* or -g* option
1287 is specified, add -g1 (for compatibility wih javac).
1289 Thu Jan 28 09:17:51 1999 Hans-Peter Nilsson <hp@axis.se>
1291 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
1292 gjavah.o, check-init.o, jv-scan.o
1294 Mon Feb 1 09:50:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1296 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
1298 * gjavah.c: Include config.h and system.h.
1300 * javaop.h (inline): Don't define, its handled by system.h.
1301 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
1302 from `inline' to `static inline'.
1304 * jcf.h (inline): Don't define, its handled by system.h.
1306 * lex.c (inline): Likewise.
1308 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
1310 * lang-specs.h: Map -Qn to -fno-ident.
1312 Fri Jan 29 16:51:56 1999 Richard Henderson <rth@cygnus.com>
1314 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
1316 1999-01-29 Tom Tromey <tromey@cygnus.com>
1318 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
1319 then cast it to Object before calling `append' method.
1321 Thu Jan 28 14:45:39 1999 Per Bothner <bothner@cygnus.com>
1323 * check-init.c (check_bool2_init, check_bool_init, check_init):
1324 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
1325 * jcf-write.c (generate_bytecode_insns): Likewise.
1327 Thu Jan 28 11:50:11 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1329 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
1330 * parse.y (patch_cast): Allow a boolean to be cast into a
1333 Wed Jan 27 10:19:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1335 * parse.y: (class_declaration:): Fixed indentation.
1336 (class_member_declaration:): Extra `;' after field declaration now
1338 (interface_declaration:): Removed debug messages in error reports.
1339 (patch_binop): Nodes created and returned inherit the orignal
1340 node's COMPOUND_ASSIGN_P flag value.
1341 (patch_cast): Fix cast from char to floating point.
1343 Mon Jan 25 17:39:19 1999 Andrew Haley <aph@cygnus.com>
1345 * except.c, java-except.h (expand_resume_after_catch): new
1347 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
1348 to branch back to main flow of control after a catch block.
1350 Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1352 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
1353 $(srcdir)/../system.h.
1354 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
1355 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
1356 (jcf-write.o): Likewise.
1357 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1358 (mangle.o): Depend on $(srcdir)/../toplev.h.
1359 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1360 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
1362 * class.c: Include output.h and parse.h.
1363 (mangled_classname): Add the `const' keyword to a char*.
1364 (find_named_method): Hide unused function definition.
1365 (build_utf8_ref): Change type of variable `c' to unsigned char.
1366 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
1367 (build_class_ref): Add the `const' keyword to a char*.
1368 (layout_class_method): Remove unused variable `buf'.
1370 * decl.c (find_local_variable): Remove unused variable `rtl'.
1371 (pushdecl): Likewise for variables `different_binding_level' and
1373 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
1374 (maybe_build_cleanup): Likewise for parameter `decl'.
1376 * except.c (expand_start_java_handler): Mark parameter `range'
1377 with ATTRIBUTE_UNUSED.
1379 * expr.c: Include except.h.
1380 (pop_type): Remove unused variable `i'.
1381 (pop_value): Likewise for variables `n_words' and `i'.
1382 (expand_java_arrayload): Likewise for variable `convert'.
1383 (java_lang_expand_expr): Likewise for variables `op0', `type',
1384 `mode', `unsignedp', `node' and `elements'.
1385 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
1387 (process_jvm_instruction): Add a `const' qualifier to a char*.
1389 * gjavah.c (output_directory): Add the `const' keyword to a char*.
1390 (temp_directory): Likewise.
1391 (print_c_decl): Likewise.
1392 (print_method_info): Likewise.
1393 (decode_signature_piece): Likewise.
1394 (print_mangled_classname): Likewise.
1396 * java-except.h: Provide prototypes for maybe_start_try,
1397 maybe_end_try and add_handler.
1399 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
1400 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
1401 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
1402 init_expr_processing, push_super_field, init_class_processing,
1403 can_widen_reference_to, class_depth, verify_jvm_instructions,
1404 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
1405 set_local_type, merge_type_state, push_type, load_type_state,
1406 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
1407 emit_unicode_mangled_name): Add prototypes.
1409 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
1410 (print_signature_type): Use ISDIGIT, not isdigit.
1411 (print_signature): Remove unused variable `j'.
1413 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
1414 int when comparing against one.
1416 * jcf-parse.c: Include toplev.h.
1418 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
1419 (localvar_free): Remove unused variable `i'.
1420 (generate_bytecode_conditional): Likewise for variable `kind'.
1422 * jv-scan.c: Include config.h and system.h. Remove redundant
1423 OS header and gansidecl.h includes.
1424 (warning): Add the `const' keyword to a char*. Also add
1425 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
1426 __STDC__, when determining whether to use ANSI-isms.
1427 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
1428 (xmalloc): Don't redundantly prototype here.
1429 (main): Remove unused parameter `envp'. Also fix the arguments
1430 passed to function `fatal' to match the format specifier.
1432 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
1434 * mangle.c: Include toplev.h.
1435 (emit_unicode_mangled_name): Declare parameter `len'.
1437 * parse.y (parse_warning_context): Add the `const' keyword to a
1438 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
1439 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
1440 (issue_warning_error_from_context): Add the `const' keyword to
1442 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
1443 not `__STDC__' for whether to use ANSI-isms.
1445 * typeck.c (incomplete_type_error): Mark parameters `value' and
1446 `type' with ATTRIBUTE_UNUSED.
1447 (parse_signature_type): Use ISDIGIT, not isdigit.
1449 * verify.c (check_pending_block): Add the `const' keyword to a char*.
1450 (verify_jvm_instructions): Likewise. Remove unused variables
1451 `field_name' and `default_val'.
1453 * zextract.c: Include config.h and system.h. Remove redundant
1456 * zipfile.h: Prototype `read_zip_archive'.
1458 Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
1460 * typeck.c (convert): Allow conversions to void type: some
1461 optimizations in gcc do this.
1463 Thu Jan 21 15:21:49 1999 Andrew Haley <aph@cygnus.com>
1465 * typeck.c (convert_ieee_real_to_integer): New function.
1466 (convert): When not using fast-math and using hardware fp, convert
1467 an IEEE NaN to zero.
1469 1999-01-18 Andrew Haley <aph@cygnus.com>
1471 * parse.y (patch_binop): Do a type conversion from signed to
1472 unsigned and then back to signed when a ">>>" is found.
1474 Sun Jan 17 22:34:22 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1476 * java-tree.h: (check_for_initialization): Added prototype.
1477 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
1478 * parse.y (do_resolve_class): Removed unused locals.
1479 (read_import_dir): Likewise.
1480 (resolve_qualified_expression_name): Array creation
1481 expressions are valid primary expressions.
1482 (qualify_ambiguous_name): Likewise.
1483 (patch_synchronized_statement): Removed unused local.
1485 Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com)
1487 * Makefile.in (zextract.o): Add dependencies.
1489 * Makefile.in: Do not put ^Ls at the start of a line.
1491 Fri Jan 15 20:16:20 1999 Per Bothner <bothner@cygnus.com>
1493 * expr.c (process_jvm_instruction): Coerce to correct Throwable
1494 sub-type the result of the call that gets the exception value.
1496 * parse.y (java_complete_expand_methods): If flags_syntax_only,
1497 don't call finish_class.
1499 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
1500 clear found before continuing.
1502 * verify.c (verify_jvm_instructions): On an array load, allow
1503 and handle top of stack to be TYPE_NULL.
1505 * gjavah.c (generate_access): Translate Java package private or
1506 protected access to C++ public, but with a comment.
1508 1999-01-13 Andrew Haley <aph@cygnus.com>
1510 * expr.c (generate_name): Name prefix changed to avoid clashes
1511 with assembler temp labels.
1513 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
1514 MODIFY_EXPR. Without this, code for the assignement may not be
1515 generated at all and the synchronized statement will read an
1516 uninitialized variable.
1518 Wed Jan 13 01:24:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1520 * class.c (maybe_layout_super_class): Fixed returned value.
1521 * lex.c: Added 1999 to the copyright.
1522 (java_init_lex): Initialize java_lang_imported.
1523 * lex.h: Added 1999 to the copyright.
1524 * parse.h: Added 1999 to the copyright.
1525 (REGISTER_IMPORT): Fixed typo in trailing macro.
1526 (CURRENT_OSB): New macro.
1527 (struct parser_ctxt): New fields osb_depth, osb_limit.
1528 * parse.y (java_lang_id): New global variable.
1529 (type_import_on_demand_declaration): Don't import java.lang.* twice.
1530 (array_creation_expression:): Use CURRENT_OSB.
1531 (dims:): Uses a stack to keep track of array dimensions.
1532 (cast_expression:): Use CURRENT_OSB.
1533 (find_expr_with_wfl): Return NULL if node found doesn't meet the
1535 (register_fields): Fixed typos in comment.
1536 (check_method_redefinition): Fixed comment indentation.
1537 (java_check_regular_methods): Set saved found wfl to NULL after
1538 having reinstalled it in the previously found DECL_NAME.
1540 Sun Jan 10 13:36:14 1999 Richard Henderson <rth@cygnus.com>
1542 * gjavah.c (java_float_finite): Use a union to do type punning.
1543 (java_double_finite): Likewise.
1545 Sat Jan 9 11:25:00 1999 Per Bothner <bothner@cygnus.com>
1547 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
1548 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
1549 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
1550 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
1551 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
1552 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
1554 Fri Jan 8 15:48:03 1999 Per Bothner <bothner@cygnus.com>
1556 * check-init.c (check_init): If compiling to native, we don't
1557 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
1559 1999-01-08 Tom Tromey <tromey@cygnus.com>
1561 * parse-scan.y (variable_declarator_id): Set or increment
1563 (bracket_count): New global.
1564 (formal_parameter): Handle case where bracket pairs trail variable
1567 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
1569 * jcf-parse.c (yyparse): variable len changed from a char to an
1570 int to prevent overflow.
1572 Wed Jan 6 17:19:46 1999 Per Bothner <bothner@cygnus.com>
1574 * java-tree.h: Declare read_class.
1575 * jcf-parse.c (read_class): New function.
1576 (load_class): Now just call read_class.
1578 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
1579 * jcf-parse.c (parse_source_file): Declare save_error_count,
1580 which is needed by java_parse_abort_on_error macro,
1581 * parse.y (java_layout_classes, java_expand_classes): Likewise.
1583 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
1584 constructor, if initializing a static field.
1585 (patch_new_array_init): Set TREE_CONSTANT if it is.
1586 * expr.c (java_lang_expand_expr): For a static array constructor
1587 of primitive elements, allocate the array itself statically.
1588 Disabled until we can set the vtable field statically.
1590 * check-init.c: New file. Checks for definite assignment.
1591 * Makefile.in (JAVA_OBJS): Add check-init.o.
1592 * parse.y (java_complete_expand_method): Call check_for_initialization.
1593 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
1595 Wed Jan 6 14:53:10 1999 Graham <grahams@rcp.co.uk>
1597 * parse.y : include system.h instead of including
1598 standard headers directly with the exception of <dirent.h>.
1600 Wed Jan 6 16:20:06 1999 Per Bothner <bothner@cygnus.com>
1602 * lex.h: Moved static function declarations to lex.c,
1603 to shut up some -Wall warnings.
1604 * lex.c: Static function declarations moved here.
1605 * jcf-dump.c: Small fixes to shut up -Wall warnings.
1607 Tue Jan 5 22:15:40 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1609 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
1611 Tue Dec 22 11:25:19 1998 Per Bothner <bothner@cygnus.com>
1613 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
1614 * verify.c (verify_jvm_instructions): Fix off-by-one error.
1616 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
1617 (localvar_alloc): Change return type to void,
1618 (emit_unop): Remove unused variable size.
1620 * jcf-write.c (struct jcf_block): Add new union.
1621 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
1622 (call_cleanups): New functions.
1623 (struct jcf_partial): New fields num_finalizers and return_value_decl.
1624 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
1625 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
1626 * lang.c (lang_init): Call using_eh_for_cleanups.
1627 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
1628 completing operands to patch_synchronized_statement.
1629 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
1630 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
1631 WITH_CLEANUP_EXPR instead of TRY_EXPR.
1633 Sun Dec 20 16:15:44 1998 John F. Carr <jfc@mit.edu>
1635 * Make-lang.in: Comment out control-Ls; they upset some makes.
1637 1998-12-18 Tom Tromey <tromey@cygnus.com>
1639 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
1642 1998-12-17 Tom Tromey <tromey@cygnus.com>
1644 * parse.y (DIR_SEPARATOR): New define.
1645 (check_class_interface_creation): Use it.
1647 * parse-scan.y (report_main_declaration): Recognize
1648 `java.lang.String' in argument to main.
1650 Wed Dec 16 16:18:59 1998 Per Bothner <bothner@cygnus.com>
1652 * parse.y (create_interface): Remove bogus test.
1654 Wed Dec 16 14:42:19 1998 Per Bothner <bothner@cygnus.com>
1656 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
1657 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
1659 1998-12-16 Tom Tromey <tromey@cygnus.com>
1661 * parse-scan.y (qualified_name): Use correct sprintf format.
1663 1998-12-15 Tom Tromey <tromey@cygnus.com>
1665 * gjavah.c (print_field_info): Changed how most negative number is
1668 Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com>
1670 * parse.y (fold_constant_for_init): New function.
1671 (resolve_expression_name): Don't replace static final
1672 constant-initialized fields by its value.
1673 (java_complete_lhs): New. Same as java_complete_tree, except does
1674 not replace static final constant-initialized fields by their values.
1675 (register_fields): If there is an initializer, set DECL_INITIAL and
1676 MODIFY_EXPR_FROM_INITIALIZATION_P.
1677 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
1678 Only call patch_initialized_static_field if
1679 MODIFY_EXPR_FROM_INITIALIZATION_P.
1680 (patch_initialized_static_field): If not valid constant, clear
1683 * parse.y (lookup_field_wrapper): Fix thinko.
1685 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
1686 set and restore global lineno.
1688 1998-12-14 Tom Tromey <tromey@cygnus.com>
1690 * gjavah.c (print_field_info): If value to print is the smallest
1691 value of its size, then print as hex to avoid later warnings from
1694 1998-12-14 Tom Tromey <tromey@cygnus.com>
1696 * gjavah.c (decompile_method): Decompile `return null'.
1697 (process_file): Generate `#pragma interface'.
1698 (method_declared): New global.
1699 (print_method_info): Set it.
1700 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
1701 (print_method_info): Handle abstract methods.
1703 Sun Dec 13 17:31:40 1998 Per Bothner <bothner@cygnus.com>
1705 * parse.y (patch_method_invocation): If class_decl is null
1706 (e.g. an array type), use original type.
1708 * parse.y (check_thrown_exceptions): Temporary hack to suppress
1709 errors about uncaught exception from clone (of array, specifically).
1711 1998-12-13 Tom Tromey <tromey@cygnus.com>
1713 * gjavah.c (decompile_method): Handle all types of `return'
1714 opcode. Decompile `return this' and `return'.
1715 (method_access): New global.
1716 (print_method_info): Set it.
1717 (decompile_method): Don't decompile a synchronized method.
1719 1998-12-13 Tom Tromey <tromey@cygnus.com>
1721 * jcf-reader.c (jcf_parse_one_method): Recognize
1723 * gjavah.c (HANDLE_END_METHOD): New macro.
1724 (HANDLE_CODE_ATTRIBUTE): New macro.
1725 (decompile_method): New function.
1726 (print_method_info): Don't print `;\n' at end of function decl.
1727 Include java-opcodes.h.
1728 (decompiled): New global.
1730 Sat Dec 12 20:13:19 1998 Per Bothner <bothner@cygnus.com>
1732 * class.c (build_class_ref): Handle PRIMTYPE.class if
1733 flag_emit_class_files.
1734 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
1735 if flag_emit_class_files.
1736 * parse.y (java_complete_tree): Pre-liminary support for
1737 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
1739 * parse.y (patch_synchronized_statement): Don't call monitorexit
1740 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
1742 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
1744 * zipfile.h (opendir_in_zip): New declaration.
1745 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
1746 (opendir_in_zip): New function, using code from open_in_zip.
1747 (open_in_zip): Call opendir_in_zip.
1748 (find_class): Remove no-longer-used do_class_file parameter,
1749 but add source_ok parameter. Change logic so if we find a .java file,
1750 we don't look for .class in later classpath emtries.
1751 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
1752 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
1753 * gjavah.c: Update call to find_class.
1754 * jcf-dump.c: Likewise.
1756 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
1757 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
1758 nothing if body is empty_stmt_node.
1759 Various little fixes so SP gets correctly adjusted.
1760 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
1761 For CALL_EXPR, test if static first.
1762 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
1763 such as the ones we create for Object and Class.
1764 Set and restore current_function_decl.
1765 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
1766 (note_possible_classname): New function.
1767 (read_import_entry): Removed. Merged with read_import_dir.
1768 (read_import_dir): Don't call find_class - that only gives us
1769 the first classpath entry having the needed package.
1770 Use the struct buffer data structure from buffer.h.
1771 (read_import_dir, find_in_imports_on_demand): The remembered
1772 class names now use '.' (not '/') as package separator.
1774 * parse.y (java_complete_expand_methods): Call write_classfile
1775 here, and not in java_expand_classes (which only gets first class).
1777 Sat Dec 12 19:46:04 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1779 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
1780 (register_fields): If a static fields has an initializer, just
1781 chain it on ctxp->static_initialized, and handle later.
1782 (java_complete_expand_methods): Force <clinit> first.
1783 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
1784 - it's already been completed.
1785 (patch_initialized_static_field): New function.
1786 (java_complete_field): Call it.
1788 Sat Dec 12 19:21:11 1998 Per Bothner <bothner@cygnus.com>
1790 * expr.c (encode_newarray_type, build_new_array): New functions.
1791 * java-tree.h: Declare build_new_array.
1792 * jcf-write.c (patch_newarray): Use build_new_array.
1794 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
1795 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
1797 * parse.y (patch_new_array_init): Re-organize.
1798 Now is passed the actual array (pointer) type of the value.
1799 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
1800 (patch_array_constructor): Removed - merged into patch_new_array_init.
1801 (java_complete_tree): Update patch_new_array_init.
1803 * jcf-write.c (find_constant_index): New function.
1804 (generate_bytecode_insns): Use find_constant_index.
1805 (generate_classfile): Use find_constant_index for ConstantValue.
1807 1998-12-11 Tom Tromey <tromey@cygnus.com>
1809 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
1810 * decl.c (init_decl_processing): Renamed dtable -> vtable.
1811 * class.c (make_class_data): Renamed dtable -> vtable, and
1812 dtable_method_count -> vtable_method_count.
1814 Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1816 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
1817 global variables, initialized.
1818 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
1819 Declared new global variables.
1820 * lex.c (java_lex): Return long_zero_node, float_zero_node,
1821 double_zero_node, integer_zero_node upon direct matching.
1822 * parse.y (purify_type_name): Added function prototype.
1823 (duplicate_declaration_error_p): Consider new_type as potentially
1824 being a incomplete type. Use purify_type_name on type string.
1825 (method_header): saved_type: unused variable removed. Don't figure
1826 return type if method name is invalid.
1827 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
1828 processed by patch_unaryop.
1829 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
1830 increment/decrement node into its original type after binary
1831 numeric promotion on its operands.
1833 Thu Dec 10 11:02:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1835 * parse.y (array_initializer:): Array init operand is NULL_TREE
1836 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
1837 now an error. Fixed indentation problems.
1838 (patch_string): Handle error_mark_node as an argument.
1839 (patch_new_array_init): Fixed indentation problems.
1840 (array_constructor_check_entry): Removed check on null wfl_value.
1841 Return an error if wfl_value's walk returns an error.
1843 Wed Dec 9 15:37:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1845 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
1846 * lex.c (java_lex): Remember column position before advancing one
1847 token. Retain location information on OCB_TK.
1848 * lex.h (typedef struct java_lc): Added new field.
1849 * parse.h (GET_SKIP_TYPE): New macro.
1850 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
1851 * parse.y (build_new_array_init, patch_new_array_init,
1852 patch_array_constructor, maybe_build_array_element_wfl,
1853 array_constructor_check_entry): New function prototypes.
1854 (switch_block:): Tagged <node>.
1855 (OCB_TK): Tagged <operator>.
1856 (array_initializer:): Installed actions.
1857 (variable_initializer): Build location information on element if
1859 (switch_statement:): Fixed indentation typo.
1860 (switch_block:): Redefined default action.
1861 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
1862 (patch_assignment): Removed duplicate code.
1863 (maybe_build_array_element_wfl, build_new_array_init,
1864 patch_new_array_init, patch_array_constructor,
1865 array_constructor_check_entry): New functions.
1867 Mon Dec 7 15:13:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1869 * parse.y (array_initializer): Tagged <node>.
1870 (variable_initializer:): Use default rule.
1871 (array_initializer:): Defined actions.
1872 (variable_initializers:): Likewise.
1873 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
1874 non-static field accesses.
1875 (patch_invoke): Fixed indentation typo.
1876 (java_complete_tree): Likewise.
1877 (build_labeled_block): Changed leading comment. Generate an error
1878 in case of duplicate loop labels.
1879 (patch_conditional_expr): Patch results of string concatenation
1882 Sun Dec 6 13:45:00 1998 Per Bothner <bothner@cygnus.com>
1884 * constants.c (find_methodref_index): When the class is an interface,
1885 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
1887 * decl.c (finit_identifier_node): Use "$finit$", rather than
1888 "<finit>" (which Sun's verifier rejects).
1889 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
1890 (generate_field_initialization_code): Removed.
1891 (fix_constructors) Don't add call to $finit$ here (wrong order).
1892 (patch_method_invocation): Add $finit$ call here.
1894 * java-tree.h (CALL_USING_SUPER): New macro.
1895 * parse.y (patch_invoke): Remove im local variable.
1896 (patch_method_invocation, patch_invoke): Don't pass super parameter.
1897 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
1898 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
1900 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
1902 * parse.y (java_complete_tree): Don't complain about unreachable
1903 statement if it is empty_stmt_node.
1905 * jcf-write.c (find_constant_wide): New function.
1906 (push_long_const): Use find_constant_wide.
1908 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
1909 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
1910 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
1911 Emit invokeinterface when calling an interface method.
1912 Emit invokespecial also when calling super or private methods.
1914 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
1916 Sun Dec 6 13:21:18 1998 Per Bothner <bothner@cygnus.com>
1918 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
1920 Thu Dec 3 17:11:12 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1922 * java-tree.h (java_layout_seen_class_methods): New function
1924 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
1925 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
1926 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
1927 * parse.y (method_declarator:): Defined action.
1928 (issue_warning_error_from_context): input_filename saved, set to
1929 the appropriate value and restored after java_error is called.
1930 (build_unresolved_array_type): Fixed comment.
1931 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
1932 (method_header): Deal with return type the same way type are
1933 handled for fields and method's parameters and local variables
1935 (check_method_redefinition): Removed extra CR.
1936 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
1937 (java_layout_seen_class_methods): New function.
1938 (java_layout_classes): Call java_layout_seen_class_methods.
1940 Thu Dec 3 15:56:50 1998 Per Bothner <bothner@cygnus.com>
1942 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
1944 Thu Dec 3 15:08:30 1998 Per Bothner <bothner@cygnus.com>
1946 * jcf-dump.c (main): Fix error message.
1947 * jcf-path.c (add_entry): Style fix.
1949 Wed Dec 2 15:52:25 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1951 * class.c (layout_class_method): Call build_java_argument_signature
1952 on constructors too.
1953 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
1954 (patch_method_invocation): Define a primary when resolving an
1955 expression name. Augmented comment on code checking illegal `this'
1956 usage. Loosened it test by accepting NEW_CLASS_EXPR.
1958 Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
1960 * class.c (layout_class_method): Don't report error on non-static
1961 overriding static if the method is private.
1962 * java-tree.h (finish_class): Prototype added.
1963 * lex.c (java_get_line_col): Handle col argument -2 value.
1964 * parse.h: All static method declarations moved to parse.y.
1965 * parse.y: Now contains all static method declarations previously
1967 (find_expr_with_wfl, missing_return_error,
1968 unreachable_stmt_error): New functions.
1969 (java_get_real_method_name): Identify constructors bearing class
1970 names in source code compiled classes only.
1971 (java_complete_expand_methods): Call missing_return_error.
1972 (invocation_mode): Private methods invoked as static methods.
1973 (java_complete_tree): Call unreachable_stmt_error.
1975 1998-12-01 Tom Tromey <tromey@cygnus.com>
1977 * Makefile.in (+target): Removed.
1978 (+xmake_file): Likewise.
1979 (+tmake_file): Likewise.
1980 (.NOEXPORT): Removed duplicate.
1982 Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1984 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
1986 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
1988 * jvgenmain.c: Remove the xmalloc prototype, we get it from
1989 libiberty.h. Provide an xmalloc definition.
1991 * jvspec.c: Remove the xmalloc prototype.
1993 * parse-scan.y: Include config.h and system.h. Don't include
1994 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
1995 Provide an xstrdup definition.
1997 Thu Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
1999 * jcf-path.c (add_entry): Recognize ".jar" too.
2000 * lang-specs.h: Likewise.
2002 Thu Nov 26 12:44:07 1998 Per Bothner <bothner@cygnus.com>
2004 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
2005 soft_monitorenter_node, soft_monitorexit_node, throw_node.
2007 * jcf-write.c (generate_bytecode_insns):
2008 Handle pre/post-increment/decrement of long.
2010 * jcf-write.c (generate_bytecode_insns):
2011 Handle missing exception handler (finally for synchronized).
2013 Wed Nov 25 09:47:15 1998 Per Bothner <bothner@cygnus.com>
2015 * java-tree.h (end_params_node): Declare global.
2016 * decl.c (end_params_node): New global.
2017 (init_decl_processing, start_java_method): Use end_params_node for
2018 end of list of parameter types. Follows correct gcc conventions.
2019 * expr.c (pop_argument_types, pop_arguments): Likewise.
2020 * lang.c (put_decl_node): Likewise.
2021 * typeck.c (various places): Likewise.
2022 * class.y (various places): Likewise.
2023 * parse.y (various places): Likewise.
2025 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
2026 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
2028 * class.c: Add #include flags.h, remove no-longer needed declaration.
2030 * class.c (layout_class_method): Remove commented-out code, re-format.
2031 Don't add vtable entry (or index) for private methods.
2032 * expr.c (expand_invoke): A private method is implicitly final.
2033 * class.c (make_class_data): If inlining or optimizing,
2034 skip private methods.
2036 * class.c (finish_class): New function. Calls existing methods,
2037 but alls emits deferred inline functions.
2038 * jcf-parse.c (parse_class_file): Call finish_class.
2039 * parse.y (java_complete_expand_methods): Likewise.
2041 * expr.c (build_java_binop): Explicit default, to silence -Wall.
2043 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
2045 Wed Nov 25 00:50:58 1998 Marc Espie <espie@quatramaran.ens.fr>
2047 * jcf-write.c (generate_bytecode_conditional): Fix typo.
2049 Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com>
2051 * (generate_classfile): Always write class access flag with
2054 Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2056 * class.c (maybe_layout_super_class): New function.
2057 (layout_class): Reorganized. Loop on class methods dispatched into
2058 a new function. Call maybe_layout_super_class.
2059 (layout_class_methods, layout_class_method): New functions.
2060 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
2062 (expand_invoke): Likewise.
2063 * java-tree.h (all_class_list): New global variable declared.
2064 (layout_class_methods, layout_class_method): New function
2066 (LAYOUT_SEEN_CLASS_METHODS): New macro.
2067 * jcf-parse.c (all_class_list): New global variable.
2068 (load_class): Extended what class_or_name can be. Use parser
2069 context mechanism to save globals before calling jcf_parse.
2070 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
2071 is set on the file name.
2072 (jcf_parse): Layout class methods when Object is loaded, otherwise
2073 record class in all_class_list for delayed method layout.
2074 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
2075 * lang.c (put_decl_node): Decode <init> into the decl context
2077 * lex.c (java_allocate_new_line): Use xmalloc.
2078 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
2079 pointers, not TREE_LIST elements.
2080 (struct parser_ctxt): Fixed comment indentations, added comments
2081 and reordered some fields.
2082 (java_check_methods): Function prototype removed.
2083 * parse.y (java_push_parser_context): Use xmalloc.
2084 (java_parser_context_restore_global): Pop extra pushed ctxp only
2085 when there's nothing next.
2086 (maybe_create_class_interface_decl): Fixed comment, add new
2087 created class decl to all_class_list.
2088 (method_header): Use GET_REAL_TYPE on argument's types.
2089 (method_declarator): Use GET_REAL_TYPE, change type to the real
2090 type in TREE_LIST dependency node. Build argument list with the
2092 (create_jdep_list): Use xmalloc. Removed allocation error message.
2093 (obtain_incomplete_type): Fixed leading comment. Broadened
2094 incoming argument meaning.
2095 (register_incomplete_type): Use xmalloc. Removed allocation error
2097 (safe_layout_class): Fixed leading comment.
2098 (jdep_resolve_class): Reversed if statement condition and switch
2100 (resolve_and_layout): Fixed leading comment. Broadened incoming
2102 (complete_class_report_errors): New local variable name, for
2103 clarity. purify_type_name used for all error cases.
2104 (java_get_real_method_name): Stricter check on constructors.
2105 (java_check_regular_methods): Reverse methods list only if not
2106 already laid out. Layout artificial constructor.
2107 (java_check_methods): Deleted.
2108 (source_start_java_method): Obtain incomplete type for patchable
2110 (java_layout_classes): Fixed leading comment. Use
2111 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
2112 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
2113 before returning. Fixed comments.
2114 (java_expand_classes): Check for errors up front.
2115 (patch_method_invocation): Class to search is resolved and laid
2118 Tue Nov 24 12:57:13 1998 Per Bothner <bothner@cygnus.com>
2120 * expr.c (java_lang_expand_expr): Add missing emit_queue.
2122 * javaop.h (int8): Removed - not used.
2123 (jbyte): Redefine portably with correct signedness.
2125 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
2127 * jcf-write.c (generate_bytecode_insns): Fix typo
2128 OPCODE_getstatic to OPCODE_getfield.
2130 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
2131 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
2132 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
2134 Thu Nov 19 11:16:55 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2136 * jcf-parse.c (jcf_parse_source): Function returned type is
2137 void. Added prototype.
2138 (jcf_parse): Function returned type is void.
2139 (yyparse): Remove call to fclose on the last parsed file.
2141 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
2143 Wed Nov 18 23:54:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2145 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
2146 (layout_class): Cope with methods featuring WFL in decl names.
2147 * decl.c (unqualified_object_id_node): New global variable,
2149 (build_decl_no_layout): Removed.
2150 * expr.c (build_primtype_type_ref): Handle Double.
2151 (java_lang_expand_expr): Fixed indentations.
2152 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
2153 (flag_wall, flag_redundant, flag_not_overriding,
2154 flag_static_local_jdk1_1, unqualified_object_id_node): Global
2155 variable declarations.
2156 (build_decl_no_layout): Removed prototype.
2157 (java_get_real_method_name): Added prototype.
2158 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
2159 (java_parse_abort_on_error): Macro now just returns.
2160 * jcf-parse.c (jcf_parse_source): Check fclose returned
2161 value. Call emit_register_classes if java_report_errors returns
2163 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
2164 flag_static_local_jdk1_1): New integer flags.
2165 (lang_decode_option): New flags set here.
2166 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
2167 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
2168 the flag_redundant variable.
2169 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
2170 when parsing java.lang.Object class.
2171 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
2173 (resolve_qualified_expression_name): Fixed indentation.
2174 (patch_array_ref): Changed prototype.
2175 (not_initialized_as_it_should_p): Prototype removed.
2176 (java_report_errors): Added function prototype.
2177 * parse.y (formal_parameter:): Changed error message for not yet
2178 supported final parameters.
2179 (class_type_list:): Set both PURPOSE and VALUE of created
2180 TREE_LIST to be class_type.
2181 (primary_no_new_array:): Handle class literals on primitive types.
2182 (parse_warning_context): Reinstalled correct force_error and
2183 do_warning flags setups.
2184 (java_report_errors): Changed prototype. Return java_error_count
2186 (variable_redefinition_error): Consider treating variable type as
2188 (create_interface): Warn about redundant abstract modifier if
2189 flag_redundant is set. Changed error message.
2190 (lookup_field_wrapper): Save/restore globals before/after looking
2192 (duplicate_declaration_error_p): Consider treating declaration
2193 type as a fake pointer.
2194 (register_fields): Extract real type from dependency node. Check
2195 for duplicate field declaration after type adjustment. Use
2196 DECL_INITIAL to store static final initialized values.
2197 (method_header): Extract real function type from dependency node.
2198 (check_abstract_method_header): Use GET_METHOD_NAME.
2199 (obtain_incomplete_type): Layout fake pointer type.
2200 (safe_layout_class): Don't try to check for methods before layout.
2201 (java_complete_class): Don't check for correct throws clause
2202 elements inheritance here.
2203 (resolve_and_layout): Broadened name parameter meaning.
2204 (reset_method_name): Use GET_METHOD_NAME.
2205 (java_get_real_method_name): New function.
2206 (java_check_regular_methods): Don't check methods in
2207 java.lang.Object. Verify lineage of throws clause elements. Use
2208 flag_no_overriding in warning report.
2209 (check_throws_clauses): Don't check if class was from
2210 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
2211 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
2212 (declare_local_variables): Use flag_static_local_jdk1_1 to report
2213 warning on unsupported final local variables. Use build_decl
2214 instead of build_decl_no_layout. Get real local variable type from
2216 (source_start_java_method): Get real parameter type from
2217 dependency node. Call build_decl instead of build_decl_no_layout.
2218 (java_layout_classes): Reverse tree and layout type and class as
2219 required. Mark class as loaded when done.
2220 (resolve_field_access): Fixed indentation. Restricted condition
2221 leading to static field access code generation. Set field_type
2222 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
2223 (resolve_qualified_expression_name): Initialize type_found to
2224 null. Handle static field resolved during qualification. Fixed
2225 layout on non primitive field decl types.
2226 (not_accessible_p): Fixed typo in comment.
2227 (patch_method_invocation): Resolve and layout class to search from
2229 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
2230 layout non primitive type, if necessary. Make method node only to
2232 (find_applicable_accessible_methods_list): Consider WFL'ed method
2233 decl names. Fixed indentation.
2234 (argument_types_convertible): Resolve and layout target type if
2236 (java_complete_tree): Fixed indentation problems. Rewrote
2237 CALL_EXPR thrown exceptions check. Re-installed further processing
2238 of the assignment in certain cases.
2239 (patch_assignment): Call maybe_build_primttype_type_ref to perform
2240 inlining on class literals.
2241 (valid_builtin_assignconv_identity_widening_p): Cope with constant
2243 (valid_method_invocation_conversion_p): Likewise.
2244 (patch_string): Temporary disable forbidden use of `this' in
2245 explicit constructor invocations when doing string concatenation
2247 (patch_unaryop): Added comment. Reinstalled code to disable
2248 further check on assignment operation with cast expression RHS.
2249 (patch_switch_statement): Fixed indentation.
2250 (build_try_statement): Call build_decl instead of
2251 build_decl_no_layout.
2252 (patch_synchronized_statement): Likewise.
2253 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
2254 IS_UNCHECKED_EXPRESSION_P.
2255 (check_thrown_exceptions_do): Changed leading comment. Resolve and
2256 layout argument exception type.
2257 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
2258 of IS_UNCHECKED_EXPRESSION_P.
2260 Wed Nov 18 14:21:48 1998 Anthony Green <green@cygnus.com>
2262 * jcf-parse.c (yyparse): Open class file in binary mode.
2264 Sun Nov 15 17:14:17 1998 Per Bothner <bothner@cygnus.com>
2266 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
2268 * jcf-write.c (perform_relocations): Move check out one loop.
2270 Sun Nov 15 15:09:56 1998 Anthony Green <green@hoser.cygnus.com>
2272 * Make-lang.in: Fix reference to srcdir.
2273 * jv-scan.c: Add missing xmalloc prototype.
2274 * jvgenmain.c: Ditto.
2276 Sun Nov 15 14:36:29 1998 Per Bothner <bothner@cygnus.com>
2278 * decl.c (error_mark_node), java-tree.h: New global.
2279 * parse.y: Use empty_stmt_node instead of size_zero_node.
2280 (build_if_else_statement): If missing else, use empty_stmt_node.
2282 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
2283 (java_complete_expand_method): Complain if return is missing.
2284 (java_check_regular_methods): Comment out incorrect error check.
2285 (not_accessible_p): Fix incorrect handling of protected methods.
2286 (patch_method_invocation): Pass correct context to not_accessible_p.
2287 (find_applicable_accessible_methods_list): Likewise.
2288 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
2289 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
2290 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
2291 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
2293 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
2294 (push_int_const): Remove reundant NOTE_PUSH.
2295 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
2296 (- case SWITCH_EXPR): Fix code generation bug.
2297 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
2298 (generate_classfile): More robust for abstract methods.
2300 Sun Nov 15 13:52:39 1998 Anthony Green <green@cygnus.com>
2302 * Makefile.in: jv-scan and jvgenmain all require libiberty.
2303 * Make-lang.in: Ditto.
2305 * jv-scan.c: Remove xmalloc and xstrdup definitions.
2308 Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
2310 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
2312 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
2314 Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
2316 Allow uses of interface types to verify. This is not really
2317 type-safe, but it matches what Sun does, and is OK as long as
2318 there are appropriate run-time checks.
2319 * verify.c (merge_types): If merging two interface types,
2320 just set the result to java.lang.Object.
2321 * expr.c (pop_type): Any interface is matches by java.lang.Object.
2323 1998-11-13 Tom Tromey <tromey@cygnus.com>
2325 * gjavah.c (main): Handle --output-class-directory argument.
2326 * jvspec.c (lang_specific_driver): Translate `-d' into
2328 * jcf.h (jcf_write_base_directory): Declare.
2329 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
2330 * lang-options.h: Mention -foutput-class-dir.
2331 * jcf-write.c (jcf_write_base_directory): New global.
2332 (make_class_file_name): Put generated .class file into `-d'
2333 directory, or into source directory if -d not given. Function now
2335 (write_classfile): Free class file name. Handle case where class
2337 (DIR_SEPARATOR): New macro.
2338 Include <sys/stat.h>
2340 * Makefile.in (prefix): New macro.
2342 Thu Nov 12 14:15:07 1998 Per Bothner <bothner@cygnus.com>
2344 * parse.y (patch_invoke): Do less if flag_emit_class_files.
2345 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
2346 here (done in patch_invoke instead).
2347 (case_identity): Moved here from parse.y.
2349 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
2350 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
2351 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
2352 so they can be efficiently scanned without recursion.
2353 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
2354 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
2355 in BLOCK iteratively, rather than recursively.
2357 * parse.y (do_unary_numeric_promotion): New function.
2358 (patch_unaryop, patch_binop, patch_array_ref): Use it.
2360 * parse.y (patch_newarray): Various fixes.
2362 Re-do handling of switch statements (for proper block scoping).
2363 * parse.y: Add just a single block for the enture switch block,
2364 but don't create any "case blocks".
2365 (group_of_labels): Rmeoved unneeded non-terminal.
2366 CASE_EXPR and DEFAULT_EXPR are added to current block.
2367 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
2368 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
2369 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
2370 * parse.y (wfl_operator, print_int_node): Make non-static.
2371 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
2372 as part of recursive scan of block.
2373 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
2374 (patch_switch_statement): Most tests move dinto java_complete_tree.
2376 * parse.y: Make various production be non-typed (void).
2377 * parse.y (parse_error): Merged into issue_warning_error_from_context.
2378 * parse.y (add_stmt_to_compound): Don't create/change extra node.
2379 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
2381 * jcf-write.c (struct jcf_handler): New type.
2382 (struct jcf_switch_state): New type.
2383 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
2384 (alloc_handler, emit_unop, emit_reloc): New functions.
2385 (adjust_typed_op): Add extra parameter ("max type" offset).
2386 (emit_switch_reloc, emit_case-reloc): New function.
2387 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
2388 (generate_bytecode_insns): Support REAL_CST, switch statements,
2389 exception handling, method calls, object/array creation, and more.
2391 * class.c: Remove some unused variables.
2392 * constants.c (find_string_constant): New function.
2393 (count_constant_pool_bytes): Fix to correctly handle wide constants.
2394 * decl.c (complete_start_java_method): Don't _Jv_InitClass
2395 if flag_emit_class_files.
2397 1998-11-12 Tom Tromey <tromey@cygnus.com>
2399 * jcf-io.c (find_class): Added explanatory comment.
2401 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
2402 trailing slash to `.zip' entries.
2404 * jvspec.c (lang_specific_driver): Correctly handle case where
2405 GC_NAME not defined.
2407 1998-11-11 Tom Tromey <tromey@cygnus.com>
2409 * jvspec.c (GC_NAME): New define.
2410 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
2412 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
2414 Wed Nov 11 19:08:52 1998 Per Bothner <bothner@cygnus.com>
2416 * jcf-dump.c (TABLE_SWITCH): Fix typos.
2418 1998-11-11 Tom Tromey <tromey@cygnus.com>
2420 * jcf-dump.c (main): Correctly recognize `--'-style long options.
2422 Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2424 * class.c (is_compiled_class): Call safe_layout_class for class
2425 compiled from source.
2426 * conver.h (convert_to_integer, convert_to_real,
2427 convert_to_pointer): Added prototypes.
2428 * decl.c (init_decl_processing): Non longer push the decls of
2429 `methodtable', `constants', `Class', `Field', `dispatchTable'
2430 `jexception' and `Method'.
2431 * expr.c (build_invokeinterface): New function.
2432 (expand_invoke): static variable CLASS_IDENT now in
2433 build_invokeinterface. Use build_invokeinterface.
2434 (expand_java_field_op): Moved code to inline
2435 java.lang.PRIMTYPE.TYPE into a function.
2436 (build_primtype_type_ref): New function.
2437 * java-tree.def (INSTANCEOF_EXPR): New tree code.
2438 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
2439 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
2440 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
2441 (DECL_LOCAL_STATIC_VALUE): New macro.
2442 (build_invokeinterface, build_primtype_type_ref): New function
2444 (java_parse_abort_on_error): Macro rewritten.
2445 * jcf-parse.c (current_method): Add comment to declaration.
2446 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
2447 Function prototypes fixed.
2448 (jcf_parse_source): push/pop parser context. save/restore global.
2449 (parse_source_file): Fixed leading comment. Now take a
2450 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
2451 classes and pop the parser context anymore.
2452 (yyparse): Push parser context, save globals, parse the source
2453 file, restore globals and pop the parser context when processing a
2455 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
2456 * lex.c (java_parse_doc_section): New function.
2457 (java_lex): Call java_parse_doc_section when appropriate. Build an
2458 operator around INSTANCEOF_TK.
2459 * lex.h (java_lineterminator, java_sprint_unicode,
2460 java_unicode_2_utf8, java_lex_error, java_store_unicode):
2461 Prototypes rewritten.
2462 (java_parse_escape_sequence, java_letter_or_digit_p,
2463 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
2464 java_read_unicode, java_store_unicode, java_read_char,
2465 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
2466 Added function prototypes.
2467 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
2469 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
2471 (struct parser_ctxt): New fields: deprecated,
2472 current_parsed_class_un, gclass_list.
2473 (fix_method_argument_names, issue_warning_error_from_context,
2474 resolve_package, lookup_package_type): New function prototypes.
2475 (resolve_expression_name): Fixed function prototype.
2476 (find_applicable_accessible_methods_list): Fixed indentation, added
2477 extra argument in prototype.
2478 (check_final_assignment, build_null_of_type, check_deprecation,
2479 check_method_redefinition, reset_method_name,
2480 java_check_regular_methods, java_check_abstract_methods,
2481 maybe_build_primttype_type_ref): New function prototype.
2482 * parse.y (conver.h): Include.
2483 (INSTANCEOF_TK): Tagged <operator>.
2484 (single_type_import_declaration): Use REGISTER_IMPORT macro.
2485 (relational_expression:): Build binop for instanceof.
2486 (java_push_parser_context): Remember ctxp->gclass_list across
2488 (java_pop_parser_context): Simply return if no context
2489 exists. Remember gclass_list across contexts.
2490 (issue_warning_error_from_context): New function.
2491 (parse_error_context): Don't setup ctxp->elc here. Call
2492 issue_warning_error_from_context instead.
2493 (parse_warning_context): Likewise.
2494 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
2495 setup. Link new class/interface to ctxp->gclass_list.
2496 (add_superinterfaces): Register interface as incomplete if not
2498 (create_class): Remember class unqualified name in
2499 ctxp->current_parsed_class_un. Check class deprecation.
2500 (register_fields): Check field deprecation. Remember static final
2501 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
2503 (method_header): New local variable ORIG_ARG. Use unqualified
2504 current class name for check on constructor errors. Promote return
2505 type if of record type. Argument list fix moved in
2506 fix_method_argument_names, called here. Check method deprecation.
2507 (fix_method_argument_names): New function.
2508 (method_declarator): Promote record typed arguments.
2509 (safe_layout_class): Check class methods before layout.
2510 (java_complete_class): Compute field layout when patched.
2511 (do_resolve_class): Try to load class after having it renamed
2512 after the package name.
2513 (get_printable_method_name): Use DECL_CONTEXT.
2514 (reset_method_name): New function.
2515 (check_method_redefinition): Use reset_method_name.
2516 (java_check_regular_methods): New local variable
2517 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
2518 names for error report. Check for compile-time error when method
2519 found has default (package) access.
2520 (java_check_abstract_methods): Now takes an interface DECL node as
2521 an argument. Also reinstall real name on unchecked
2522 overriding/hiding methods for error report.
2523 (java_check_methods): Fixed leading comment. Get classes to verify
2524 from ctxp->gclass_list. Use CHECK_METHODS macro and set
2525 CLASS_METHOD_CHECKED_P on class verification.
2526 (lookup_java_method2): Get real method name if necessary.
2527 (find_in_imports): Don't check package class access here.
2528 (resolve_package, lookup_package_type): New functions.
2529 (java_layout_classes): Fixed leading comment. Take classes to be
2530 laid out from ctxp->gclass_list.
2531 (java_complete_expand_methods): Don't expand native and abstract
2533 (java_expand_classes): New function.
2534 (resolve_expression_name): Use additional argument ORIG. Retrieve
2535 values of static final field of primitive types.
2536 (resolve_field_access): Handles static final field of promotive
2538 (resolve_qualified_expression_name): Handle STRING_CST as
2539 primaries and package name resolution. Check deprecation on found
2540 decls. Set where_found and type_found on non static field resolved
2541 during qualification. Layout non primitive field decl types.
2542 (check_deprecation): New function.
2543 (maybe_access_field): Simplified.
2544 (patch_method_invocation_stmt): Local variable CLASS_TYPE
2545 removed. Reverse method's argument when primary is a type. Don't
2546 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
2547 instead. Include abstract class in the list of class searchable
2548 for constructors. Use DECL_CONTEXT of found method for access
2549 checks. Check method deprecation.
2550 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
2551 converting arguments. Handle INVOKE_INTERFACE.
2552 (lookup_method_invoke): Search constructor using existing
2553 infrastructure (don't rely on lookup_java_constructor anymore).
2554 (find_applicable_accessible_methods_list): Extra argument flag
2555 LC. Now include constructor in the search.
2556 (qualify_ambiguous_name): Conditional expression are primaries.
2557 (not_initialized_as_it_should_p): static final are always
2559 (java_complete_tree): Pass extra NULL argument to
2560 resolve_expression_name. Stricter test to carry on patching
2561 assignments. New case for INSTANCEOF_EXPR.
2562 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
2563 (check_final_assignment, maybe_build_primttype_type_ref): New
2565 (patch_assignment): Detect resolved static finals and carry normal
2566 assignment error check on them. Inline PRIMTYPE.TYPE read access.
2567 (try_builtin_assignconv): Access constant 0 on all primitive
2569 (valid_builtin_assignconv_identity_widening_p): Accept identical
2570 types. Accept all promoted type on int type.
2571 (valid_ref_assignconv_cast_p): Accept a null pointer to be
2572 assigned to a reference.
2573 (valid_method_invocation_conversion_p): Accept to check null
2575 (build_binop): Merge declaration and initialization of local
2577 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
2578 numeric types. Improved validity test for qualify operators on
2580 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
2581 and PREINCREMENT_EXPR. Also detect resolved static finals of a
2582 primitive type and issue the appropriate error message.
2583 (resolve_type_during_patch): Mark class loaded when resolved.
2584 (patch_cast): Allow null to be cased to reference types.
2585 (build_null_of_type): New function.
2586 (patch_array_ref): Handle array on references correctly.
2587 (patch_return): Removed unused local variable MODIFY. Force
2588 boolean to be returned as integers. Allows null to be returned by
2589 a function returning a reference.
2590 * typeck.c (convert_to_integer, convert_to_real,
2591 convert_to_pointer): Prototypes moved to convert.h
2592 (lookup_argument_method): Use method real name, if necessary.
2594 1998-10-30 Tom Tromey <tromey@cygnus.com>
2596 * class.c (build_class_ref): Changed name of primitive classes to
2599 * class.c (make_class_data): Renamed fields: nmethods to
2600 method_count, method_count to dtable_method_count. Always set
2602 * decl.c (init_decl_processing): Likewise.
2604 Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2606 * class.c (layout_class): Don't mangle <finit>, produce
2607 __finit<class> instead. Don't verify artificial methods.
2608 * decl.c (finit_identifier_node): New declared global.
2609 (init_decl_processing): finit_identifier_node initialized.
2610 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
2611 * java-tree.h (finit_identifier_node): Declared as extern.
2612 (struct lang_decl): New field called_constructor.
2613 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
2614 (CLASS_HAS_FINIT_P): New macro.
2615 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
2616 explicit constructor invocation.
2617 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
2618 CALL_SUPER_CONSTRUCTOR_P): New macros.
2619 (write_classfile): Added prototype.
2620 * jcf-parse.c (jcf_parse_source): Parse and remember for
2621 generation if the file was seen on the command line.
2622 (parse_source_file): Don't write the class file here.
2623 (yyparse): Loop on files rewritten. Set current_jcf.
2624 (parse_zip_file_entries): Parse class file only if it was found.
2625 * lang.c (init_parse): Don't open command line provided filename
2627 (lang_parse): Don't set main_jcf anymore.
2628 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
2629 (JCONSTRUCTOR_CHECK): New macro.
2630 (JBSC_TYPE_P): New macro.
2631 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
2632 (COMPLETE_CHECK_OP_2): New macro.
2633 (struct parse_ctxt): New field explicit_constructor_p.
2634 (check_class_interface_creation): Fixed prototype indentation.
2635 (patch_method_invocation_stmt): Prototype reflects added argument.
2636 (patch_invoke): Likewise.
2637 (complete_method_declaration, build_super_invocation,
2638 verify_constructor_circularity,
2639 build_this_super_qualified_invocation, get_printable_method_name,
2640 patch_conditional_expr, maybe_generate_finit, fix_constructors,
2641 verify_constructor_super, create_artificial_method,
2642 start_artificial_method_body, end_artificial_method_body,
2643 generate_field_initialization_code): New function prototypes.
2644 * parse.y: Fixed leading comment
2645 (constructor_header:, constructor_body:, block_end:): Rules tagged
2647 (type_declaration:): Call maybe_generate_finit.
2648 (method_declaration:): Action for method_body: placed in new
2649 function complete_method_declaration, called here.
2650 (constructor_declaration:): Defined actions. Removed leading
2652 (constructor_header:): New rule with action.
2653 (constructor_body:): Rule rewritten using block_begin: and
2654 block_end:. Defined actions.
2655 (constructor_declarator:, explicit_constructor_invocation:):
2657 (block:): Use new rules block_begin: block_end:.
2658 (block_begin:, block_end:): New rules and actions.
2659 (block_statements:): Fixed error message for explicit
2661 (method_invocation:): Call build_this_super_qualified_invocation
2662 if primary is `this' or `super' was seen.
2663 (conditional_expression:): Action defined.
2664 (extra_ctxp_pushed_p): New static global flag.
2665 (java_parser_context_save_global): Create parser context if
2666 necessary. Use extra_ctxp_pushed_p to remember it.
2667 (java_parser_context_restore_global): Pop extra parser context if
2669 (build_array_from_name): Array on primitive types are marked
2671 (register_fields): Restore new name in field initializer
2672 expression if type was altered. Non static fields initialized upon
2673 declaration marked initialized.
2674 (maybe_generate_finit): New function.
2675 (maybe_generate_clinit): Use create_artificial_method,
2676 start_artificial_method_body, end_artificial_method_body. Generate
2677 debug info for enclosed initialization statements.
2678 (method_header): Fixed leading comment. Check constructor
2679 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
2681 (complete_method_declaration, constructor_circularity_msg,
2682 verify_constructor_circularity): New functions.
2683 (get_printable_method_name): New function.
2684 (check_method_redefinition): Don't rename <finit> methods. Fix
2685 declared constructor names. Error message for
2686 constructors modified.
2687 (java_check_regular_methods): Local variable seen_constructor
2688 renamed saw_constructor. Skip verification on constructors. Create
2689 default constructor with create_artificial_method.
2690 (java_check_methods): Removed unnecessary empty line.
2691 (create_artificial_method, start_artificial_method_body,
2692 end_artificial_method_body): New functions.
2693 (java_layout_classes): Changed leading comment. Reverse fields
2694 list if necessary. Always layout java.lang.Object if being
2696 (java_complete_expand_methods): Verify constructor circularity.
2697 (java_complete_expand_method): Call fix_constructor on
2698 constructors. Local variable no_ac_found removed. Restore
2699 bindings if method body expansion failed.
2700 (fix_constructors, verify_constructor_super,
2701 generate_field_initialization_code): New function.
2702 (java_expand_classes): Fixed leading comment. Write class file
2704 (resolve_expression_name): Check for illegal instance variable
2705 usage within the argument scope of an explicit constructor
2707 (resolve_qualified_expression_name): Pass extra from_super flag
2708 when invoking patch_method_invocation_stmt. New case for
2709 conditional expression when used as a primary. Check for error
2710 when acquiring super.
2711 (patch_method_invocation_stmt): Added extra argument super. New
2712 local variable is_static_flag. Set class_to_search according to
2713 the nature of the constructor invocation. Don't add `this'
2714 argument when expanding NEW_CLASS_EXPR. Check for illegal method
2715 invocation within the argument scope of explicit constructor
2716 invocation. Set is_static according to is_static_flag. Provide
2717 extra `super' argument to patch_invoke invocation.
2718 (patch_invoke): New argument from_super. Loop on arguments
2719 indentation fixed. Pass from_super to invocation_mode. New switch
2720 case INVOKE_SUPER. Fixed error message in switch default case.
2721 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
2723 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
2724 (lookup_method_invoke): Fixed prototypes in candidates list. Error
2725 message takes constructors into account.
2726 (find_applicable_accessible_methods_list): Fixed indentation.
2727 (qualify_ambiguous_name): Take explicit constructor invocation
2728 into account. Deal with a conditional expression as a primary to
2730 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
2731 case. Added extra argument to patch_method_invocation_stmt.
2732 Register calls made to explicit constructor `this'. Don't call
2733 save_expr in ARRAY_REF case when emitting class files. Check for
2734 illegal use of this when expanding explicit constructor invocation
2736 (complete_function_arguments): Set and reset parser context
2737 explicit_constructor_p field value when appropriate.
2738 (build_super_invocation, build_this_super_qualified_invocation):
2740 (patch_assignment): Fixed typo.
2741 (patch_unaryop): Check on final fields occurs only when a decl
2743 (patch_return): Take constructors into account.
2744 (patch_conditional_expr): New function.
2745 * typeck.c (build_java_signature): Removed unnecessary empty line.
2747 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
2749 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
2751 1998-10-28 Tom Tromey <tromey@cygnus.com>
2753 * decl.c (init_decl_processing): Renamed fields.
2754 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
2755 interface_len, msize fields.
2757 * class.c (make_class_data): Removed subclass_head and
2758 subclass_next fields.
2759 * decl.c (init_decl_processing): Removed subclass_head and
2760 subclass_next fields.
2762 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
2764 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
2765 * mangle.c (emit_unicode_mangled_name): Similarly.
2767 Mon Oct 26 12:17:23 1998 Nick Clifton <nickc@cygnus.com>
2769 * jcf-parse.c (get_constant): Place braces around code to compute
2770 'd' when REAL_ARITHMETIC is not defined.
2772 Sun Oct 25 14:58:05 1998 H.J. Lu (hjl@gnu.org)
2774 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
2777 1998-10-23 Tom Tromey <tromey@cygnus.com>
2779 * lang-specs.h: `.zip' files are input to jc1.
2781 Thu Oct 22 23:01:54 1998 Per Bothner <bothner@cygnus.com>
2783 * jvspecs.c: Add (but don't enable) support for combining multiple
2784 .class and .java input filenames to a single jc1 invocation.
2785 Add support for -C flag (copile to .class files).
2786 Translate -classpath and -CLASSPATH arguments.
2787 * lang-specs.h: Don't set %2 spec.
2789 1998-10-22 Tom Tromey <tromey@cygnus.com>
2791 * jcf-path.c (add_entry): Don't add trailing separator if entry is
2793 (add_path): Don't add trailing separator to non-empty path
2796 * lang.c (lang_decode_option): Check for -fclasspath and
2797 -fCLASSPATH before examining other `-f' options.
2799 * java-tree.h (finalize_identifier_node): Don't declare.
2800 * class.c (make_class_data): Don't push "final" field.
2801 * decl.c (init_decl_processing): Don't push "final" field.
2802 (finalize_identifier_node): Removed.
2803 (init_decl_processing): Don't set finalize_identifier_node.
2805 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
2807 Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
2809 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
2810 (JV_SCAN_SOURCES): New macro.
2811 (JCF_DUMP_SOURCES): Likewise.
2812 (jcf-dump$(exeext)): New target.
2813 (jv-scan$(exeext)): New target.
2815 1998-10-22 Tom Tromey <tromey@cygnus.com>
2817 * Makefile.in (LEX): Removed.
2818 (LEXFLAGS): Likewise.
2819 (SET_BISON): New macro.
2821 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
2822 spurious diffs in parse.c.
2823 ($(PARSE_SCAN_C)): Likewise.
2824 (PARSE_DIR): New macro.
2826 (PARSE_SCAN_C): Likewise.
2827 (PARSE_RELDIR): New macro.
2829 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
2831 * jcf-io.c (find_class): Use saw_java_source to determine when to
2832 look for `.java' file.
2833 * jcf-parse.c (saw_java_source): New global.
2834 (yyparse): Set it if `.java' file seen.
2836 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
2837 (GCJH_SOURCES): Likewise.
2838 * Makefile.in (datadir): New macro.
2839 (libjava_zip): Likewise.
2840 (JAVA_OBJS): Added jcf-path.o.
2841 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
2842 (../gcjh$(exeext)): Likewise.
2843 (jcf-path.o): New target.
2844 * java-tree.h (fix_classpath): Removed decl.
2845 * jcf-parse.c (fix_classpath): Removed.
2846 (load_class): Don't call fix_classpath.
2847 * parse.y (read_import_dir): Don't call fix_classpath.
2848 * lex.h: Don't mention classpath.
2849 * lex.c (java_init_lex): Don't initialize classpath.
2850 * jcf-io.c (classpath): Removed global.
2851 (find_class): Use jcf_path iteration functions. Correctly search
2852 class path for .java file.
2853 (open_in_zip): New argument `is_system'.
2854 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
2855 classpath-related options.
2856 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
2858 (lang_init): Call jcf_path_init.
2859 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
2860 * lang-specs.h: Handle -I. Minor cleanup to -M options.
2861 Correctly put braces around second string in each entry.
2862 * gjavah.c (main): Call jcf_path_init. Recognize all the new
2863 classpath-related options.
2864 (help): Updated for new options.
2865 * jcf.h: Declare functions from jcf-path.c. Don't mention
2867 * jcf-path.c: New file.
2869 * jcf-depend.c: Include jcf.h.
2871 * jcf-write.c (localvar_alloc): Returns `void'.
2872 (localvar_free): Removed unused variable.
2874 * lang.c (OBJECT_SUFFIX): Define if not already defined.
2875 (init_parse): Use OBJECT_SUFFIX, not ".o".
2877 Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2879 * class.c (emit_register_classes): Renamed from
2880 emit_register_class.
2881 * java-tree.h (emit_register_classes): Prototype renamed from
2882 emit_register_class.
2883 * jcf-parse.c (yyparse): Call emit_register_classes once before
2885 * parse.y (java_expand_classes): No longer register classes.
2887 Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2889 * class.c (is_compiled_class): New local variable
2890 seen_in_zip. Identify classes found in currently compiled source
2892 * decl.c (complete_start_java_method): Fixed typo.
2893 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
2894 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
2895 (CLASS_P): Moved around.
2896 (java_parse_abort_on_error): Macro moved from jcf-parse.c
2897 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
2899 (jcf_parse_source): Changed leading comment. Removed unnecessary
2900 fclose and CLASS_FROM_SOURCE_P marking.
2901 (parse_source_file): New local variables remember_for_generation
2902 and filename. Mark parsed file name identifier node. Removed block
2903 executed when parse_only was null. Set remember_for_generation.
2904 Use it as an argument to java_pop_parser_context.
2905 (yyparse): New local variables several_files, list, next node and
2906 current_file_list. Split ampersand separated file names into
2907 current_file_list. Iterate through the list and parse accordingly.
2908 * parse.h (java_pop_parser_context): New function prototype.
2909 * parse.y (ctxp_for_generation): New static global variable.
2910 (java_pop_parser_context): New argument generate. Link popped ctxp
2911 to ctxp_for_generation list accordingly.
2912 (java_complete_expand_methods): Fixed indentation.
2913 (java_expand_classes): New function.
2915 Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
2917 * Makefile.in: Link with libiberty.a instead of memmove.o.
2919 Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2921 * lex.c (setjmp.h): No longer included.
2922 * lex.h (setjmp.h): Included.
2923 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
2924 (duplicate_declaration_error_p): Renamed from
2925 duplicate_declaration_error.
2926 (build_array_from_name): New function prototype.
2927 * parse.y (setjmp.h): No longer included.
2928 (variable_declarator_id): Define action.
2929 (build_array_from_name): New function.
2930 (duplicate_declaration_error_p): Renamed from
2931 duplicate_declaration_error. Fixed leading comment.
2932 (register_fields): Main `for' loop reorganized. Uses
2933 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
2934 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
2935 build_array_from_name.
2936 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
2938 (read_import_dir): Don't try to skip `.' and `..'.
2939 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
2940 build_array_from_name. Main `for' loop reorganized.
2941 (resolve_qualified_expression_name): When building access to a
2942 field, use the type where the field was found, not its own type.
2943 (maybe_access_field): Use field DECL_CONTEXT if the type where the
2944 field was found is null.
2945 (qualify_ambiguous_name): Sweep through all successive array
2948 Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
2950 * java-tree.h (pop_labeled_block, lang_printable_name,
2951 maybe_add_interface, set_super_info, get_access_flags_from_decl,
2952 interface_of_p, inherits_from_p, fix_classpath,
2953 complete_start_java_method, emit_handlers, init_outgoing_cpool,
2954 make_class_data, register_class, alloc_name_constant): New
2955 function prototypes.
2956 * lang.c (lang_decode_option): Set argc argument unused. Fixed
2957 indentation. Added cast to remove warning.
2958 (lang_printable_name): Set v argument unused.
2959 (lang_print_error): Added argument to lang_printable_name call.
2960 (java_dummy_print, print_lang_decl, print_lang_type,
2961 print_lang_identifier, lang_print_xnode): All argument marked
2963 * lex.c (java_unget_unicode): Removed unnecessary argument.
2964 (java_allocate_new_line): Unused local variable is gone.
2965 (java_read_char): Added parenthesis in expressions to remove
2966 warnings. Added final return statement.
2967 (java_read_unicode): Added parenthesis in expression to remove
2969 (java_parse_end_comment): Fixed java_unget_unicode invocation.
2970 (java_parse_escape_sequence): Likewise.
2971 (java_lex): Unused local variables are gone. Fixed
2972 java_unget_unicode invocation.
2973 * lex.h (set_float_handler): Prototype added when JC1_LITE not
2975 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
2976 lang_printable_name invocation in macro.
2977 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
2979 (duplicate_declaration_error): Suppressed unused argument in
2981 (identical_subpath_p): Function declaration is gone.
2982 (patch_invoke): Suppressed unused argument in prototype.
2983 (patch_cast, build_labeled_block, check_thrown_exceptions):
2985 * parse.y (setjmp.h): Included
2986 (toplev.h): Likewise.
2987 (field_declaration:): Suppressed unused local
2988 (label_decl:): Fixed build_labeled_block invocation.
2989 (java_pop_parser_context): Put extra parenthesis around assignment
2991 (yyerror): Suppressed unused local variables.
2992 (variable_redefinition_error): Fixed lang_printable_name
2994 (create_interface): Suppressed unused local variables.
2995 (create_class): Likewise.
2996 (duplicate_declaration_error): Suppressed unused argument. Fixed
2997 lang_printable_name invocation.
2998 (register_fields): Suppressed unused local variable. Fixed
2999 duplicate_declaration_error invocation.
3000 (method_header): Suppressed unused local variable.
3001 (method_declarator, parser_check_super): Likewise.
3002 (java_complete_class): Suppressed unused local variable. Fixed
3003 fatal error message.
3004 (complete_class_report_errors): Added default: in switch.
3005 (java_check_regular_methods): Fixed lang_printable_name
3007 (check_throws_clauses): Likewise.
3008 (java_check_abstract_methods): Suppressed unused local
3009 variable. Fixed lang_printable_name invocation.
3010 (read_import_entry): Added supplemental return statement.
3011 (read_import_dir): Suppressed unused local variables.
3012 (check_pkg_class_access, declare_local_variables): Likewise.
3013 (source_start_java_method): Suppressed unused extern variable
3015 (expand_start_java_method): Suppressed unused extern and local
3016 variable declarations.
3017 (java_complete_expand_methods): Likewise.
3018 (java_complete_expand_method): Suppressed unused local variables.
3019 (make_qualified_name): Likewise.
3020 (resolve_qualified_expression_name): Added default: in
3021 switch. Fixed lang_printable_name invocation.
3022 (class_instance_creation_expression): Added parenthesis around
3024 (patch_method_invocation_stmt): Fixed lang_printable_name and
3025 patch_invoke invocations.
3026 (check_for_static_method_reference): Fixed lang_printable_name
3028 (patch_invoke): Suppressed unused arguments and local variables.
3029 (lookup_method_invoke): Suppressed unused local variables.
3030 (qualify_ambiguous_name): Added default: in switch.
3031 (identical_subpath_p): Function removed.
3032 (patch_assignment): Suppressed unused local variables. Suppressed
3033 unnecessary if statement. Fixed lang_printable_name invocations.
3034 (try_builtin_assignconv): Fixed lang_printable_name invocations.
3035 (valid_ref_assignconv_cast_p): Parenthesis around
3036 expression. Suppressed unused local variables.
3037 (build_binop): Suppressed unused local variables. fixed
3038 lang_printable_name invocations.
3039 (string_constant_concatenation): Suppressed unused local
3041 (patch_unaryop): Fixed lang_printable_name invocation.
3042 (patch_cast): Suppressed unnecessary argument. Fixed
3043 lang_printable_name invocation.
3044 (patch_array_ref): Fixed lang_printable_name invocation.
3045 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
3046 (build_labeled_block): Suppressed unused argument.
3047 (generate_labeled_block): Fixed build_labeled_block invocation.
3048 (build_loop_body): Suppressed unused local variables.
3049 (patch_loop_statement): Likewise.
3050 (patch_exit): Fixed lang_printable_name invocation.
3051 (patch_switch_statement): Likewise.
3052 (case_identity): First argument marked unused.
3053 (patch_try_statement): Fixed lang_printable_name invocations.
3054 (patch_synchronized_statement, patch_throw_statement): Likewise.
3055 (check_thrown_exceptions): Fixed check_thrown_exceptions and
3056 lang_printable_name invocations.
3057 (check_thrown_exceptions_do): Suppressed unused argument.
3059 1998-10-14 Tom Tromey <tromey@cygnus.com>
3061 * jcf-write.c (write_classfile): Add output class file as target.
3062 * lang-options.h: Added -MD, -MMD, -M, and -MM.
3063 * jcf.h: Added declarations for dependency-tracking functions.
3064 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
3065 * lang.c (lang_decode_option): Recognize -MD and -MMD.
3066 (finish_parse): Call jcf_dependency_write.
3067 (dependency_tracking): New global.
3068 (DEPEND_SET_FILE): New define.
3069 (DEPEND_ENABLE): New define.
3070 (init_parse): Enable dependency tracking if required.
3072 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
3073 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
3074 (../gcjh$(exeext)): Likewise.
3075 (jcf-depend.o): New target.
3076 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
3077 (GCJH_SOURCES): Likewise.
3078 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
3080 (find_classfile): Added dep_name argument.
3081 (find_class): Compute name of dependency.
3082 (open_in_zip): Call jcf_dependency_add_file.
3083 * gjavah.c (output_file): No longer global.
3084 (usage): Don't mention "gjavah".
3086 (java_no_argument): Likewise.
3087 (version): Likewise.
3088 (main): Recognize and handle -M family of options.
3089 (print_mangled_classname): Return is void.
3090 (process_file): Handle case where output is suppressed.
3091 (HANDLE_END_FIELD): Likewise.
3092 (HANDLE_METHOD): Likewise.
3093 * jcf-depend.c: New file.
3095 Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
3097 * java-tree.def: Add missing newline at EOF.
3099 1998-10-13 Tom Tromey <tromey@cygnus.com>
3101 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
3102 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
3104 Include <config.h> and "system.h".
3105 (disassemble_method): Undefine RET to avoid clash with
3108 Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3110 * decl.c (runtime_exception_type_node, error_exception_type_node):
3111 New global variables.
3112 (init_decl_processing): Initialized.
3113 * expr.c (java_lang_expand_expr): Set caught exception type to
3114 null if catch handler argument doesn't exit.
3115 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
3117 * java-tree.h (runtime_exception_type_node,
3118 error_exception_type_node): Global variables declared.
3119 (DECL_FUNCTION_THROWS): New macro.
3120 (DECL_FUNCTION_BODY): Modified comment.
3121 (DECL_SPECIFIC_COUNT): Likewise.
3122 (struct lang_decl): New field throws_list.
3123 (IS_UNCHECKED_EXPRESSION_P): New macro.
3124 * lex.c (java_lex): Generate location information for THROW_TK.
3125 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
3126 EXCEPTIONS_P): New macros.
3127 (enum jdep_code): New value JDEP_EXCEPTION.
3128 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
3129 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
3130 PATCH_METHOD_RETURN_ERROR): New macros.
3131 (patch_method_invocation_stmt): Added new argument to prototype.
3132 (patch_synchronized_statement, patch_throw_statement,
3133 check_thrown_exceptions, check_thrown_exceptions_do,
3134 purge_unchecked_exceptions, check_throws_clauses): New function
3136 * parse.y Fixed typo in keyword section.
3137 (throw:): Rule tagged <node>.
3138 (THROW_TK): Keyword tagged <operator>.
3139 (method_header:): Last argument to call to method_header passed
3141 (throws:, class_type_list:, throw_statement:,
3142 synchronized_statement:, synchronized:): Defined actions.
3143 (method_header): New local variable current. Register exceptions
3145 (java_complete_tree): Complete and verify exceptions from throws
3147 (complete_class_report_errors): Error message on exceptions not
3149 (java_check_regular_methods): Fixed typo. Shortcut on private
3150 overriding methods. Changed error message on method
3151 redefinition. Check for throws clause compatibility.
3152 (check_throws_clauses): New function.
3153 (java_check_abstract_methods): Use DECL_NAME for wfl or current
3154 method. Changed error message on method redefinition.
3155 (currently_caught_type_list): New static variable.
3156 (java_complete_expand_methods): Purge unchecked exceptions from
3157 throws clause list. Call PUSH_EXCEPTIONS before walk and
3158 POP_EXCEPTIONS after.
3159 (resolve_qualified_expression_name): Pass new argument as NULL to
3160 patch_method_invocation_stmt.
3161 (patch_method_invocation_stmt): New argument ref_decl. Invoke
3162 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
3163 argument list when appropriate. Use new argument if non null to
3164 store selected method decl.
3165 (patch_invoke): Convert if necessary args of builtin types before
3166 forming CALL_EXPR. Argument list no longer reversed here.
3167 (invocation_mode): Treat final methods as static methods.
3168 (java_complete_tree): New cases for THROW_EXPR: and
3169 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
3171 (complete_function_arguments): No more RECORD_TYPE
3172 conversion. Function parameter nodes no longer saved.
3173 (valid_ref_assignconv_cast_p): Avoid handling null type.
3174 (patch_binop): Fixed null constant reference handling.
3175 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
3177 (patch_try_statement): Fixed comments. Record caught types in
3178 list, push the list, expand try block and pop the list.
3179 (patch_synchronized_statement, patch_throw_statement,
3180 check_thrown_exceptions, check_thrown_exceptions_do,
3181 purge_unchecked_exceptions): New functions.
3182 * typeck.c (lookup_argument_method): Allow WFL in place of method
3183 DECL_NAME during method definition check
3185 1998-10-09 Tom Tromey <tromey@cygnus.com>
3187 * gjavah.c (decode_signature_piece): New function.
3188 (print_c_decl): Use it. Added `name_override' argument.
3189 (print_method_info): Use name_override argument to print_c_decl.
3190 (seen_fields): Removed.
3191 (print_field_info): Don't update seen_fields.
3192 (struct method_name): New structure.
3193 (method_name_list): New global.
3194 (print_method_info): Add new method to list of methods.
3195 (name_is_method_p): New function.
3196 (print_field_info): If field name has same name as method, then
3198 (process_file): Parse methods before fields.
3199 (field_pass): New global.
3200 (HANDLE_END_FIELD): Take field_pass into account.
3202 Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3204 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
3205 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
3207 Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
3209 * jvspec.c: Fix bug in jvgenmain_spec patch.
3211 Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3213 * Makefile.in (lang.o:): Install dependency on java-tree.def.
3214 * decl.c (soft_exceptioninfo_call_node): New global variable.
3215 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
3216 takes extra integer argument. soft_exceptioninfo_call_node
3218 * except.c (java_set_exception_lang_code): New function
3219 (method_init_exceptions): Called here.
3220 (prepare_eh_table_type): New function.
3221 (expand_end_java_handler): Called here.
3222 * expr.c (build_java_throw_out_of_bounds_exception): Now features
3223 one argument. Modified generation of call to
3224 soft_badarrayindex_node to use new argument.
3225 (build_java_arrayaccess): Pass faulty index value to
3226 build_java_throw_out_of_bounds_exception.
3227 (generate_name): New function.
3228 (java_lang_expand_expr): New local variables node, current,
3229 has_finally_p. Expand TRY_EXPR node.
3230 (process_jvm_instruction): Replace top of the stack with thrown
3231 object reference when entering exception handler.
3232 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
3233 specific tree codes.
3234 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
3236 (DECL_SPECIFIC_COUNT): New macro.
3237 (prepare_eh_table_type, java_set_exception_lang_code,
3238 generate_name): New function declarations.
3239 (match_java_method): Declaration deleted.
3240 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
3242 * lex.c (TRY_TK, CATCH_TK): Generate location information.
3243 * parse.h (redefinition_error, refine_accessible_methods_list,
3244 can_cast_to_p): Function declaration removed.
3245 (classitf_redefinition_error, variable_redefinition_error,
3246 parse_jdk1_1_error, find_applicable_accessible_methods_list,
3247 find_most_specific_methods_list, argument_types_convertible,
3248 enter_a_block, valid_builtin_assignconv_identity_widening_p,
3249 valid_cast_to_p, valid_method_invocation_conversion_p,
3250 try_reference_assignconv, add_stmt_to_compound,
3251 build_jump_to_finally, build_tree_list, patch_try_statement,
3252 java_get_catch_block): New function declarations.
3253 * parse.y (string_buffer_type): Global variable deleted.
3254 (group_of_labels, catches, catch_clause, catch_clause_parameter,
3255 finally): Rules tagged <node>.
3256 (TRY_TK, CATCH_TK): Token tagged <operator>.
3257 (class_body_declaration:, class_member_declaration:,
3258 formal_parameter:, explicit_constructor_invocation:,
3259 interface_member_declaration:, constant_declaration:,
3260 primary_no_new_array:, class_instance_creation_expression:,
3261 array_creation_expression:): Issue error on unsuported JDK1.1
3263 (try_statement:, catches:, finally:): Define actions.
3264 (catch_clause_parameter): New rule.
3265 (catch_clause:): Use new rule catch_clause_parameter.
3266 (parse_jdk1_1_error): New function.
3267 (redefinition_error): Renamed classitf_redefinition_error.
3268 (variable_redefinition_error): New function.
3269 (check_class_interface_creation): Call
3270 classitf_redefinition_error.
3271 (java_complete_tree): Added error message on JDEP_TYPE: case.
3272 (complete_class_report_errors): Fixed indentation.
3273 (declare_local_variables): Call variable_redefinition_error.
3274 (source_end_java_method): Call java_set_exception_lang_code and
3275 emit_handlers where appropriate.
3276 (java_method_add_stmt): Call add_stmt_to_block.
3277 (add_stmt_to_block): New function.
3278 (lookup_method_invoke): Fixed outside comment. new local variable
3279 candicates. Call find_applicable_accessible_methods_list and
3280 find_most_specific_methods_list when searching for a
3281 method. Modified error report to list possible candidates when
3283 (find_applicable_accessible_methods_list,
3284 find_most_specific_methods_list, argument_types_convertible): New
3286 (refine_accessible_methods_list): Function deleted.
3287 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
3288 expr (if applicable) before calling patch_array_ref.
3289 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
3290 (enter_block): Fixed comment.
3291 (enter_a_block): New function.
3292 (patch_assignment): Reorganized. Call try_reference_assignconv for
3293 references. Call valid_cast_to_p instead of can_cast_to_p.
3294 (try_reference_assignconv,
3295 valid_builtin_assignconv_identity_widening_p): New functions.
3296 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
3297 (valid_cast_to_p, valid_method_invocation_conversion_p): New
3299 (build_string_concatenation): Don't resolve StringBuffer.
3300 (patch_cast): Fixed inverted arguments.
3301 (patch_array_ref): Code to save array expr deleted. Call
3302 valid_cast_to_p instead of can_cast_to_p.
3303 (generate_labeled_block): Call generate_name.
3304 (build_jump_to_finally, build_try_statement, java_get_catch_block,
3305 patch_try_statement): New functions.
3306 * typeck.c (match_java_method): Function deleted.
3308 Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
3310 * jvspec.c: jvgenmain_spec uses different temporary file names.
3312 Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
3314 * jvspec.c (lang_specific_driver): Fail if user specifies
3315 --main= when not linking.
3317 Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
3319 * class.c (make_class_data): Push value for `thread' field.
3320 * decl.c (init_decl_processing): Added `thread' field to class.
3322 * class.c (add_field): Always make static fields externally
3325 Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
3327 * expr.c (build_java_athrow,
3328 build_java_throw_out_of_bounds_exception, expand_invoke,
3329 build_newarray, expand_java_multianewarray, build_java_monitor):
3330 Update comments to reflect _Jv_* function names.
3332 Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
3334 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
3335 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
3336 * parse.y (expand_start_java_method): Likewise.
3338 Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
3340 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
3342 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
3343 (add_field): No longer need to convert from RECORD_TYPE to pointer,
3344 * expr.c: Remove no-longer-needed calls to promote_type.
3345 * decl.c (give_name_to_locals): Liekwise.
3346 * jcf-parse.c (get_class_constant): Compensate for new signatures.
3347 * parse.y: Add/remove promote_type calls as appropriate.
3348 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
3349 (parse_signature_string): Likewise.
3350 (build_java_array_type): Fix for now signature convenions.
3352 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
3354 Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
3356 * class.c (init_class_processing): libjava function renamed to
3359 Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3361 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
3362 * java-tree.def: Fixed DEFTREECODE third argument.
3363 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
3364 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
3365 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
3366 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
3367 JAVA_THIS_EXPR): Now replaced by tree code definitions.
3368 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
3369 * lang.c (java_tree_code_type, java_tree_code_length,
3370 java_tree_code_name): New arrays.
3371 (lang_init): Append Java tree node definitions to Gcc ones.
3372 * lex.c (expression_obstack): Declared as extern when JC1_LITE
3374 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
3376 (java_lex): Allow declaration of empty string constants. Retain
3377 location information on CASE_TK and DEFAULT_TK.
3378 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
3379 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
3380 Modified to be more robust.
3381 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
3382 (build_new_invocation, try_builtin_assignconv,
3383 patch_switch_statement, string_constant_concatenation,
3384 build_string_concatenation, patch_string_cst, patch_string,
3385 java_expand_switch): New function declarations.
3386 * parse.y: Rules related to switch and EH tagged <node>.
3387 (label_id): Set to NULL_TREE
3388 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
3390 (this_or_super:): Fixed indentation.
3391 (statement:, statement_nsi:, statement_without_trailing_substatement:,
3392 statement_expression:): Removed call to RULE on all sub-rules.
3393 (switch_expression:, switch_labels:): New rules.
3394 (switch_statement:, switch_block:, switch_block_statement_groups:,
3395 switch_block_statement_group:, switch_labels:, switch_label:):
3397 (throw_statement:, synchronized_statement:, try_statement:):
3398 Defined temporary actions.
3399 (class_instance_creation_expression:): Call
3400 build_new_invocation. Fixed indentation.
3401 (field_access): Fixed indentation.
3402 (method_invocation): Likewise.
3403 (make_qualified_primary): Use THIS_EXPR.
3404 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
3405 resolving from SUPER, set *type_found.
3406 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
3407 (java_complete_tree): Removed unused local variable `location'. Case
3408 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
3409 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
3410 on MODIFY_EXPR: and all binary operator tree code cases. Removed
3411 STRING_CST: case. default: checks for patchable strings.
3412 (complete_function_arguments): Transform string constant or
3413 crafted StringBuffer if necessary.
3414 (build_method_invocation): Fixed comments.
3415 (build_new_invocation): New function.
3416 (patch_assignment): Call try_builtin_assignconv to figure a valid
3417 assignment conversion between builtin types.
3418 (try_builtin_assignconv): New function.
3419 (build_binop): Use URSHIFT_EXPR directly to call build.
3420 (operator_string): Use UNARY_PLUS_EXPR.
3421 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
3423 (do_merge_string_cste, merge_string_cste,
3424 string_constant_concatenation, build_string_concatenation,
3425 patch_string, patch_string_cst): New function.
3426 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
3427 (patch_unaryop): Likewise. New test of valid ++/-- operands.
3428 (build_newarray_node): Use NEW_ARRAY_EXPR.
3429 (build_this): Use THIS_EXPR.
3430 (build_return): Enable debug information on return statement.
3431 (build_if_else_statement): Likewise.
3432 (complete_labeled_statement): Fixed related comment.
3433 (build_loop_body): Fixed comment.
3434 (build_bc_statement): Enable debug information on break/continue
3436 (patch_bc_statement): Fixed typos. Handle SWITCH statement
3438 (patch_switch_statement, case_identity, java_expand_switch): New
3441 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
3443 * buffer.h (BUFFER_INIT): New macro.
3444 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
3445 Pass (struct jcf_partial *state) to most functions.
3446 (jcf_block, jcf_relocation): New types.
3447 Support labels, branches, conditionals, loops.
3449 Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
3451 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
3453 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
3455 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
3456 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
3457 not integer_type_node (INT_TYPE_SIZ bits).
3459 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
3461 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
3462 * jcf-dump.c (print_exception_table): New function.
3463 (disassemble_method): Better handling of wide instructions.
3464 Make more robust for bad input.
3466 Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
3468 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
3471 Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
3473 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
3475 Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
3477 * Makefile.in ($(PARSE_H)): Removed target.
3479 Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
3481 * Makefile.in (JAVA_OBJS): Add memmove.o
3482 (memmove.o): New target & rules.
3484 Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
3486 * expr.c (expand_invoke): Don't generate a call to the class init
3489 Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
3491 * Makefile.in: Add many missing dependencies.
3492 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
3494 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
3495 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
3497 Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
3499 * decl.c (complete_start_java_method): If method is static (and
3500 not private) call _Jv_InitClass.
3501 * expr.c (expand_invoke): Don't call build_class_init.
3503 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
3505 Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
3507 * Make-lang.in (GCJ): Define before using.
3509 Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
3511 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
3512 losing due to namespace pollution in GNU getopt.h
3514 Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
3516 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
3517 (java.all.cross): Likewise.
3518 (java.rest.encap): Likewise.
3520 Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
3522 * gjavah.c (print_class_decls): Fix thinko in arglist
3523 * jcv-io.c (find_classfile): Similarly.
3525 Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
3527 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
3529 Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
3531 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
3532 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
3533 * Makefile.in (PARSE_C): New macro.
3534 (PARSE_H): Likewise.
3535 (PARSE_SCAN_C): Likewise.
3536 ($(PARSE_C)): Target renamed from parse.c.
3537 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
3538 (clean): Remove parse-scan.c as well.
3539 (parse.o): Depend on $(PARSE_C).
3541 Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
3543 * README, license.terms: Removed.
3545 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
3546 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
3547 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
3548 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
3549 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
3550 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
3551 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
3552 and Java trademark attribution.
3554 Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
3556 * Makefile.in: Use gcjh, not gjavah.
3557 * config-lang.in (stagestuff): Use gcjh, not gjavah.
3558 * Make-lang.in: Changed gjavah to gcjh everywhere.
3560 Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
3562 * gjavah.c: Support new -prepend -add -append flags.
3563 (print_method_info): Method is not virtual if class is final.
3565 Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3567 * jv-scan.c: Fixed copyright assignment.
3568 * keyword.gperf: Likewise.
3569 * keyword.h: Likewise.
3570 * lex.c: Fixed copyright assignment.
3571 (java_lex): Push unicode back when parsing '<'.
3572 * lex.h: Fixed copyright assignment.
3573 * parse-scan.y: Likewise.
3574 * parse.h: Fixed copyright assignment.
3575 (build_debugable_stmt, complete_for_loop): New function prototypes.
3576 * parse.y: Fixed copyright assignment.
3577 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
3578 size_zero_node when completing a loop with no exit condition.
3579 (for_statement_nsi:): Define action.
3580 (for_init:, for_update:): Return size_zero_node when empty.
3581 (declare_local_variables): Call build_debugable_stmt.
3582 (build_debugable_stmt): New function.
3583 (build_loop_body): Build debugable statement around loop
3585 (complete_loop_body): Take into account the debugable statement
3586 around the EXIT_EXPR.
3587 (complete_loop_body): New function.
3588 (patch_exit_expr): Fixed condition inversion.
3590 Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
3592 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
3593 name of thread define.
3594 * jvspec.c (THREAD_NAME): New macro.
3596 (THREADLIB): Likewise.
3597 (lang_specific_driver): Recognize attempt to link with thread
3598 library or gc library. Recognize -ljava on command line so it
3599 isn't linked against more than once.
3601 Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3603 * parse-scan.y (report_main_declaration): Name of the class
3604 containing `main' can be a qualified name.
3606 Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
3608 * config-lang.in: Changed gjavac to gjc everywhere.
3609 * Make-lang.in: Changed gjavac to gjc everywhere.
3611 Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3613 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
3614 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
3615 and install the files.
3616 * Makefile.in (JAVA_OBJS_LITE): New variable.
3617 (compiler:): Now include jv-scan as a dependency.
3618 (../jv-scan$(exeext), parse-scan.c): New targets.
3619 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
3620 * config-lang.in (compilers): Removed gcj, gjavah from the list.
3621 * jcf-parse.c (parse_source_file): Call java_layout_classes and
3622 check for errors even if parse_only.
3623 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
3625 (yylex): New function. Uses java_lex body.
3626 (java_lex): Removed commented out statement. Remove local variable
3627 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
3628 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
3629 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
3630 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
3631 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
3632 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
3634 (java_lex_error): Empty if JC1_LITE is defined.
3635 (java_get_line_col): Return 0 if JC1_LITE is defined.
3636 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
3637 SET_MODIFIER_CTX): Moved into the section containing the macros
3638 conditionally defined by JC1_LITE.
3639 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
3640 argument if JC1_LITE is defined.
3641 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
3642 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
3644 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
3645 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
3646 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
3647 to different values according to JC1_LITE.
3648 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
3649 declared if JC1_LITE set.
3650 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
3651 defined if JC1_LITE not set.
3652 (struct parser_ctx): Reorganized and skip the jc1 front end part
3654 (java_layout_classes): New function definition.
3655 (java_push_parser_context, java_init_lex, yyparse, yylex,
3656 yyerror): Prototype always declared. All other static function
3657 prototypes declared only if JC1_LITE is not set.
3658 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
3659 declared in parse.h.
3660 (java_layout_classes): New function.
3661 (java_complete_expand_methods): No longer layout the class here.
3662 * parse-scan.y: New file.
3663 * jv-scan.c: New file.
3665 Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
3667 * gjavah.c (main): Handle -friend option.
3668 (friend_specs): New global.
3669 (generate_access): Handle friend_specs.
3670 (process_file): Likewise.
3671 (MAX_FRIENDS): New macro.
3672 (friend_count): New global.
3673 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
3674 Changed all callers.
3676 Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
3678 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
3679 (main): Handle processing all the entries of a named .zip archive.
3680 * jcf-io.c (jcf_trim_old_input): New function.
3681 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
3683 Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
3685 * lang.c (flag_assume_compiled): Make default be on.
3687 Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
3689 * jcf-dump.c: Add bunches of flags to control output more.
3690 (process_class): New function; support printing more than one class.
3691 (main): Support new --print-main and --javap flags.
3692 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
3693 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
3695 Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
3697 Change mangling of dispatch table to match C++ vtable (w/thunks).
3698 * class.c (build_dtable_decl), java-tree.h: New function.
3699 (make_class_data): Call it.
3700 * decl.c (init_decl_processing): Likewise.
3702 Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
3704 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
3705 soft_anewarray; adjust args passed.
3706 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
3707 match _Jv_NewObjectArray.
3709 Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3711 * decl.c (push_labeled_block, pop_labeled_block): New functions.
3712 * expr.c (loopup_label): Call create_label_decl.
3713 (create_label_decl): New function.
3714 (java_lang_expand_expr): Call expand_start_bindings with argument
3716 * java-tree.h Added space after PROTO in function declarations
3718 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
3719 (create_label_decl, push_labeled_block): New function
3721 * lex.c (label_id): Initialize.
3722 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
3724 * parse.h Added space after PROTO in function declarations when
3726 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
3727 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
3728 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
3729 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
3731 (struct parser_ctxt): New fields current_loop,
3732 current_labeled_block.
3733 (build_if_else_statement, patch_if_else_statement,
3734 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
3735 generate_labeled_block, complete_labeled_statement,
3736 build_bc_statement, patch_bc_statement, patch_loop_statement,
3737 build_new_loop, build_loop_body, complete_loop_body): New function
3739 * parse.y (java_warning_count): New global variable.
3740 (label_id): New static variable.
3741 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
3742 (block:): Return size_zero_node when block is empty.
3743 (empty_statement:): Return size_zero_node.
3744 (statement:): Implement supplemental action when for_statement: is
3746 (label_decl:): New rule.
3747 (labeled_statement:): Rewritten using label_decl. Actions
3749 (labeled_statement_nsi:): Likewise.
3750 (if_then_statement): Actions implemented.
3751 (while_expression): New rule.
3752 (while_statement:): Rewritten using while_expression. Actions
3754 (while_statement_nsi:): Likewise.
3755 (do_statement_begin:): New rule.
3756 (do_statement:): Rewritten using do_statement_begin. Actions
3758 (for_statement:): Rewritten using for_begin. Actions implemented.
3759 (for_statement_nsi:): Likewise.
3760 (for_header:, for_begin:): New rules.
3761 (for_init:): Actions implemented.
3762 (statement_expression_list:, break_statement:,
3763 continue_statement:): Likewise.
3764 (yyerror): Count number of issued warning(s).
3765 (java_report_errors): Report error(s) and/or warning(s).
3766 (java_complete_class): Use build_java_argument_signature to
3767 recompute completed method signature.
3768 (java_check_regular_methods): New locals method_wfl and aflags.
3769 Use method_wfl instead of lookup_cl during error reports. Fixed
3770 indentation and modified some error messages. Use
3771 lang_printable_name in method instead of the DECL_NAME. New code
3772 to issue warnings on methods not overriding corresponding methods
3773 private to a different package.
3774 (java_method_add_stmt): Call add_stmt_to_compound.
3775 (add_stmt_to_compound): New function.
3776 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
3777 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
3778 (build_if_else_statement, patch_if_else_statement,
3779 build_labeled_block, generate_labeled_block,
3780 complete_labeled_statement, build_new_loop, build_loop_body,
3781 complete_loop_body, patch_loop_statement, build_bc_statement,
3782 patch_bc_statement, patch_exit_expr): New functions.
3783 * typeck.c (build_java_signature): Build argument signature before
3784 enclosing it in between parenthesis.
3786 Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
3788 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
3789 (JAVA_OBJS): Added reminder comment
3791 Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
3793 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
3794 be interpreted as a long long.
3796 Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
3798 * decl.c (init_decl_processing): Use _Jv_InitClass, not
3799 soft_initialise_class. Use _Jv_NewMultiArray, not
3800 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
3801 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
3802 _Jv_CheckArrayStore, not soft_checkarraystore. Use
3803 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
3805 Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
3807 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
3808 length_identifier_node): New global tree node constants.
3809 * parse.y (kw_super, kw_this, kw_length): Removed globals.
3810 Replace uses by super_identifier_node etc.
3811 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
3813 * parse.y (resolve_field_access): Don't special-case ".length" if
3814 flag_emit_class_files.
3815 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
3816 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
3819 Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
3821 * decl.c (init_decl_processing): Remove unused method_type_node fields.
3822 * class.c (make_method_value): Remove init for removed fields.
3824 * class.c (layout_class): Use build_java_argument_signature.
3825 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
3827 * typeck.c (push_java_argument_signature): Removed. Merged into ...
3828 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
3829 (build_java_signature): Don't use push_java_argument_signature.
3831 * typeck.c (lookup_argument_method): New function.
3832 * parse.y (java_check_regular_methods): Use lookup_argument_method
3833 instead of lookup_java_method2 followed by lookup_java_method.
3835 * parse.y (check_method_redefinition): Minor optimization.
3837 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
3838 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
3840 Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
3842 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
3845 * gjavah.c (java_float_finite): Use K&R-style definition.
3846 (java_double_finite): Likewise.
3847 (generate_access): Now returns void. Changed all callers.
3848 (last_access_generated): Removed.
3849 (process_file): Only make a single pass over the .class file.
3851 Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
3853 * class.c (get_dispatch_table): Add extra dummy vtable entry,
3854 for compatibility for G++ (with -fvtable-thunks).
3855 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
3857 * gjavah.c (process_file): Use public inheritance for super-class.
3859 Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3861 * lex.c (java_init_lex): Initialize ctxp->package.
3862 * parse.h (struct parser_ctxt): package and package_len replaced
3863 by tree package, an identifier node. Field method_decl_list is
3864 gone. Fixed comments.
3865 (lookup_field_wrapper, merge_qualified_name, not_accessible,
3866 class_in_current_package): New function prototypes.
3867 * parse.y (array_type:): Set class loaded flag on primitive type
3869 (package_declaration:): Assign ctxp->package to the
3871 (method_invocation:): Handle invocation of method qualified by
3873 (single_type_import_declaration:): Removed ambiguity check.
3874 (java_pop_parser_context): New local variable `next'. Reset and
3875 set IMPORT_CLASSFILE_NAME flags on current and previous import
3877 (java_accstring_lookup): Use new local macro COPY_RETURN.
3878 (lookup_field_wrapper): New function.
3879 (parser_qualified_classname): Use merge_qualified_name.
3880 (parser_check_super_interface): Broaden error message.
3881 (do_resolve_class): Check for qualified class name in the current
3882 compilation unit if appropriate.
3883 (process_imports): Check for already defined classes.
3884 (check_pkg_class_access): Got rid of call to
3885 get_access_flags_from_decl.
3886 (java_complete_expand_methods): Call safe_layout_class based on
3887 the current class size.
3888 (make_qualified_primary): Build a WFL qualification on primary if
3890 (merge_qualified_name): New function.
3891 (make_qualified_name): Use merge_qualified_name.
3892 (resolve_expression_name): Use safe_lookup_field.
3893 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
3894 (resolve_qualified_expression_name): Likewise. Check on resolved
3895 element accessibility.
3896 (not_accessible_p, class_in_current_package): New functions.
3897 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
3898 (patch_method_invocation_stmt): Merged common pieces. Check
3899 accessibility of invoked method.
3900 (check_for_static_method_reference): Add returned type in error
3902 (invocation_mode): Get rid of bogus check on PRIVATE methods.
3903 (refine_accessible_methods_list): Merged two conditions in test.
3904 (java_complete_class): Sanity check on stabilize_ref gone.
3905 * zextract.c (read_zip_archive): Cast lseek second argument to long.
3907 Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
3909 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
3911 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
3913 * gjavah.c (F_NAN): Removed.
3914 (F_NAN_MASK): New macro.
3915 (F_POSITIVE_INFINITY): Removed.
3916 (F_NEGATIVE_INFINITY): Likewise.
3917 (java_float_finite): Rewrote.
3918 (D_NAN_MASK): Renamed.
3919 (java_double_finite): Rewrote.
3920 (D_POSITIVE_INFINITY): Removed.
3921 (D_NEGATIVE_INFINITY): Likewise.
3923 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
3924 If verbose, print underlying representation of value in hex.
3926 Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
3928 * buffer.h, buffer.c: New files.
3929 * Makefile.in (JAVA_OBJS): Add buffer.o.
3931 Support locals variables and writing their debug entries to .class.
3932 * jcf-write.c: Simplify some by user new buffer type.
3933 (vode_buffer_grow): Removed.
3934 (struct localvar_info): New type.
3935 (localsvars, localvartable): New buffers.
3936 (localvar_alloc, localvar_free): New functions.
3937 (generate_bytecode_insns): Handle local variables.
3938 (generate_classfile): Write LocalVariableTable attribute.
3940 Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3942 * jcf-io.c (open_in_zip): Check the zipfile magic number.
3943 * zipfile.h (ZIPMAGIC): New macro.
3945 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
3947 * Makefile.in (gjavah.o): Updated dependencies.
3948 (jcf-dump.o): Likewise.
3949 (all.indirect): Use ../gjavah.
3950 (../gjavah$(exeext)): Likewise.
3951 (clean): Don't remove gjavah.
3952 (clean): Remove parse.c, not java/parse.c.
3953 * Make-lang.in (java): Added gjavah.
3954 (gjavah$(exeext)): New target.
3955 (GJAVAH_SOURCES): New macro.
3956 (java.all.build): Added gjavah.
3957 (java.all.cross): Likewise.
3958 (java.rest.encap): Likewise.
3959 * config-lang.in (compilers, stagestuff): Added gjavah.
3961 Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
3963 * gjavah.c (java_float_finite): New function.
3964 (java_double_finite): Likewise.
3965 (F_POSITIVE_INFINITY): New macro.
3966 (F_NEGATIVE_INFINITY): Likewise.
3968 (D_POSITIVE_INFINITY): Likewise.
3969 (D_NEGATIVE_INFINITY): Likewise.
3971 (print_field_info): Use java_float_finite and java_double_finite.
3973 Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
3975 * parse.y (method_header): Name "this" implicit argument.
3977 Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
3979 * jcf-write.c: Write out LineNumberTable attribute in .class file.
3980 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
3981 (put_linenumber): New function.
3982 (generate_bytecode_insns, generate_classfile): Write line numbers.
3984 Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3986 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
3987 (lookup_name, build_known_method_ref, build_class_init,
3988 build_invokevirtual, invoke_build_dtable, match_java_method,
3989 build_field_ref, pushdecl_force_head, build_java_binop,
3990 binary_numeric_promotion, build_decl_no_layout,
3991 build_java_arrayaccess, build_newarray, build_anewarray,
3992 build_java_array_length_access, build_java_arraynull_check): New
3993 extern function prototypes.
3994 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
3995 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
3997 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
3999 * jcf.h (jcf_out_of_synch): New extern function prototype.
4000 * parse.h: Static/global function implemented in parse.y
4001 prototyped and declarations moved at the end of the file.
4002 (DECL_P): Check that the argument isn't null.
4003 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
4004 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
4005 (QUAL_DECL_TYPE): New macro.
4006 (PARAMS): Macro definition removed.
4007 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
4008 (return_statement:): Call build_return.
4009 (field_access:): Call make_qualified_primary in sub rule.
4010 (method_invocation:): Build method invocation and call
4011 make_qualified_primary when processing primaries.
4012 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
4013 get_type_from_signature.
4014 (java_check_regular_method): Extra integer 0 argument when calling
4015 lookup_java_method2.
4016 (lookup_java_interface_method2): Extra method DECL argument when
4017 calling lookup_java_interface_method2.
4018 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
4020 (java_complete_expand_method): Layout current class iff not
4021 already done. Don't process interface's methods.
4022 (java_complete_expand_method): Use super class only if it
4023 exists. Use current class otherwise.
4024 (make_qualified_primary): New function.
4025 (resolve_expression_name): Process qualified expression or
4026 expression from primary the same way.
4027 (resolve_expression_name): Two last arguments to
4028 resolve_field_access are now NULL_TREEs.
4029 (resolve_field_access): New variable is_static. Local field must
4030 be DECLs. is_static computed on field DECLs only. Append code in
4031 where_found to the field access if necessary. Use QUAL_DECL_TYPE
4032 to initialize field_type.
4033 (resolve_qualified_expression_name): New local variable,
4034 previous_call_static and is_static. Handle primaries with function
4035 calls, casts, array references and `this'. `super' now handled as
4036 `(super_class)this'. Use is_static to clarify boolean expressions.
4037 Added code to handle case where a proper handle is required to
4038 access a field. Use QUAL_DECL_TYPE where applicable.
4039 (maybe_access_field): New function.
4040 (patch_method_invocation_stmt): New arguments primary, where,
4041 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
4042 deleted. Use `where' as a type to search from if specified. Check
4043 for static method reference where forbidden. Append primary or
4044 current_this to the argument list if not calling constructor nor
4046 (check_for_static_method_reference): New function.
4047 (patch_invoke): Layout the class on which new is done if
4049 (lookup_method_invoke): Changed format to report errors on
4051 (qualify_ambiguous_name): New local variable this_found. Now
4052 handle things from primaries. Method call are considered
4054 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
4056 (not_initialized_as_it_should_p): Comply with the new DECL_P.
4057 (java_complete_tree): New case fo RETURN_EXPR. Process function
4058 call arguments in separate function.
4059 (complete_function_arguments): New function.
4060 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
4062 (patch_assignment): Take the return function slot into account as
4063 a RHS. Distinguish assignment from a return.
4064 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
4065 when checking methods in interfaces.
4066 (resolve_type_during_patch): NULL argument to unresolve_type_p
4067 instead of NULL_TREE.
4068 (patch_newarray): Fixed typo in comment.
4069 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
4070 (build_return, patch_return): New functions.
4071 * typeck.c (lookup_java_constructor): Fixed typo in comment.
4073 Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
4075 * constants.c (find_name_and_type_constant, find_fieldref_index,
4076 find_methodref_index): New methods.
4077 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
4078 just return given method. Also, rename to build_known_method_ref.
4079 (expand_invoke): Rename call to build_invoke_non_interface.
4080 * java-tree.h, parse.h: Update prototype.
4081 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
4082 (such as expand_expr_stmt) if flag_emit_class_files.
4083 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
4084 STACK_TARGET, IGNORE_TARGET): New macros.
4085 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
4086 (generate_bytecode_insn): New function to generate method's bytecode.
4087 (generate_classfile): Node generate Code attribute for a method.
4088 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
4089 push_long_const, field_op, adjust_typed_op, maybe_wide):
4090 New functions used by generate_bytecode_insn.
4092 * typeck.c (signature_include_return): Remove variable.
4093 (push_java_argument_signature, build_java_argument_signature): New.
4094 (build_java_signature): Use push_java_argument_signature.
4095 * parse.y: Use build_java_argument_signature instead of fiddling
4096 with signature_include_return.
4098 Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
4100 * gjavah.c (print_c_decl): Always generate JArray<>* for array
4103 * Makefile.in (all.indirect): Added gjavah$(exeext).
4104 (gjavah$(exeext)): Added $(exeext).
4107 Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4109 * class.c (layout_class): Call to java_layout_parsed_class replace
4110 by safe_layout_class.
4111 * expr.c (build_java_array_length_access): Removed static storage
4112 class in the function definition.
4113 (build_java_arraynull_check): Likewise.
4114 Also fixed typos in two comments.
4115 * lex.c (java_init_lex): Initialize static global kw_length.
4116 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
4117 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
4119 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
4120 * parse.h (resolve_no_layout): New static function declaration.
4121 (get_identifier_in_static): Declaration removed.
4122 (java_layout_parsed_class): Function name declaration changed to
4124 (build_newarray_node, patch_newarray, resolve_type_during_patch,
4125 not_initialized_as_it_should_p, build_this): New static function
4127 (pushdecl_force_head, build_java_binop, int_fits_type_p,
4128 binary_numeric_promotion, stabilize_reference,
4129 build_decl_no_layout, build_java_arrayaccess): Extern function
4130 declarations moved into their own section.
4131 (build_newarray, build_anewarray, build_java_array_length_access,
4132 build_java_arraynull_check): New extern function declarations.
4133 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
4134 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
4136 (CALL_CONSTRUCTOR_P): New macro.
4137 * parse.y (kw_length): New static global tree node.
4138 (return_statement): Tagged <node>.
4139 (RETURN_TK): Tagged <operator>.
4140 (variable_declarator_id:): Build variable declaration with an
4141 empty initialization value if a syntax error was found in the
4142 initialization part of the variable declaration.
4143 (statement_without_trailing_substatement:): return_statement: now
4144 uses the default rule.
4145 (return_statement:): Temporarily fixed to return NULL_TREE.
4146 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
4147 (class_instance_creation_expression:): Class creation rules now
4148 call build_method_invocation upon reduction.
4149 (array_creation_expression:): Rules call build_newarray_node upon
4151 (dim_exprs:): Build a list of dimension expressions.
4152 (dim_expr:): Store location of the OSB_TK in the dimension
4154 (method_invocation:): Added a new error rule.
4155 (build_unresolved_array_type): WFL argument may also be an array
4156 on a primitive type. Name of the argument changed to reflect this.
4157 (method_declarator): Insert argument type at the beginning of the
4158 argument type list and later reverse the list.
4159 (unresolved_type_p): Argument 'returned' may be optionally
4161 (java_layout_class_from_source): Function renamed
4163 (resolve_and_layout): Now call resolve_no_layout and
4165 (resolve_no_layout): New function.
4166 (purify_type_name): New function.
4167 (complete_class_report_errors): Call purify_type_name during error
4168 report on a type not found.
4169 (process_imports): error_found local variable doesn't need to be
4170 initialized to zero.
4171 (declare_local_variables): New local type_wfl. Fixed typo in error
4172 message. type_wfl assigned to unresolved type and used to register
4173 incomplete type. Build a WFL around the variable initialization
4174 statement so that debug info can be generated on it.
4175 (source_start_java_method): Reverse argument list after they've
4177 (current_this): New static global variable.
4178 (java_complete_expand_methods): Set current_this when appropriate.
4179 (resolve_expression_name): Build correct static and non static
4180 field access bearing a simple name.
4181 (resolve_field_access): Resolve the length field of arrays. Handle
4183 (patch_method_invocation_stmt): Set the type of the method
4184 invocation to error_mark_node. This value is later overridden by a
4185 valid type, if any. Don't handle qualified constructor invocation
4186 as qualified method invocation. Call lookup_method_invoke with its
4187 new flag. It's no longer necessary to access the selected method
4188 as the value of a tree list. Handle constructor invocation.
4189 (patch_invoke): Reverse argument list when invoking non interface
4190 methods. Insert call to new as the first argument of the
4192 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
4193 defined within a final class. Return INVOKE_STATIC if the invoked
4194 method is a constructor.
4195 (lookup_method_invoke): New lc argument is a flag to indicate a
4196 constructor lookup. Now handle constructor lookup. Choose the most
4197 specific method in case several were matching the invocation
4198 requirements. Return a method decl instead of a tree list featuring
4199 one single method decl element.
4200 (refine_accessible_methods_list): New lc flag argument to
4201 indicate that a constructor is being looked up.
4202 (not_initialized_as_it_should_p): New function.
4203 (java_complete_tree): Now process fake tree codes
4204 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
4205 save_expr on resolved function call arguments. Case on
4206 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
4207 (patch_assignment): LHS can be a field access expression. When
4208 dealing with reference, lhs_type is the promoted type of the
4209 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
4211 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
4212 (patch_binop): Use not_initialized_as_it_should_p where
4214 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
4215 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
4217 (resolve_type_during_patch): New function.
4218 (patch_cast): Call resolve_type_during_patch to resolve type and
4219 report error accordingly.
4220 (patch_array_ref): Use not_initialized_as_it_should_p where
4221 applicable. Array base expression is saved before being
4222 used. Promote the type of an array elements if it contains non
4224 (build_newarray_node, patch_newarray, build_this): New functions.
4226 Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
4228 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
4229 increment it in `for' statement.
4230 (print_field_info): If number is inf or nan, don't print it.
4231 (print_method_info): If method name is `delete', just ignore it.
4232 (print_c_decl): Special-case jstringArray.
4234 * gjavah.c (help): New function.
4235 (no_argument): New function.
4236 (usage): Changed text.
4237 (main): Rewrote argument handling. Now handles -v, --help,
4239 (version): New function.
4240 (found_error): New global.
4241 (main): Return found_error.
4242 (generate_access): Set found_error.
4243 (print_c_decl): Likewise.
4245 Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
4247 * gjavah.c (print_c_decl): Don't print "," when examining field.
4248 Skip type name when looking at "[L" types.
4249 (process_file): Now static.
4250 (generate_access): Now returns int.
4251 (last_access_generated): New global.
4252 (process_file): Clear last_access_generated; make multiple passes
4254 (print_field_info): Just return if generate_access returns true.
4255 (print_method_info): Likewise. Also, allow <init> functions to
4257 (print_c_decl): Added is_init argument. Print constructors
4259 (print_cxx_classname): Use UTF8_GET to extract characters from
4261 (print_base_classname): New function.
4262 (print_class_decls): New function.
4263 (process_file): Use it.
4264 (utf8_cmp): New function.
4266 Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
4268 * lang-options.h: Format changed to match changes in gcc/toplev.c
4269 to implement a --help option.
4271 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
4273 * decl.c (init_decl_processing): Revert change to dtable_type.
4275 Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
4277 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
4279 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
4281 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
4283 * lang.c (lang_init): Default flag_exceptions to 1, without
4284 checking to see if it's 2 first.
4286 Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
4288 * constants.c: Include "system.h".
4290 * lang.c (flag_new_exceptions): Get via extern now.
4291 (lang_init_options): New functions. Turn on flag_new_exceptions.
4293 Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4295 * lex.c (java_lex): Return 0 when we see an invalid character in
4298 * lex.c (java_read_char): Specify extra argument when calling
4300 (java_read_unicode, java_parse_end_comment,
4301 java_parse_escape_sequence): Likewise,
4302 (java_lex): Specify extra argument when calling
4303 java_lex_error. Test that IDs are beginning with a legal character
4304 for IDs. Handle invalid characters with an error message and a
4305 call to java_lex_error.
4306 (java_lex_error): Adjust column position by new argument
4307 `forward'. Issue an error even if in the middle of reporting an
4310 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
4312 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
4313 we don't explicitly put a null pointer when we're copying it.
4315 Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
4317 * gjavah.c (print_cxx_classname): New function.
4318 (super_class_name): Likewise.
4319 (print_super_fields): Removed.
4320 (in_super): Removed.
4321 (print_field_info): Never generate #defines.
4322 (print_c_decl): Changed generated types to match JNI. No longer
4323 print class name before method name.
4324 (print_method_info): Print "static" before static methods.
4325 Print "virtual" before non-final methods.
4326 (usage): Use exit(1), not exit(-1).
4328 (print_field_info): Use %.17g to print a double.
4329 (last_access): New globals.
4330 (process_file): Initialize last_access.
4331 (usage): Now static.
4332 (ACC_VISIBILITY): New define.
4333 (generate_access): New function.
4334 (print_field_info): Call it.
4335 (print_method_info): Likewise. Also, generate information for all
4336 methods, not just native methods. Return void.
4337 (print_c_decl): Return void.
4338 (print_field_info): Return void.
4340 Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4342 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
4343 processing the jc1 grammar file. Prefix bison functions and
4344 variables with java_.
4345 (parse.c): Dependencies on parse.h and lex.h
4346 * expr.c (build_java_arrayaccess): Function now global.
4347 * java-tree.h: Comment reorganized to carry on previous
4348 classification effort.
4349 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
4350 RESOLVE_TYPE_NAME_P): New flags on WFLs.
4351 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
4352 java_parse (new prefix java_ generated by bison).
4353 (java_layout_parsed_class, java_register_parsed_class): Function
4355 (yyparse): Removed unnecessary call to init_outgoing_cpool.
4356 * lex.c (static tree wfl_op): Variable deleted.
4357 (java_init_lex): Initialize kw_super and kw_this. Initialize more
4358 ctxp fields to NULL_TREE.
4359 (java_lex): No longer create WFL for operators. Filename caching
4360 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
4361 created as STRING_CST and later expanded. Removed extra argument
4362 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
4364 (build_wfl_node): Removed code in comments.
4365 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
4366 store token and location data in the current bison token.
4367 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
4368 static/extern function declaration at the beginning of the file.
4369 (struct qualification): Data structure definition deleted.
4370 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
4371 (qualify_ambiguous_name): Function declaration modified. Function
4372 now returns nothing.
4373 (build_array_ref, patch_array_ref, make_qualified_name,
4374 resolve_qualified_expression_name, maybe_generate_clinit,
4375 resolve_field_access): New static function declarations.
4376 (build_java_arrayaccess): New extern function declaration.
4377 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
4378 (CALL_EXPR_PRIMARY): Macro deleted.
4379 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
4380 (struct parser_ctxt): Field initialized_final
4381 removed. non_static_initialized, static_initialized: New fields.
4382 * parse.y (static tree kw_super, static tree kw_this): New global
4384 (%union): tree wfl field of operator member replaced by int
4385 location. WFLs are non longer created for operators.
4386 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
4387 (qualified_name:): Now calls make_qualified_name to build the
4389 (type_declaration:): Consider generating <clinit> when class
4391 (variable_declarator:): Directly build an assignment node when the
4392 variable is initialized when declared.
4393 (this_or_super:): Build a WFL and set current location when THIS
4394 or SUPER are parsed.
4395 (expression_statement:): Wrap statement around a WFL.
4396 (primary_no_new_array:): Fixed typo. Changed value returned by
4397 THIS_TK because of its new type (temporary).
4398 (dim_exprs:): Temporary fix because of OSB_TK's new type.
4399 (field_access:): Build qualified name with SUPER.
4400 (method_invocation:): Fixed returned value because of SUPER's new
4402 (array_access:): Use OSB_TK location information.
4403 (post_increment_expression:, post_decrement_expression:,
4404 unary_expression:, pre_increment_expression:,
4405 pre_decrement_expression:, unary_expression_not_plus_minus:,
4406 cast_expression:, multiplicative_expression:,
4407 additive_expression:, shift_expression:, relational_expression:,
4408 equality_expression:, and_expression:, exclusive_or_expression:,
4409 inclusive_or_expression:, conditional_and_expression:,
4410 conditional_or_expression:, assignment:): Use new location/token
4411 information available on operators.
4412 (create_class): Set super_decl_type to NULL_TREE when processing
4414 (register_fields): Field initialization is now a MODIFY_EXPR
4415 node. Chain initialization code to the matching lists (according
4416 the the field declaration modifiers).
4417 (maybe_generate_clinit): New function.
4418 (method_header): Don't set method's DECL_NAME to a WFL when adding
4419 methods to java.lang.Object.
4420 (resolve_and_layout): Now can return NULL_TREE if the type
4421 resolution fails. Otherwise, return the class DECL instead of its
4423 (check_method_redefinition): Don't patch method DECL_NAME if it
4424 belongs to java.lang.Object.
4425 (process_imports): Simply assign error_found to the value returned
4426 by check_pkg_class_access.
4427 (declare_local_variables): Don't use their init statements (if
4428 any) when parsing error were previously found. Reuse MODIFY_EXPR
4429 build during parsing as an init statement.
4430 (java_method_add_stmt): Now return the current method body.
4431 (java_layout_parsed_class, java_register_parsed_class): Functions
4433 (java_complete_expand_methods): Initialize the constant pool on a
4434 per class basis. Layout the classes before expanding their method
4435 bodies. Don't try expand artificial constructor code if error were
4436 found. Make the classes data and register them if no error were
4438 (java_complete_expand_method): Retrieve an artificial constructor
4439 argument list before entering its body. Assign the top block to
4440 the artificial constructor function body and set types of declared
4441 blocks and compound statements to void. Walk method body if not an
4442 artificial constructor.
4443 (make_qualified_name, cut_identifier_in_qualified): New functions.
4444 (resolve_expression_name): Fixed comments. Save/restore the
4445 current class CLASS_LOADED_P flag value. Build non qualified
4446 static field access and handle qualified expression names.
4447 (resolve_field_access, resolve_qualified_expression_name): New
4449 (patch_method_invocation_stmt): Use the new expression resolution
4450 scheme, calling resolve_field_access when the function call is
4451 resolved as an expression.
4452 (qualify_ambiguous_name): Function rewritten to work on qualified
4453 expression produced by make_qualified_name.
4454 (java_complete_tree): Promote type when function's argument are
4455 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
4456 the assignment to discover further errors if RHS is a expression
4457 name that fails to evaluate. Declare LHS initialized even though
4458 the assignment failed. Don't use the location variable and removed
4459 extra argument in patch function calls. Now handle the ARRAY_REF
4460 case and build internal string representation when STRING_CSTs are
4462 (build_method_invocation): Don't wrap function call around a WFL.
4463 (build_assignment): Likewise. Use the operator location
4465 (patch_assignment): Handle array access LHSs. Handle error
4466 provenance, resulting in a better error report.
4467 (build_binop): Use op_location from operator as binop location
4469 (build_unaryop, build_incdec, build_cast): Likewise.
4470 (patch_binop): Extract location information from the node. Fixed
4471 typo in error message.
4472 (patch_unary_op): Extract location information from the node.
4473 (build_array_ref, patch_array_ref): New functions.
4475 Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
4477 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
4478 match _Jv_IsInstanceOf.
4479 * decl.c (init_decl_processing): Use _Jv_NewArray, not
4480 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
4482 Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
4484 * decl.c (init_decl_processing): Functions are now named
4485 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
4487 Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
4489 * java-tree.h (load_class): Add prototype.
4490 * class.c (is_compiled_class): Add missing arg to load_class.
4491 * expr.c (expand_java_NEW): Call load_class.
4492 * parse.y (process_import): Removed bogus use of void return value.
4494 Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
4496 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
4497 Function name is "_Jv_Throw" instead of "soft_athrow".
4498 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
4499 Function name is "_Jv_AllocObject" instead of "soft_new".
4500 Takes an extra parameter (object size).
4501 * expr.c: Update calls.
4503 Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
4505 * lex.c (java_get_line_col): Handle end-of-file.
4506 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
4508 Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
4510 * lang.c (lang_init): Make -fexceptions the default.
4511 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
4512 exception handling is not turned on.
4514 Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
4516 * lang.c (flag_new_exceptions): Make this this default.
4517 * decl.c (end_java_method): Call emit_handlers.
4518 * except.c (method_init_exceptions): Set language code and version.
4519 (expand_start_java_handler): Enable exception, and call
4520 expand_eh_region_start.
4521 (expand_end_java_handler): Enable exception, and set up catch blocks.
4522 (emit_handlers): New routine to generate the saved handlers.
4523 * java-except.h (emit_handlers): Add prototype.
4525 Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
4527 We used to have three different representations of the constant pool:
4528 the CPool structure, the tree_constant_pool, and the constructures
4529 used to build the Class object (which may need class and string
4530 constants) in compiled code. None were appropriate for compiling
4531 to .class files, so I did a major overhaul.
4533 First, the tree_constant_pool array was removed. Things were
4534 modified to the CPool structure in the JCF could be used.
4535 Second, a "capacity" field was added to the CPool, and functions
4536 written to search for a matching constant, adding one if not found.
4537 The code that generated the Class object was changed to use a CPool.
4538 The actual TREE_LISTs used to build the CONSTRUCTORs used for
4539 the static Class object are now only in build_constants_constructor.
4540 Finally, I wrote code which can generate a .class file (including its
4541 constant pool) from the RECORD_TYPE of a class. This is a big step
4542 on the way to compiling Java source into .class files.
4544 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
4545 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
4547 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
4548 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
4549 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
4550 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
4551 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
4552 (lang_type): Removed constant_pool field.
4553 * jcf.h (CPool): Renamed size to count. Added field capacity.
4554 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
4555 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
4556 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
4558 * constants.c (current_constant_pool_tags, current_constant_pool_data,
4559 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
4560 * constants.c (build_constants_constructor): Use new outgoing_cpool.
4561 (set_constant_entry, find_constant1, find_constant2,
4562 find_class_constant, count_constant_pool_bytes, write_constant_pool,
4563 find_utf8_constant, find_class_or_string_constant): New functions.
4565 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
4566 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
4567 (give_name_to_class, get_class_constant): Likewise.
4568 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
4569 (get_name_and_type_constant, get_ref_constant): Removed.
4570 * parse.h (parser_ctxt): Remove field tree_constant_pool.
4571 * parse.y: Don't save/restore tree_constant_pool.
4572 * verify.c (verify_jvm_instructions): Update for new approach.
4573 * expr.c (expand_invoke, expand_java_field_op): Likewise.
4575 * lang-options.h: Added -femit-class-file, -femit-class-files.
4576 * lang.c (flag_emit_class_files), java-tree.h: New flag.
4577 (lang_f_options): Added "emit-class-file(s)".
4579 * expr.c (build_java_arrayaccess): Generate more efficient array
4580 bounds checking, by using unsigned compare.
4582 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
4584 Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4586 * parse.h: New comment on the handling of unresolved type
4587 identifiers. JDEPs are now part of the jdep_code enum.
4588 (typedef struct jdep): Now use enum jdep_code or int, depending on
4589 availability. Both are narrowed down to an 8 bits bitfield.
4590 (CALL_EXPR_PRIMARY): Fixed comment.
4592 Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
4594 * Make-lang.in (java): Added gjavac and jvgenmain.
4595 (java.start.encap): Depend on gjavac.
4596 (java.rest.encap): Depend on jvgenmain.
4598 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
4599 (JAVA_CROSS_NAME): Likewise.
4600 (java.all.build): Depend on jvgenmain and gjavac.
4601 (java.all.cross): Depend on jvgenmain and gjavac-cross.
4602 (jvgenmain$(exeext)): New target.
4603 (java.install-common): Wrote.
4604 * config-lang.in (compilers, stagestuff): Added gjavac and
4607 Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
4609 * lang.c (lang_decode_option): New argc/argv interface.
4611 Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4613 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
4614 * decl.c (build_decl_no_layout): New function.
4615 * expr.c (java_lang_expand_expr): Layout declarations found in
4616 blocks before they're pushed.
4617 * jcf-parse.c (load_class): Save current line when parsing class
4619 (parse_source_file): Register class before expanding their
4621 * lang.c (put_decl_node): Produce `null' when `void *' is
4623 * lex.c (static tree wfl_op): New static global, for error report
4625 (java_init_lex): wfl_operator and wfl_op initialized
4626 here. Filename caching added for wfl_op. Return wfl_op when `(' is
4628 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
4629 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
4630 build_unresolved_array_type): New static function definitions.
4631 (build_decl_no_layout): New extern function declared.
4632 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
4633 faulty modifier exists.
4634 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
4635 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
4636 (UNARY_PLUS_EXPR): New fake operator.
4637 (struct parser_ctxt): New field osb_number.
4638 * parse.y (static tree wfl_operator): New static WFL for operator
4639 bound error messages.
4640 (DECR_TK, INCR_TK): Moved.
4641 (OP_TK): Tagged <operator>.
4642 (array_type:): Now call build_unresolved_array_type.
4643 (dim_expr:): Count the number of '[' seen.
4644 (post_increment_expression, post_decrement_expression,
4645 pre_increment_expression, pre_decrement_expression,
4646 unary_expression_not_plus_minus, unary_expression:): Actions are
4647 now building the corresponding unary expressions.
4648 (cast_expression:): Actions are now building cast expressions.
4649 (build_unresolved_array_type): New function.
4650 (create_interface): Reset the number of declared interfaces.
4651 (create_class): Likewise.
4652 (method_header): Methods declared within the scope of an interface
4653 are now implicitly set public and abstract.
4654 (java_complete_class): Variable's and parameter's type are patched
4655 with a promoted type.
4656 (declare_local_variables): Resolved non builtin types are promoted
4657 before being used to build a variable decl. Removed type patch
4658 posted on variable initialization statement.
4659 (source_start_java_method): Use build_decl_no_layout to build the
4660 decl of a parameter of incomplete type.
4661 (java_register_parsed_class): Process interfaces too. Call
4662 rest_of_decl_compilation on each processed class declarations.
4663 (java_complete_expand_methods): Don't attempt to expand things in
4665 (java_complete_tree): Process CONVERT_EXPR, even though it always
4666 has a type. Propagate error_mark_node to node's type too. Promote
4667 method's call argument type and return error_mark_node if
4668 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
4669 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
4670 handle unary operator nodes.
4671 (build_assignment): Added comment.
4672 (print_int_node): New function.
4673 (patch_assignment): New second argument. New error handling. Use
4674 print_int_node. Handle references. Use can_cast_to_p to issue
4675 different error message according to the context and check upon
4676 the initialization of the RHS.
4677 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
4678 (operator_string): Handle more operators.
4679 (patch_binop): No longer use a function static
4680 wfl_operator. Improved error message on shift distance.
4681 (build_unaryop, build_incdec, build_cast, patch_unaryop,
4682 patch_cast): New functions.
4684 Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
4686 * jvspec.c: New file.
4687 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
4689 * java-tree.h (identifier_subst): Add declaration.
4691 Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
4693 * jvgenmain.c (main): Generate call to JvRunMain.
4695 * class.c (make_class_data): Push value for "sync_info" field.
4696 * decl.c (init_decl_processing): Push "sync_info" field.
4698 Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
4700 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
4701 Java (source) name, not signature.
4702 Set TYPE_ALIGN to (at least) that of element_type.
4704 Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
4706 * class.c: Moved classname-mangling-rekated code to ...
4707 * mangle.c: ... this new file.
4708 * jvgenmain.c: New program (needs mangle.c) to generate main program.
4709 * Makefile.in: Update for above changes.
4711 Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4713 * expr.c (truthvalue_conversion): Convert integer and floating
4714 point value to their truth value.
4715 * lex.c (java_lex): Handle the `null' literal.
4716 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
4717 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
4718 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
4721 * parse.y: Reorganization/documentation on token declaration.
4722 (binop_lookup[]): New added new tree codes.
4723 (relational_expression): Build corresponding binary operators.
4724 (equality_expression, conditional_and_expression,
4725 conditional_or_expression): Likewise.
4726 (java_complete_class): Fix crash in debug message.
4727 (java_complete_tree): Check initialization of method call
4728 arguments. Further bogus node evaluation to detect more error
4729 during assignments. Handles more binary operators.
4730 (patch_assignment): Use DECL_P.
4731 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
4733 (operator_string): Handle more case. Compacted source.
4734 (patch_binop): Changed function comment. Checking for
4735 uninitialized first operand takes the compound assignment into
4736 account and uses DECL_P. Checking for uninitialized second operand
4737 delayed to routine's end. Use macros to issue type bound error
4738 messages and issue messages on both operands if their types are
4739 different. Force fixed type into node. Handle all binary
4742 Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4744 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
4745 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
4746 build operator node and return tokens.
4747 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
4748 * parse.h (java_complete_tree): Changed returned type in prototype.
4749 (build_method_invocation, build_assignment, patch_assignment,
4750 patch_binop): New static function declarations.
4751 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
4752 BUILD_EXPR_WFL): New macros.
4753 * parse.y (enum tree_code binop_lookup[]): New static for token to
4755 (%union): Parser union has new sub-structure `operator'.
4756 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
4757 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
4758 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
4759 ASSIGN_ANY_TK): Tokens tagged `operator'.
4760 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
4761 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
4762 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
4763 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
4764 (assignment_operator:): Rule tagged `operator'.
4765 (expression_statement:): Re-installed default rule.
4766 (method_invocation:): Sub rules call build_method_invocation.
4767 (postfix_expression:): Don't attempt to resolve name here. Just
4769 (multiplicative_expression:): Sub-rules build corresponding binop
4771 (additive_expression:, shift_expression:, and_expression:,
4772 exclusive_or_expression:, inclusive_or_expression:): Likewise.
4773 (assignment:): Sub rule invoke build_assignment.
4774 (assignment_operator:): Default rules on sub rules.
4775 (force_error): Added documentation on this variable.
4776 (declare_local_variables): Build initialization calling
4778 (expand_start_java_method): Removed unused rtx declaration. Mark
4779 arguments as already initialized.
4780 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
4781 (java_complete_expand_methods): Don't process next method if
4782 completion of the previous one triggered errors.
4783 (java_complete_expand_method): Call source_end_java_method if no
4784 error were found during completion.
4785 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
4786 locals declaratilon. Handle names found within a class. Return
4787 error_mark_node when things aren't found.
4788 (patch_method_invocation_stmt): Return error_mark_node on failures.
4789 (patch_invoke): Removed unused local. Return the correct node.
4790 (java_complete_tree): Now returns a value. The BLOCK section binds
4791 local identifiers and the type of a BLOCK is now void. Assign the
4792 result of operand completion on COMPOUND_EXPR. Assign the
4793 encapsulated node of a WFL to the result of its completion, except
4794 when the node is an identifier. Now handle MODIFY_EXPR and several
4795 binary operators. Return error_mark_node on errors.
4796 (build_method_invocation, build_assignment, patch_assignment,
4797 build_binop, operator_string, patch_binop): New functions.
4798 * typeck.c (binary_numeric_promotion): New function.
4800 Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
4802 * class.c (identifier_subst): New convenience wrapper for ident_subst.
4803 Replace most uses of ident_subst by identifier_subst.
4805 * class.c (push_class_static_dummy_field): Removed function.
4806 (build_class_ref): Find Class object decl by looking up "CNAME.class",
4807 instead of looking got "class" static field. Create that decl here.
4808 (class_identifier_node): Removed; no longer needed.
4809 (init_class_processing): Don't init class_identifier_node.
4810 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
4811 Do nreverse 0 times (instead of twice) for Object and Class.
4812 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
4814 Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
4816 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
4817 while initializing linenumber_count and linenumber_table.
4818 Do it before init_function_start (which calls emit_line_note).
4819 * expr.c (expand_byte_code): Don't need to clear lineno here.
4821 Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
4823 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
4824 then mangle number as _N_.
4826 * class.c (mangle_class_field): New function.
4827 (build_class_ref): Set assembler name of class reference using
4829 (push_class_static_dummy_field): Likewise.
4831 Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
4833 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
4834 of assigning to TREE_CODE. The latter method exploits a feature
4835 of GCC that is not ANSI compliant.
4837 Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4839 * decl.c (pushdecl_force_head): New function.
4840 (pushlevel): Removed conditional printf.
4841 (complete_start_java_method): Don't enter local variable scope if
4842 function is compiled from source code.
4843 * expr.c: parse.h now included
4844 (java_lang_expand_expr): New function.
4845 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
4846 printf. Terminate buffer when doing directories.
4847 * jcf-parse.c (parse_source_file): Call lang_init_source before
4848 parsing and before code generation.
4849 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
4850 use printf if the macro is defined.
4851 * lang.c (lang_init): Install lang_expand_expr hook on
4852 java_lang_expand_expr.
4853 (java_dummy_print): New function.
4854 (lang_init_source): New function.
4855 * lex.c (java_lex): Remember location of an opening brace at the
4856 second nesting level.
4857 (java_is_eol): Unget character seen after a CR if it is EOF.
4858 * parse.h: Now includes lex.h
4859 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
4860 printf if the macro is defined.
4861 (expand_start_java_method, build_expr_block, enter_block,
4862 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
4863 New static function declarations.
4864 (pushdecl_force_head): New extern function declaration.
4865 (INCOMPLETE_TYPE_P): New macro.
4866 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
4867 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
4868 BLOCK_EXPR_ORIGIN): New macros.
4869 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
4870 DECL_SOURCE_LINE_LAST): New macros.
4871 (struct parser_ctxt): Removed field current_method_decl, redundant
4872 with the field current_function_decl. Added fields
4873 first_ccb_indent1 and pending_block.
4874 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
4875 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
4877 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
4878 (compilation_unit:): Cosmetic on sub rule.
4879 (type_declaration:): Cosmetic on sub rules. Added an error rule.
4880 (variable_initializer:): Installed default rule on expression:.
4881 (method_declaration:): method_header: starts a new
4882 method. method_body: installs the function body, absorbs blocks
4883 emitted for temporary variable scopings, pops function's body block
4884 and merges function's last statement lineno in DECL_SOURCE_LINE.
4885 (method_body:): Installed default rules.
4886 (block:): Call enter_block when an opening brace is seen. Absorb
4887 scoping blocks and call exit_block when a closing brace is seen.
4888 (block_statement:): Cosmetic changes.
4889 (method_invocation:): Create WFL around CALL_EXPR node.
4890 (patch_stage): Added comment around definition.
4891 (method_header): Try to use first_ccb_indent1 as the first line of
4892 the method, so BP debug info are emitted at the first opening
4893 brace of the function. If the function has no body, use the
4894 location of the function's name. Override currently defined method
4895 name with the matching WFL so we can point redefinition errors
4896 using the location where the function's name was declared.
4897 (check_abstract_method_header): Interprets DECL_NAME as an
4898 identifier or as a WFL, accordingly.
4899 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
4900 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
4901 location and name information out of it and reinstall DECL_NAME to
4902 its original identifier node value.
4903 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
4904 function's source code).
4905 (read_import_dir): Test the value returned by find_class and issue
4906 a fatal accordingly.
4907 (declare_local_variables): Push a new block for the scope of the
4908 new variable(s) if code has been already generated at that nesting
4909 level. Pinpoint redefinition errors using the variable id
4910 WFLs. Generate initialization code if necessary. If the variable
4911 type is incomplete, register a patch on its decl.
4912 (source_start_java_method): Rewritten. Define a new block for the
4913 function's parameters. Build parameter decl out of function's
4914 arguments and register them for a patch if their types are
4916 (expand_start_java_method): Includes the part of
4917 source_start_java_method that was pushing the parameter decls and
4918 completing the method start code.
4919 (source_end_java_method): Removed call the expand_end_bindings and
4920 poplevel (already taken care of). Reinstall function's arguments
4921 and get function's last line of code before calling
4922 expand_function_end.
4923 (java_method_add_stmt): New comment before the function's
4924 code. Complement the second operand of the current COMPOUND_EXPR
4926 (java_complete_expand_methods): Don't generate debug info on line
4927 zero when expanding a generated constructor.
4928 (java_complete_expand_method): Set start and end line numbers for
4929 a artificially generated constructor to one and manually call
4930 enter_block and exit_block when defining it. For all methods:
4931 expand function's start calling the new expand_start_java_method
4932 and invoke java_complete_tree on the effective method's body, if
4934 (resolve_expression_name): Now use lookup_name_in_blocks to search
4935 local variable decls and print out an error when variables are
4937 (patch_method_invocation_stmt): Inserted comment before the
4939 (lookup_method_invoke): Chain method's arguments using chainon
4940 with the current arg list as a second argument. Inserted missing
4941 IDENTIFIER_POINTER when reporting an error on methods not found.
4942 (refine_accessible_methods_list): Don't retain constructors.
4943 (patch_arguments): Function removed.
4944 (java_complete_tree): Inserted comment before the function's
4945 code. New case for BLOCKs. Moved the WFL case a bit
4946 further. Complete function's arguments.
4947 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
4948 maybe_absorb_scoping_blocks): New functions.
4950 Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4952 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
4954 * jcf-parse.c (parse_source_file, java_error_count): New forward
4955 and extern declarations.
4956 (java_parse_abort_on_error): Macro moved.
4957 (jcf_parse_source): fatal called if fopen fails. Now calls
4959 (parse_source_file): New parse_only parameter. Reflects the
4960 elimination of the second pass.
4961 (yyparse): parse_source_file called with argument set to 0.
4962 * jcf.h (JCF_ZERO): Sets java_source to zero.
4963 * lex.c (java_init_lex): pass argument is gone. Function modified
4964 to be called once during the analysis of a file.
4965 (java_unget_unicode): Fixed typo in fatal message.
4966 (java_get_line_col): Likewise.
4967 (java_lval): Likewise. String literals no longer built during
4969 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
4971 * parse.h (MODIFIER_WFL): New macro.
4972 (parse_check_super, parser_check_super_interface): Now return int.
4973 (parser_chain_incomplete_item, not_builtin_p,
4974 complete_method_decl): Declarations removed.
4975 (build_method_invocation_stmt, build_invoke): Renamed using the
4976 `patch' instead of `build'
4977 (register-incomplete_type, obtain_incomplete_type,
4978 java_complete_tree, java_complete_expand_method,
4979 unresolved_type_p, create_jdep_list): New function declarations.
4980 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
4981 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
4982 (jdep): New typedef on new struct _jdep.
4983 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
4984 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
4985 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
4986 JDEP_RESOLVED_P): New macros.
4987 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
4988 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
4989 JDEP_VARIABLE): New enum values and jdep kinds.
4990 (jdeplist): New typedef on struct _jdeplist.
4991 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
4993 (CALL_EXPR_PRIMARY): New macro.
4994 (struct parser_ctxt): Fields java_pass, current_method_decl,
4995 method_decl_list deleted. New field jdeplist.
4996 (INCOMPLETE_P): Macro deleted.
4997 * parse.y (single_type_import_declaration:): Removed pass switch.
4998 (type_import_on_demand_declaration): Likewise.
4999 (field_declaration:): Removed pass switch on all sub rules.
5000 (class_declaration:): Call the complete_class_decl removed on
5002 (method_declaration:): Removed second pass switch. No longer chain
5003 methods decl when method_header reduced.
5004 (method_header:): Sub rules no longer depend on pass switch.
5005 (method_declarator:): Likewise.
5006 (method_body:): Likewise.
5007 (abstract_method_declaration:): Likewise.
5008 (block_statement:): Likewise.
5009 (local_variable_declaration:): Likewise.
5010 (argument_list:): Likewise.
5011 (method_invocation:): Likewise. Call to build_method_invocation_stmt
5012 removed. Partial CLASS_EXPR tree node built instead.
5013 (postfix_expression:): Removed pass switch on all sub rules.
5014 (java_pop_parser_context): Free classd_list content.
5015 (yyerror): Call obstrack_grow0 to finalize error message.
5016 (check_class_interface_creation): Comment modified to reflect new
5017 returned value meaning. Removed second pass switch. Return 1 if an
5018 error was found, 0 otherwise. Adjust pointer on filename if a
5019 leading path separator was found.
5020 (maybe_create_class_interface_decl): Removed first pass switch
5021 when linking the class decl to the class_list. Install a new
5022 jdep_list for the class.
5023 (add_superinterfaces): List of unresolved interfaces is
5024 gone. Unresolved interfaces are directly added to the current
5026 (create_interface): Second pass shortcut removed.
5027 ctpx->modifier_ctx access through MODIFIER_WFL.
5028 (create_class): Second pass shortcut removed. Call to
5029 register_incomplete_type replaces the call to
5030 parser_chain_incomplete_item.
5031 (complete_class_decl): Function removed.
5032 (duplicate_declaration_error): New way of retrieving redeclared
5034 (register_fields): Call to lookup_modifier_cl replaced by
5035 MODIFIER_WFL. New way of handling unresolved type, using
5036 unresolved_type_p and obtain_incomplete_type.
5037 register_incomplete_type replaces call to parser_chain_incomplete_item.
5038 (patch_stage): New static global variable.
5039 (method_header): New way of handling unresolved type, using
5040 unresolved_type_p and obtain_incomplete_type. patch_stage used to
5041 indicates that the method decl needs to be patched.
5042 (check_abstract_method_header): Call to lookup_modifier_cl
5043 replaced by MODIFIER_WFL.
5044 (method_declarator): Incomplete argument type are registered
5045 calling register_incomplete_type. Patch on the declared method is
5046 issued in that case.
5047 (unresolved_type_p): New function.
5048 (parser_check_super_interface): New comment to reflect function's
5049 modified returned type (int). Function and has a new argument
5050 this_wfl. Call to parse_error_context uses this_wfl instead of
5051 relying on lookup_cl.
5052 (parser_check_super): Comment reflects function's new returned
5053 type (int). Function returns non zero value on error.
5054 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
5055 register_incomplete_type, jdep_resolve_class): New functions to
5056 handle incomplete types in declarations.
5057 (java_complete_class): Rewritten to work with the new incomplete
5058 type handling scheme.
5059 (complete_class_report_errors): Likewise.
5060 (complete_method_decl): Removed: it jobs is now handled by
5061 java_complete_class.
5062 (do_resolve_class): Class loaded in not already loaded and not
5063 found in Java source code.
5064 (java_check_regular_methods, java_check_abstract_methods): Don't
5065 call complete_method_decl anymore.
5066 (lookup_modifier_cl, not_builtin_p): Functions deleted.
5067 (read_import_dir): Got rid of the pass number dependency.
5068 (declare_local_variables): New handling of unresolved types (patch
5070 (source_start_java_method): New parameter level. Function called
5071 with level set to 1 when argument types are potentially
5072 unresolved. Called to complete the job with level set to 2 once
5074 (source_end_java_method): Call to permanent_allocation
5075 removed. Waiting to be replaced by a more suitable obstack
5077 (java_complete_expand_methods, java_complete_expand_method,
5078 java_expand_finals): New functions.
5079 (build_method_invocation_stmt): Renamed
5080 patch_method_invocation_stmt. Extracts function call expression
5081 (wfl) and arguments (args) from CALL_EXPR tree operands.
5082 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
5083 call. Patch the function and argument operand of the CALL_EXPR
5085 (patch_argument, java_complete_tree): New functions.
5087 Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
5089 Recover from missing fields and methods (i.e. error instead of fatal).
5090 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
5091 * expr.c (expand_invoke): Recover from missing method.
5092 (expand_java_field_op): Recover from missing field.
5093 Inline references to java.lang.{Integer,Char,...}.TYPE.
5094 * typeck.c (get_type_from_signature), java-tree.h: New function.
5095 * class.c (add_method): Use get_type_from_signature.
5096 (build_class_ref): Handle a class that was not found.
5097 * typeck.c (convert): Handle conversion to pointers (for convenience).
5098 * verify.c (verify_jvm_instructions): Use get_type_from_signature
5099 instead of lookup_field to handle missing fields.
5101 * jcf-parse.c (process_zip_dir): Set java_source.
5103 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
5105 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
5107 Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5109 * jcf-parse.c (load_class): Don't change input_filename before
5110 calling jcf_parse_source (but still do it before calling
5112 (jcf_parse_source): Assign input_filename after having saved the
5114 * lex.c (java_init_lex): Chain a WFL node to the import on demand
5115 list. ctxp->modifier_ctx zeroed according to its new
5116 definition. ctxp->filename initialized. Removed
5117 JAVA_MODIFIER_CTX_UNMARK.
5118 (java_unget_unicode): Update the character based column position.
5119 (java_allocate_new_line): ref_count not used anymore. Always free
5120 ctxp->p_line. Initialize c_line->char_col to 0.
5121 (java_get_unicode): Update the character based column position.
5122 (java_lex): Use ctxp->elc to store current position in source
5123 file, at the beginning of the parsed token. Set modifier_ctx entry
5124 corresponding to the parse modifier to a WFL node. Return a WFL
5125 node when an identifier is parsed.
5126 (java_lex_error): Now uses ctxp->elc to store current position in
5128 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
5129 * lex.h (build_wfl_node): New function definitions.
5130 (struct java_line): ref_count and next fields are gone. New field
5132 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
5133 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
5134 (JAVA_COLUMN_DELTA): New macro.
5135 (java_lc): New typedef on new struct _java_lc.
5136 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
5137 (parse_error_context, parse_warning_context): Changed prototypes.
5138 (java_get_line_col): Added as an available global function.
5139 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
5140 (IC_DECL): Replaced by macro IC_TYPE
5141 (DEPEND_WFL): New macro.
5142 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
5144 (exit_java_complete_class): Removed a commented out statement.
5145 (struct parser_ctxt): Added comments on fields. modifier_ctx is
5146 now an array of tree nodes. Deleted fields line_list and
5147 e_line. New field elc, to replace e_line.
5148 * parse.y (array_type:): Build WFL node.
5149 (qualified_name:): Build a single WFL node out of two. Retain
5150 the location information of the first node in the resulting node.
5151 (package_declaration:): Use package name as a WFL node
5152 (single_type_import_declaration:): Use imported name as a WFL node.
5153 (type_import_on_demand_declaration:): Use root of the imported
5154 packages as a WFL node.
5155 (field_declaration:): Removed unused local variable cl.
5156 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
5157 (yyerror): New static elc. Removed static error_line, error_pos.
5158 New local code_from_source. Save ctxp->elc into elc at the first
5159 pass. Call java_get_line_col to get a string of the line where
5161 (debug_line): Removed static function.
5162 (parse_error_context, parse_warning_context): Parameter cl is now
5163 a WFL node. Use its value to initialize ctxp->elc.
5164 (redefinition_error): Parameter cl is now a WFL node.
5165 (parse_add_interface): New parameter wfl. No longer call
5166 lookup_cl, use wfl instead.
5167 (check_class_interface_creation): Parameter cl is now a WFL node.
5168 (maybe_create_class_interface_decl): Likewise.
5169 (add_superinterfaces): New function.
5170 (create_interface): Removed local cl, node, super_decl,
5171 super_decl_type. Function now uses id as a WFL node. Better
5172 warning/error report on obsolete or forbidden mix of
5173 modifiers. Now calls add_superinterfaces to register interfaces.
5174 (create_class): Removed local cl, node. Local variable id is used
5175 as a WFL node. Better error report on forbidden modifier
5176 mix. Uses add_superinterfaces to register interfaces.
5177 (find_field): Argument cl is now a WFL node. Now store the WFL
5178 node of a fields that needs to be checked for their
5180 (method_header): Local variable node non longer used. Local
5181 variable id replaces cl.
5182 (check_modifiers_consistency): Local variable cl is now a WFL
5184 (method_declarator): Local variable cl replaced by parameter id.
5185 (parser_qualified_name): Now uses parameter name as a WFL node.
5186 (parser_check_super_interface): New parameter wfl, for achieve
5187 greater accuracy during error reports.
5188 (parser_chain_incomplete_item): New parameter named location. Used,
5189 along the decl, to construct the incomplete item node.
5190 (java_complete_class): resolve_class now uses WFL node extracted
5191 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
5193 (complete_method_decl): Unresolved function's argument types are WFL.
5194 (resolve_class): Parameter cl is now a WFL node.
5195 (resolve_and_layout): Likewise.
5196 (do_resolve_class): Likewise. Try first to use cl and then do the
5197 lookup on the decl when calling check_pkg_class_access.
5198 (complete_class_report_errors): Use IC_TYPE in place of
5199 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
5200 instead of doing a lookup over the decl.
5201 (java_check_final): Use WFL info from field tree list.
5202 (lookup_cl): Rewritten and returns a statically defined WFL node.
5203 (lookup_modifier_cl): Now uses information from WFL nodes.
5204 (process_imports): Likewise.
5205 (read_import_dir): name and cl arguments replaced by a single WFL
5206 node. Function modified accordingly.
5207 (find_in_imports_on_demand): Now uses WFL node.
5208 (check_pkg_class_access): cl argument is now a WFL node.
5209 (declare_local_variables): Fixed to use WFL nodes.
5210 (resolve_expression_name): Likewise.
5211 (build_method_invocation_stmt): name_combo argument renamed
5212 wfl. Function modified to use WFL nodes.
5213 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
5214 (lookup_method_invoke): cl is now a WFL node. Added missing
5215 IDENTIFIER_POINTER to class type decl name.
5217 Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
5219 * lang.c (init_parse): Now returns char* containing the filename.
5221 Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
5223 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
5225 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
5226 * class.c (make_class_data): If flag_assume_compiled, initial class
5227 state is CSTATE_PREPARED; make superclass and interfaces direct
5228 references, rather than constant pool indexes.
5230 Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5232 * parser.y: Include flags.h. Removed debug variable pl.
5233 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
5235 (labeled_statement_nsi:): Generate debug info when reducing
5236 expression_statement:.
5237 (check_pkg_class_access): get_access_flags_from_decl invokation
5238 fixed for new CLASS_* flags location.
5239 (source_end_java_method): Save/restore parser context when
5240 entering/leaving this routine. Restore lineno to its right value
5241 before calling expand_end_bindings.
5242 (build_method_invocation_stmt): build_invoke called with the
5243 current line information.
5244 (build_invoke): New argument cl. Wrap the function call around a
5246 (refine_accessible_methods_list): Changed comment, removed
5248 * parse.h: Fixed typo in comments.
5249 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
5250 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
5251 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
5253 * lex.c (java_lex): Record the last closing curly bracket of a
5255 * jcf-parse.c (jcf_parse_source): Now calls
5256 java_check_methods. Clarified comment, fixed typo.
5258 1998-04-09 Dave Brolley <brolley@cygnus.com>
5260 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
5261 (finish_parse): Expose for non USE_CPPLIB builds.
5263 Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
5265 * lang.c (lang_print_xnode): New function.
5267 Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
5269 * decl.c (class_dtable_decl), java-tree.h: New tree node.
5270 * class.c (get_dispatch_vector, get_dispatch_table): New functions
5271 used to build a class's dispatch table.
5272 (make_class_data): Generate dispatch table if flag_assume_compiled.
5273 Set dtable of class object to address of class_dtable_decl.
5275 * decl.c (int_decl_processing): Make soft_badarrayindex_node
5276 be volatile and have side effects - generates better code.
5278 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
5279 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
5281 * expr.c (expand_invoke): If class is final, method is
5282 effectively final, so can call it directly.
5284 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
5286 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
5288 Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5290 * parse.y (build_method_invocation_stmt): Removed extra argument
5293 Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5295 * expr.c (dtable_indent): Now static global.
5296 (expand_invoke): Now call invoke_build_dtable and
5297 build_invokevirtual.
5298 (invoke_build_dtable, build_invokevirtual): New functions.
5299 * jcf-io.c (find_class): Defer issuing a warning by setting
5300 jcf->outofsynch to 1.
5301 * jcf-parse.c (jcf_out_of_synch): New function.
5302 (load_class): Test this_jcf.outofsynch flag and call
5303 jcf_out_of_synch accordingly.
5304 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
5305 comment indentation.
5306 * lex.c (java_get_unicode): Fixed code indentation.
5307 (java_lex): Create string literal. Fixed typo. Removed several
5308 premature obstack_free.
5309 * parse.h: New enums for name resolution and invocation mode.
5310 (struct qualification): New data structure.
5311 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
5312 (do_resolve_class, build_method_invocation_stmt,
5313 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
5314 debug_line, identical_subpath_p, invocation_mode,
5315 refine_accessible_methods_list, build_invoke,
5316 lookup_method_invoke): New functions declared.
5317 (build_invokevirtual, invoke_build_dtable, match_java_method,
5318 build_field_ref, jcf_out_of_synch): New references to external
5320 (struct parse_ctxt): Removed artificial_constructor field.
5321 * parse.y: (array_type:): Type defined for this rule.
5322 (class_type:): Installed default rule for interface_type:.
5323 (array_type:): Now build Java array type.
5324 (qualified_name:): Now use obstack_grow0.
5325 (method_declaration:): Skip the artificial constructor added to
5327 (abstract_method_declaration:): Execute the code only during pass 1.
5328 (block:): Installed default rule in block_statements:.
5329 (block_statement:): Add the statement to the method during pass 2.
5330 (statement_expression): Installed default rule for
5332 (argument_list:): Added code to build the argument list.
5333 (method_invocation:): Added call to create the method invocation
5335 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
5336 (debug_line): New function for debug.
5337 (complete_class_decl): No longer do something during pass 1.
5338 (method_header): Use BUILD_PTR_FROM_NAME.
5339 (parser_qualified_classname): Use obstack_grow0. Removed bogus
5341 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
5342 function's main comment.
5343 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
5345 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
5346 (resolve_class): Now works with arrays.
5347 (do_resolve_class, resolve_and_layout): New functions.
5348 (java_check_regular_methods): Reverse method list before and after
5349 having processed it. No longer set ctxp->artificial_constructor.
5350 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
5351 accordingly. Fixed typo in issued error message. Now use
5353 (find_in_imports_on_demand): Now use obstack_grow0.
5354 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
5355 (source_end_java_method): Call expand_expr_stmt instead of
5356 expand_expr. Calls it before calling expand_function_end.
5357 (java_method_add_stmt): Do nothing if errors were found during
5359 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
5360 (build_method_invocation_stmt, build_invoke, invocation_mode,
5361 lookup_method_invoke, refine_accessible_methods_list,
5362 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
5364 * typeck.c (build_java_signature): Properly end method signature
5365 if return type skipped.
5366 (match_java_method): New function.
5368 Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
5370 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
5372 Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5374 * expr.c (build_invoke_non_interface): New function.
5375 (methods_ident, ncode_ident): Now static globals.
5376 (expand_invoke): Use build_invoke_non_interface.
5377 * java-tree.h (struct lang_decl): New field function_decl_body.
5378 (DECL_FUNCTION_BODY): New macro.
5379 * jcf-parse.c (jcf_parse_source): Deeper check before setting
5380 CLASS_FROM_SOURCE_P.
5381 (parse_source_file): Fixed typos. Call java_layout_parsed_class
5382 before starting pass 2. Call to java_generate_parsed_class replaced
5383 by java_register_parsed_class.
5384 * lex.c: Fixed typo in header. Some line width related formating.
5385 * lex.h: Some line width related formating.
5386 * parse.h (source_end_java_method, resolve_expression_name,
5387 complete_class_decl, maybe_create_class_interface_decl,
5388 check_class_interface_creation): New static function declarations.
5389 (java_layout_parsed_class, java_method_add_stmt): New function
5391 (struct parser_ctxt): Field mark_class_generate removed. New
5392 fields class_list and artificial_constructor.
5393 * parse.y: Fixed typo in header.
5394 (class_declaration:): Call complete_class_decl when class body
5396 (method_declaration:): Call source_end_java_method in pass 2 when
5397 the method body is defined.
5398 (postfix_expression:): Do expression name resolution on sub-rule
5400 (create_class, create_interface): Merged common pieces.
5401 (check_class_interface_creation, maybe_create_class_interface_decl):
5403 (complete_class_decl): New function.
5404 (register_fields): Fixed line width related typo.
5405 (method_header): Correctly skip first argument when fixing
5406 argument line. Changed the loop.
5407 (java_check_circular_reference): Now use ctxp->class_list.
5408 (java_complete_class): Removed start/stop marking.
5409 (java_check_regular_methods): Now takes a class decl as an
5410 argument. Add default constructor if none were encountered.
5411 (java_check_methods): Now use ctxp->class_list. Changed call to
5412 java_check_regular_methods.
5413 (source_start_java_method): Set DECL_ARG_TYPE for each function
5415 (source_end_java_method, java_method_add_stmt): New functions.
5416 (java_generate_parsed_class): No longer exists.
5417 (java_layout_parsed_class, java_register_parsed_class): New functions.
5418 (resolve_expression_name): New function.
5420 Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5422 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
5423 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
5424 until pass initializations are done. Call read_import_dir with
5426 * parse.h: (lookup_modifier_cl): New function declared.
5427 (INTERFACE_FIELD_MODIFIERS): New macro.
5428 (OBSOLETE_MODIFIER_WARNING): New macro.
5429 * parse.y: (register_fields): Class type and current field name in
5430 local variables. Check modifier(s) if adding field(s) to an interface.
5431 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
5432 and report errors using the faulty modifier line context.
5433 (lookup_modifier_cl): New function.
5434 (read_import_dir): Detect and report default import processing
5437 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
5439 Add a pair of -fassume-compiled/-fno-assume-compiled options.
5440 * class.c (is_compiled_class): Return 1 after making sure it
5441 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
5442 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
5443 * java-tree.h (flag_assume_compiled): Add decl.
5444 * lang.c (lang_f_options): Add the flag.
5445 (flag_assume_compiled): Add decl, default to 0.
5447 Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5449 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
5450 (is_compiled_class): Likewise.
5451 (layout_class): Likewise.
5452 (layout_class): Detect and lay out classes defined in source code.
5453 (interface_of_p, add_interface_do, may_add_interface): New
5455 (add_interface): Now use add_interface_do.
5456 (add_method_1): New function.
5457 (add_method): Now use add_method_1.
5458 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
5459 (complete_start_java_method): New function.
5460 (start_java_mehod): Now call complete_start_java_method.
5461 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
5462 (expand_invoke): Likewise and fixed typo.
5463 *gjava.c: (print_super_field): Use new argument to find_class
5466 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
5467 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
5468 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
5470 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
5471 (add_method_1, push_class): New prototypes.
5472 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
5473 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
5474 directory where the class was found.
5475 (find_class): New argument DO_CLASS_FILE. Function find_class
5476 modified accordingly.
5477 *jcf-parse.c: (fix_class_path): New function.
5478 (load_class): Use new VERBOSE argument. load_class now finds and
5479 loads/parses .class/.java files. Save read_state of current_jcf
5481 (java_parser_abort_on_error): New macro.
5482 (jcf_parse_source, parse_source_file): New function.
5483 (jcf_parse): Fixed typo.
5484 (yyparse): Call parse_source_file () only.
5485 (process_zip_dir): Fixed typo, fix zdir->filename_length when
5486 writing the real class name back in the zip directory entry.
5487 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
5488 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
5489 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
5490 (find_class): Prototype fixed.
5491 *lex.c: Added 1998 time stamp.
5492 Removed all static global variables, moved into the parser
5493 context data structure.. Now include unistd.h if SEEK_SET not
5495 (java_init_lex): Rewritten.
5496 (java_sneak_unicode): Modified current unicode access in current line.
5497 (java_unget_unicode): Likewise.
5498 (java_allocate_new_line): New allocation management.
5499 (java_read_char): Modified access and storage of unget_utf8_value.
5500 New way of processing current unicode.
5501 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
5502 (java_get_unicode): Now use the parser context.
5503 (java_lineterminator): Likewise.
5504 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
5505 of the reentrant parser implementation. Function now use the
5506 parser context data structure and java_lval. Fixed production of
5507 the float and double constant "out of range" error message. Fixed
5508 obstack use. Return integer value when hitting a modifier. Now
5509 return type for TRUE, FALSE and other predefined types. Return
5510 identifier as a TREE_LIST list containing the current line context
5511 as the TREE_VALUE sub-node.
5512 (java_unicode_2_utf8): Fixed typo in declaration.
5513 (java_lex_error): Now use the parser context data structure.
5514 *lex.h: Added 1998 time stamp.
5515 (struct java_line): New fields ref_count and next.
5516 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
5517 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
5518 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
5519 *parse.h: Added 1998 time stamp.
5520 (java_parse_source_file): Renamed from parse_source_file.
5521 (YYERROR_NOW, YYNOT_TWICE): Fixed.
5522 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
5523 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
5524 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
5525 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
5526 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
5527 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
5528 (struct parser_ctxt): New data structure to keep the parser context.
5529 *parse.y: Added 1998 time stamp, got rid of static global variables.
5530 (java_error_count, ctxp): New global variables.
5531 (%union): New value field.
5532 (numeric_type, integral_type): Rules removed.
5533 (primitive_type): Rule defined to handle integral, float, double and
5535 (qualified_name, package_declaration,
5536 single_type_import_declaration, type_import_on_demand_declaration,
5537 modifiers, class_declaration, super, interfaces,
5538 interface_type_list, class_body, field_declaration,
5539 field_declaration, variable_declarators, variable_declarator,
5540 variable_declarator_id, method_declaration, method_header,
5541 formal_parameter_list, formal_parameter, method_body, block,
5542 static, interface_declaration, extends_interfaces,
5543 abstract_method_declaration, local_variable_declarators): Rules now
5545 (force_error, do_warning): New global statics.
5546 (push_parser_context, parser_context_save_global,
5547 parser_context_restore_global, pop_parser_context): New functions.
5548 (yyerror): Now uses the global parser context. Fixed use of obstack.
5549 (parse_error, parse_error_context, parse_warning_context,
5550 java_accstring_lookup, redefinition_error, check_modifiers,
5551 parser_add_interface, create_interface, create_class, find_field,
5552 duplicate_declaration_error, register_fields, method_header,
5553 check_modifiers_consistency, check_abstract_method_header,
5554 method_declarator, parser_qualified_classname,
5555 parser_check_super_interface, parser_check_super,
5556 parser_chain_incomplete_item, java_check_circular_reference,
5557 layout_class_from_source, java_complete_class,
5558 complete_method_decl, resolve_class, complete_class_report_errors,
5559 java_check_final, check_method_redefinition,
5560 java_check_regular_methods, java_check_abstract_methods,
5561 java_check_methods, lookup_java_interface_method2,
5562 lookup_java_method2, lookup_cl, find_name_in_single_imports,
5563 process_imports, find_in_imports, read_import_entry,
5564 read_import_dir, find_in_imports_on_demand,
5565 check_pkg_class_access, not_builtin_p, declare_local_variables,
5566 source_start_java_method, java_generate_parsed_class): New
5568 *typeck.c: (signature_include_return): New global variable.
5569 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
5570 to add the function returned type in the signature.
5572 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
5574 * jcf-io.c (open_in_zip): Use strncmp and LEN.
5576 Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
5578 * Make-lang.in (java.info): Added.
5579 (java.install-info): Added
5581 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
5583 * Makefile.in (clean): Also remove java/parse.c.
5585 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
5587 Add a pair of -fbounds-check/-fno-bounds-check options.
5588 * lang.c (lang_decode_option): Add code to grok arguments.
5589 (flag_bounds_check): Add decl.
5590 (lang_f_options): New array w/ the option in it.
5591 * java-tree.h (flag_bounds_check): Add decl.
5592 * lang-options.h: New file.
5593 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
5594 of a static macro value.
5595 (JAVA_ARRAY_EXCEPTION): Delete macro.
5597 Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
5599 * typeck.c (build_java_array_type): Fix two bugs in previous change.
5600 * expr.c (build_anewarray): Add missing promote_type.
5602 Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
5604 Add array types with known length to optimize bounds checking.
5605 * typeck.c (build_java_array_type): Take length parameter.
5606 (java_array_type_length, build_prim_array_type): New functions.
5607 * java-tree.h: Update for new functions.
5608 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
5609 * class.c: Use build_prim_array_type.
5610 * expr.c (can_widen_reference_to): Handle known-length array types.
5611 (verify_jvm_instructions): Keep track of integer push instructions
5612 followed by newarray/anewarray, so we can build known-length arrays.
5613 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
5614 (java_array_data_offset): New function.
5615 (build_java_array_length_access): New function. Optimize if constant.
5616 (build_java_arrayaccess): Constant fold bounds check.
5617 (expand_java_newarray, expand_java_anewarray): Replaced by ...
5618 (build_newarray, build_anewarray): New functions.
5619 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
5620 * verify.c (merge_types): Handle known-lengh array types.
5622 Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
5624 * expr.c (expand_byte_code): Fix performace bug, which caused
5625 searching linenumber_table to be linear rather than constant.
5627 Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
5629 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
5631 * decl.c, java-tree.h (soft_fmod_node): New global.
5632 * decl.c (init_decl_processing): Define __builtin_fmod.
5633 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
5634 using __builtin_fmod.
5636 Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5638 * keyword.h: New file, output of keyword.gperf as processed by
5640 * lex.c (java_lex_init): Initialize java_error_flag.
5641 * parse.c (YYERROR_NOW): Uses java_error_flag.
5642 * parse.y: New static java_error_flag. Useless definition of
5644 * parse.y (java_error): Portable error recovery using
5645 java_error_flag (not yet completely tuned).
5647 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
5649 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
5651 Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5653 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
5654 (parse.c, lex.c, keyword.h): New rules for Java source code
5656 * parse.c: Renamed into jcf-parse.c.
5657 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
5658 * keyword.gperf: New file, Java keywords.
5659 * parse.y: New file, Java language grammar.
5660 * parse.h: New file, Java language grammar definitions.
5661 * lex.c: New file, Java language lexer.
5662 * lex.h: New file, Java language lexer definitions.
5664 Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
5666 * decl.c (clinit_identifier_node), java-tree.h: New global.
5667 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
5668 * verify.c (verify_jvm_instructions): Inline use of removed macros.
5669 * expr.c (expand_java_field_op): Check for invalid assignment
5672 * jcf-reader.c (get_attribute): Test for wrong attribute length.
5674 Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
5676 * verify.c (verify_jvm_instructions): When processing a handler,
5677 attempt to set the current_subr to the right value.
5678 (More complicated code combines Sep 17 and Oct 22 versions.)
5680 Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
5682 * class.c (push_class): Figure out (guess) name of source file.
5683 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
5684 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
5685 (parse_class_file): Change return type from int to void.
5686 Call debug_start_source_file/debug_end_source_file.
5688 * expr.c (build_java_binop): Fix masking 2nd operand.
5689 * decl.c (init_decl_processing): Set sizetype first.
5691 Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
5693 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
5694 (Revert Sep 17 change.)
5696 Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5698 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
5699 .class extension in their name and fix thing so we don't process
5700 them parse_zip_file_entries().
5701 (parse_zip_file_entries): Cleaned unused local variables.
5703 Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
5705 * expr.c (can_widen_reference_to): Allows equal array element types.
5706 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
5707 * jcf-dump.c (RET): Get (and print) index.
5709 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
5710 Promote element type to POINTER_TYPE.
5712 Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5714 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
5715 find_in_current_zip, jcf_figure_file_type): Moved from
5716 jcf-reader.c to parse.c.
5717 * zextract.c: (read_zip_archive): takes file_comment_length possible
5720 Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
5722 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
5724 * verify.c (merge_types): Handle array types even better ...
5726 Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
5728 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
5730 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
5731 * class.c (make_class_data): Don't build fields_decl if no fields.
5732 When building fields_decl, skip if DECL_ARTIFICAL.
5734 * expr.c (java_stack_swap): Update stack_type_map.
5735 * verify.c (merge_types): Handle array types better.
5737 Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
5739 * class.c (add_field): Don't promote short integral fields to
5740 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
5741 * expr.c (push_value): Promote and convert short integral values.
5743 * decl.c, java-tree.h (integer_two_node): New constant node.
5744 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
5746 Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5748 * class.c (append_gpp_mangled_type): Use function argument
5749 unpromoted type to generate mangled name.
5751 Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5753 * constants.c (build_constant_data_ref): Now uses current_class
5754 instead of main_class.
5755 (build_constants_constructor): Now uses current_class instead of
5757 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
5758 of the global variable SeepZipFiles done here.
5759 * zextract.c (read_zip_archive): extra_field optional field taken
5760 into account while computing the position of the class file in the
5762 * verify.c (verify_jvm_instructions): Use current_jcf to search
5764 * parse.c (load_class): First search for the class to load in the
5765 current zip file. Saves current_jcf (restored before returning
5766 from that function). Don't call JCF_FINISH in the class was found
5767 in the current ZIP file.
5768 (jcf_parse): If the class was found in the current ZIP file, save
5769 its tree_constant_pool (for later reuse).
5770 (parse_class_file): New function. Process each method defined in
5771 the current class and record the class as to be later registered.
5772 (yyparse): Rewritten. Figure the type of the current file and switch
5774 * lang.c: New global variable current_jcf.
5775 (lang_init): Removed compiling_from_source test (done later, in
5776 yyparse). Removed call the jcf_parse ().
5777 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
5778 (typedef struct JCF): New fields seen_in_zip (to mark a class found
5779 in the current ZIP file) and zip_offset (offset to the class data in
5780 the current zip file).
5781 * jcf-reader.c: zipfile.h included.
5782 localToFile: New ZipFileCache static global variable
5783 (parse_zip_file_entries): New function. Browse the current ZIP
5784 file directory and process each class found.
5785 (process_zip_dir): New function. Register each class found in the
5786 ZIP file directory. The class aren't parsed but a valid JCF is
5787 link to each of them.
5788 (find_in_current_zip): New function. Search for a class in the
5789 current ZIP file directory. If found, prepare the class so that it
5791 (jcf_figure_file_type): New function. Examine the file structure
5792 to figure a class file, a ZIP file. If none of these categories are
5793 matched, a source file is assumed.
5794 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
5795 SeenZipFile: New global variable.
5796 (open_in_zip): Use zipmember's length to accelerate the search for
5797 a member. If zipmember was NULL and zip file successfully read,
5799 * java-tree.h: New global variable current_jcf declared. Added
5800 declaration for current_constant_pool_tags, current_constant_pool_data,
5801 current_constant_pool_length, current_constant_pool_data_ref.
5802 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
5803 store the JCF of classes seen in a zip file) and tree *constant_pool
5804 (to save a loaded class constant pool). current_class declared here.
5805 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
5806 retrieve method_ref_constant.
5807 (PUSHC): java_push_constant_from_pool now uses current_jcf.
5808 (OBJECT): get_class_constant now uses current_jcf.
5809 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
5810 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
5811 (expand_invoke): Now uses current_class instead of main_class
5812 (build_class_init): Now uses current_class instead of main_class
5813 * class.c: New static global variable registered_class.
5814 (register_class): New function.
5815 (emit_register_class): Modified to use registered_class instead of
5817 (is_compiled_class): Now take into account class seen in the archive.
5819 Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
5821 * except.h: Renamed to: java-except.h.
5822 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
5823 * except.c: Add semi-working (commented out) implementation.
5825 * expr.c (expand_iinc): Add needed flush_quick_stack.
5826 * parse.c (set_source_filename): New function.
5827 (give_name_to_class): Set input_filename from package.classname.java.
5829 * jcf-io.c (find_class): Don't look first in ".".
5831 Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5833 * zextract.c (read_zip_archive): Now takes into account the
5835 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
5837 Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
5839 * constants.c, java-tree.h (build_internal_class_name): New function.
5840 (alloc_class_constant): Re-implement using build_internal_class_name.
5841 * class.c (make_class_data): Likewise.
5842 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
5844 Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
5846 * verify.c (verify_jvm_instructions): Temporarily set current_subr
5847 to NULL before pushing an exception handler target.
5849 * expr.c (flush_quick_stack): Save from low stack indexes to high.
5850 (java_stack_swap, java_stack_dup): Re-write to be safe from
5851 clobbering registers.
5852 (build_class_init): New function.
5854 Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5856 * typeck.c (build_java_array_type): Temporary use
5857 permanent_obstack to create the array 'length' field.
5858 * expr.c (lookup_label): Temporay use permanent_obstack to create
5860 * class.c (push_super_field): Tempory use permanent_obstack.
5862 Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5864 * typeck.c (type_for_mode): Now handles double_type_node and
5866 * verify.c (verify_jvm_instructions): The instruction following
5867 the wide bytecode is checked. OPCODE_ret added to the list of
5870 Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5872 * class.c (make_class): Temporary use permanent_obstack. Set the
5873 class CLASS_P field to 1.
5874 (push_class): Temporary use permanent_obstack.
5875 (set_super_info): Temporary use permanent_obstack.
5876 (add_method): Temporary use permanent_obstack, set
5878 (add_field): Temporary use permanent_obstack. Sets
5879 FIELD_VOLATILE() and FIELD_TRANSIENT().
5880 (build_class_ref): Temporary use permanent_obstack if the class
5882 (build_static_field_ref): Temporary use permanent_obstack when
5883 creating field's rtl.
5884 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
5885 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
5886 and fields. Function finalized, as far as flag handling.
5887 (push_class_static_dummy_field): Temporary use permanent_obstack.
5888 (emit_register_class): Force generation of class registration at
5890 * decl.c (end_java_method): Call permanent_allocation() before
5892 * expr.c (can_widen_reference_to): Added comment to interface
5893 handling, fixed typo.
5894 (lookup_field): Now uses CLASS_P() to correct FIXME
5895 (expand_invoke): Verification on public && !static &&
5896 !abstract moved into soft_lookupinterfacemethod (kaffe).
5897 Use Object class dtable if objectref is an array when expanding
5899 (java_push_constant_from_pool): Temporary use permanent_obstack
5901 * parse.c (get_ref_constant): Temporary use permanent_obstack to
5902 create constant references.
5903 (get_constant): Temporary use permanent_obstack to create constant.
5904 (load_class): Temporary use permanent_obstack to load class.
5905 (jcf_parse): Temporary use permanent_obstack to perform class
5907 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
5908 (build_java_signature): Temporary use permanent_obstack.
5909 * verify.c: (verify_jvm_instruction): removed unecessary verification
5911 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
5912 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
5915 Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
5917 * class.c (append_gpp_mangled_type): Fix typo.
5918 (emit_register_class): Use main_class to get class object, rather
5919 than looking for no-longer-existing static decl starting with _CL.
5920 * typeck.c (parse_signature_type): Promote array element type
5921 if it is a RECORD_TYPE.
5923 Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
5925 * class.c (push_class_static_dummy_field): New function.
5926 (mangle_static_field): New. Do G++-style mangling of static fields.
5927 (layout_class): Mandle static fields here, not in add_field.
5928 (build_class_ref): The class object is now a dummy static field.
5929 * decl.c (find_local_variable): Look for best, instead of first match.
5930 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
5931 (build_java_athrow): Don't check here if exception is Throwable.
5932 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
5933 (TYPE_USED): Removed. No longer used ...
5934 * parse.c (jcf_parse): Call push_class_static_dummy_field.
5935 * verify.c (push_pending_label): New function.
5936 (push_pending_block): Renamed to check_pending_block.
5937 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
5938 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
5939 re-checking possible handlers) after a store (less wasted work).
5940 Check for null handler (finally) before calling add_handler.
5941 Various changes to (finally?) correctly handle try/finally.
5943 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
5945 * class.c: Include stdio.h.
5947 Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
5949 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
5950 to make sure class is initialized before static/special invoke.
5952 * verify.c (verify_jvm_instructions): On a store instruction,
5953 call find_local_variable to force pre-allocation of decl and rtx.
5954 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
5956 Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
5958 * class.c (build_class_ref): Strip off "promoted_" if need be.
5959 (make_field_value): Call build_java_signature when needed.
5960 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
5961 * expr.c (build_java_athrow): Don't push_value of exception.
5962 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
5963 match specification of [fd]cmp[lg] for NaNs.
5964 (expand_byte_code): Add support for exception handler ranges.
5965 * except.c: Add skeleton for EH code-generation.
5966 * verify.c (merge_types): Treat all promoted integral types as equal.
5967 * constants.c (build_constants_constructor): To force creation of
5968 current_constant_pool_data_ref, call build_constant_data_ref.
5970 * javaop.def (lload): Fix typo.
5971 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
5973 Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
5975 * parse.c: Don't include function.h.
5977 Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
5979 * except.[ch]: New files.
5980 * Makefile.in (JAVA_OBJS): Add except.o
5981 * expr.c: Temporary warning about unimplemented exceptions.
5982 * verify.c: Verify exception handlers.
5984 * jcf-dump.c (disassemble_method): Print exception table.
5986 Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
5988 * expr.c (verify_jvm_instructions): Started a thorough
5989 verification of invoke* bytecodes.
5990 (expand_byte_code): flush quick stack if PC is the target of a
5991 branch. and undef RET (conflicting with config/i386/i386.h).
5992 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
5994 (expand_invoke): Now handles invokeinterface and do more
5995 verification according to the bytecode.
5996 (lookup_field): Don't try to load the class if processing
5998 (can_widen_reference_to): Now handles interfaces.
5999 * decl.c (init_decl_processing): New global variable
6000 soft_lookupinterfacemethod_node, declared in java-tree.h.
6001 Call set_super_info on string_type_node.
6002 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
6004 * class.c (set_super_info): Fills the CLASS_* flags according to
6006 (get_access_flags_from_decl): Handles all class flags.
6008 Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
6010 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
6011 * parse.c (yyparse): Check for abstract method, and missing code.
6012 * expr.c (expand_byte_code): Change interface.
6013 * lang.c (put_decl_node): Print promoted types prettier.
6014 * verify.c (verify_jvm_instruction): Change interface.
6015 Partial support for scanning exception table.
6016 For load instructions, handle promoted integral types.
6018 Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
6020 * verify.c: New file, with contents moved from expr.c.
6021 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
6022 * typeck.c (is_array_type_p): Moved here from expr.c.
6023 * java-tree.h: Add some now-needed function declarations.
6024 * Makefile.in (JAVA_OBJS): Added verify.o.
6026 Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6028 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
6029 METHOD_ABSTRACT flag.
6031 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
6032 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
6033 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
6035 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
6037 (start_java_method): Hook for SYNCHRONIZED methods.
6039 * expr.c (build_java_jsr, build_java_ret): New functions
6040 (JSR,PRE): New macros
6041 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
6042 (verify_jvm_instructions): tableswitch, lookupswitch,
6043 monitorenter, monitorexit, goto_w: verified.
6044 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
6045 (build_java_monitor): New function.
6046 (MONITOR_OPERATION): Modified to call build_java_monitor()
6047 (verify_jvm_instructions): Started a thorough verification of
6050 Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
6052 Support verification of jsr/ret subroutines (used for try/finally).
6053 * decl.c (return_address_type_node): New type node.
6054 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
6055 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
6056 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
6057 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
6058 TYPE_USED): New macros for special types in type_map.
6060 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
6061 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
6063 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
6065 * expr.c (can_widen_reference_to): New function.
6067 (merge_type_state): Support handling start of subroutine.
6068 (push_pending_block): Return char* error message, instead of calling
6069 fatal on an error. Also handle subroutines.
6070 (verify_jvm_instructions): Handle errors from push_poending_block.
6071 Support jsr and ret instructions.
6073 Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
6075 * jcf-io.c (find_classfile): Fix thinko.
6076 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
6078 Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
6080 * Makefile.in (BISON): Remove.
6082 Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
6084 * Makefile.in: Convert to autoconf.
6085 * config-lang.in (outputs): Added java/Makefile.
6087 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
6088 Rename cc1java to jc1.
6090 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
6091 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
6093 * class.c (class_depth): Do load_class if needed.
6095 Mostly better verification.
6096 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
6097 (init_decl_processing): Change return type of soft_checkcast.
6098 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
6099 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
6100 lang_print_error): New functions.
6101 (lang_init): Set global hook print_error_function to lang_print_error.
6102 * expr.c: In the type_map ptr_type_node is only used for null now.
6103 (pop_type, merge_types): Hence ptr_type_node matches any reference.
6104 (merge_types): Dererence pointer to record types before comparing.
6105 (decode_newarray_type, merge_types): On error just return NULL.
6106 (build_java_binop): Add preliminary implementation (with warning)
6107 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
6108 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
6109 (expand_compare, expand_java_goto, expand_java_call): Don't
6110 push_pending_block, since that only makes sense when verifying.
6111 (merge_type_state): Different return codes.
6112 (push_pending_block): A block may need to be verified more than once.
6113 (expand_byte_code): Warn about unused code at code generation time.
6114 (verify_jvm_instruction): Changed logic, since code may need to be
6115 re-verified if type-state has changed. Also, better error handling.
6116 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
6117 Improve newarray, anewarray, ?aload, athrow,
6118 * java-tree.h (LABEL_CHANGED): New macro.
6120 Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6122 * decl.c (soft_athrow_node): New global variable initialized.
6123 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
6124 * typeck.c (convert): Added support for REAL_TYPE.
6125 (convert_to_char): New function.
6126 (convert): Handle CHAR_TYPE.
6127 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
6128 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
6129 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
6131 (verify_jvm_instructions): Added break a the end of bogus unop: label.
6132 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
6133 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
6134 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
6135 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
6136 to Use The Right Things.
6137 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
6138 compatible with INT. BOOLEAN is made equivalent to BYTE.
6139 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
6140 OPCODE_ifnonnull): Now supported.
6141 (build_java_athrow): New function.
6143 Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
6145 Rename method name <init> to match G++ (and fix mangling).
6146 * class.c (layout_class): Replace method name of <init> by class name.
6147 (make_method_value): Do inverse renaming of constructor from <init>.
6148 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
6149 * typeck.c (lookup_java_constructor): New function.
6150 * expr.c (expand_invoke): If method_name is <init>, call
6151 lookup_java_constructor to find constructor.
6153 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
6155 Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
6157 * parse.c (get_class_constant): Modified to handle array "classes"
6158 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
6160 (convert): Modified to handle real type.
6161 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
6162 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
6164 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
6165 soft_multianewarray, soft_newarray_node, soft_throw_node): New
6166 global variables initialized.
6167 (find_local_variable): Handles the case of a pointer
6168 (end_java_method): Restore the use of one more scope
6169 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
6170 build_java_array_length_access, expand_java_arrayload,
6171 expand_java_arraystore, expand_java_array_length,
6172 expand_java_multianewarray, expand_java_anewarray,
6173 build_java_check_indexed_type, is_array_type_p,
6174 build_java_throw_out_of_bound_exception): New functions.
6175 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
6176 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
6177 OPCODE_<t>aload): Implemented code for verification.
6178 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
6179 ARRAY_NEW_MULTI): Macro defined.
6180 (CONVERT): Modified to invoke convert().
6181 (case OPCODE_aload2): Fixed index typo from 2 to 1.
6183 Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
6185 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
6186 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
6187 (make_class_data): Field name needs '/' as package prefix.
6188 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
6190 Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
6192 Implement debug information for local variables.
6193 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
6194 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
6195 DECL_LOCAL_SLOT_CHAIN): New macros.
6196 (struct lang_decl_var): New type.
6197 * parse.c (give_name_to_locals): Move to decl.c.
6198 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
6199 (start_java_method): Re-write parameter handling.
6200 (pending_local_decls): New global variable.
6201 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
6202 (find_local_variable): Accept pc so we can skips decls not in range.
6203 (struct binding_level): Add end_pc field.
6204 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
6205 (various): Change so current pc gets passed to find_local_variable.
6207 * decl.c (init_decl_processing): Re-arrange fields in
6208 class_type_node and and method_type_node to match kaffe 0.9.1.
6209 * class.c (make_method_value, make_class_data): Update
6210 initializations to match.
6212 Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
6214 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
6215 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
6216 (push_super_field): New function.
6217 (make_class_data): Handle inheritance of class static initializer.
6218 (layout_class): New name mangling.
6219 * constants.c (build_constant_data_ref): Init type of data array
6220 to a one-element array.
6221 (build_constants_constructor): Set DECL_SIZE from complete array type.
6222 * decl.c: Rename class_type, object_type etc to class_type_node,
6223 object_type_node etc. Make former inherit from latter.
6224 * expr.c (expand_invoke): Add cast of function address.
6225 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
6226 * parse.c (yyparse): Don't call layout_class here.
6227 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
6229 Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
6231 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
6232 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
6233 (alloc_class_constant): New.
6234 * expr.c (expand_invoke): Make sure method's class is initialized.
6235 * class.c (interits_from_p, emit_register_class): New functions.
6236 * parse.c (yyparse): Call emit_register_class.
6238 Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
6240 * constants.c: New file, to handle constant pool.
6241 * Makefile.in (JAVA_OBJS): Add constants.o.
6242 * decl.c (init_decl_processing): Update, fix, finish various structs.
6243 (pushdecl_top_level): New.
6244 * parse.c (layout_class): Moved to class.c.
6245 * expr.c (java_push_constant_from_pool): New function.
6246 * class.c (build_class_ref): Make work fully
6247 (make_class_data): Emit super-class, constant pool, interface vector.
6249 Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
6251 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
6252 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
6253 * class.c (class_depth): New function.
6254 (lookup_named_class): Replaced by new function lookup_class.
6255 * decl.c (object_type_node, string_type_node): New.
6256 Remove various types that we no longer need.
6257 * expr.c (verify_jvm_instructions): New separate verifier pass.
6258 (push_type, pop_type): New functions for verifier.
6259 (type_stack_dup, pop_argument_types, merge_types): Likewise.
6260 (expand_byte_code): Simplify, since we assume already verified.
6261 (expand_invoke): Now mostly works.
6262 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
6263 * lang.c (main_class): Move to parse.c. Don't make_class yet.
6264 * parse.c: Wait to allocate class object until we know its name.
6265 (layout_class): Calculate DECL_VINDEX for each virtual method.
6266 * typeck.c (get_array_type): Rename to ...
6267 (build_java_array_type): ... and provide working implementation.
6268 (build_java_signature): New function - build Java signature of type.
6269 (set_java_signature): New function - cache signature with type.
6270 (lookup_java_method): New function.
6272 Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
6274 * class.c (ident_subst): Take extra SUFFIX parameter.
6275 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
6276 (set_constant_value, build_static_field_ref, is_compiled_class): New.
6277 (build_class_ref): Actually implement.
6278 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
6279 * decl.c (builtin_function): New.
6280 (init_decl_processing): Update for current Kaffe. Declare some
6281 builtin Kaffe functions.
6282 * expr.c (build_address_of): New.
6283 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
6284 Renamed (from expand_java_new etc), and added working implementations.
6285 (build_field_ref): Now also handle static fields.
6286 (expand_invoke): Implement invokestatic, and start implement rest.
6287 * java-opcodes.h: Use javaop.def to avoid duplicated list.
6288 * javaop.def: Rename invokevirt -> invokevirtual.
6289 * lang.c (use_handles): Removed.
6290 * parse.c: Add support for ConstantValue atribute.
6291 Handle nested loading of a class. (JPOOL_UTF): New.
6293 Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
6295 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
6297 Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
6299 * Make-lang.in (java.install-man): New empty rule.
6300 * typeck.c (set_local_type): New function.
6301 * expr.c (STORE_INTERNAL): Call find_local_variable,
6302 not find_stack_slot. Call set_local_type.
6304 Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
6306 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
6307 and building RECORD_TYPE CONSTRUCTORs.
6308 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
6310 * lang.c (use_handles): Change the default to 0.
6311 * decl.c: Define and build class_type, field_type, utf8const_type.
6312 * class.c (make_class_data, make_field_value,
6313 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
6314 hashUtf8String, strLengthUtf8, mangled_classname:
6315 Functions to build reflective data structures.
6316 * parse.c (yyparse): Call make_class_data.
6318 * jcf-io.c (open_class, find_classfile): New functions.
6319 * jcf-dump.c: Support reading classfile from explicitly-named
6320 class file (without CLASSPATH searching).
6322 Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
6324 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
6325 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
6326 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
6327 (get_constant): Now trivial for CONSTANT_Utf8.
6329 * jcf.h: Make NEW_CPOOL the default.
6330 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
6332 Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>