1 Mon Mar 13 12:21:13 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
3 * parse.h (PUSH_CPC): Fixed indentation.
4 (DEBUG_CPC): New macro.
5 (SET_CPC_INITIALIZER_STMT, SET_CPC_STATIC_INITIALIZER_STMT,
6 SET_CPC_INSTANCE_INITIALIZER_STMT): New macros.
7 * parse.y (class_body_declaration:): Use
8 SET_CPC_INSTANCE_INITIALIZER_STMT.
9 (method_declaration:): Check for null current_function_decl.
10 (static_initializer:): Use SET_CPC_STATIC_INITIALIZER_STMT.
11 (java_parser_context_pop_initialized_field): Better handling of
13 (maybe_make_nested_class_name): Mark nested class name as
14 qualified when necessary.
15 (end_class_declaration): Don't call java_parse_context_resume when
16 one or more error occured.
17 (add_inner_class_fields): Use SET_CPC_INITIALIZER_STMT.
18 (register_fields): Use SET_CPC_STATIC_INITIALIZER_STMT and
19 SET_CPC_INITIALIZER_STMT.
20 (method_header): Check for inner classes declaring static methods.
21 (resolve_qualified_expression_name): Handle situation where `this'
24 Mon Mar 13 11:36:51 2000 Hans Boehm <boehm@acm.org>
26 * typeck.c (build_prim_array_type): Correctly set the high word too.
28 2000-03-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
30 * parse.y (java_complete_expand_methods): Leave <clinit> out of
32 (maybe_generate_pre_expand_clinit): Put <clinit> at the end of the
33 list of methods for interfaces.
35 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
37 * parse.y (qualify_ambiguous_name): Properly handle expressions
40 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
42 * parse.y (check_final_assignment): Extended to process
44 (patch_assignment): Have check_final_assignment called only once.
46 2000-03-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
48 * java-tree.h (IS_INIT_CHECKED): New flag.
49 * check-init.c (check_init): Test and set IS_INIT_CHECKED.
50 * parse.y (patch_string): Call force_evaluation_order on the
51 completed string concatenation tree.
52 * expr.c (force_evaluation_order): Call force_evaluation_order on
53 function's arguments too.
55 Mon Mar 6 18:07:07 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
57 * decl.c (emit_init_test_initialization): Mark KEY as unused.
58 * expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
59 (build_anewarray): Likewise.
60 * parse.y (patch_newarray): Likewise.
61 * parse.c: Regenerated.
63 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
65 * decl.c (init_decl_processing): Added new class fields `depth',
66 `ancestors', and `idt' to class_type_node. Use
67 _Jv_LookupInterfaceMethodIdx for soft_lookupinterfacemthod_node.
68 * class.c (make_class_data): Push initial values for new fields.
69 * java-tree.h: Updated prototype for `build_invokeinterface'.
70 * expr.c (build_invokeinterface): Changed parameters to accept
71 `method' tree. Calculate index of `method' in its declaring
72 interface. Build call to _Jv_LookupInterfaceMethodIdx.
73 (expand_invoke): Call `build_invokeinterface' with new parameters.
74 * parse.y (patch_invoke): Call `build_invokeinterface' with new
77 2000-03-06 Bryce McKinlay <bryce@albatross.co.nz>
79 * typeck.c (lookup_do): Search superinterfaces first
80 when looking up an interface method. From Godmar Back
83 2000-03-06 Tom Tromey <tromey@cygnus.com>
85 * Make-lang.in (JAVA_SRCS): Added boehm.c, lex.c.
87 2000-03-02 Alexandre Petit-Bianco <apbianco@cygnus.com>
89 * java-tree.h (lookup_argument_method2): Declared.
90 (safe_layout_class): Prototype moved from parse.h.
91 * parse.h (safe_layout_class): Prototype moved to java-tree.h.
92 * parse.y (java_check_regular_methods): Local `super_class' gone.
93 Call lookup_argument_method2 instead of lookup_argument_method.
94 Perform modifier match for methods found declared in implemented
95 interfaces. Fixed indentation problem. Overriding/hiding error
96 report to take place only for methods found in classes.
97 * typeck.c (lookup_argument_method): Changed leading
98 comment. Re-written by calling lookup_do.
99 (lookup_argument_method2): New function.
100 (lookup_java_method): Re-written by calling lookup_do.
101 (lookup_do): New function.
103 Thu Mar 2 15:18:33 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
105 * check-init.c (check_init): Removed dead code. Handle (blank)
107 * parse.y (declare_local_variables): New local `final_p', set it
108 and use it to initialize LOCAL_FINAL.
109 (check_final_assignment): Only check FIELD_DECLs.
111 2000-02-17 Tom Tromey <tromey@cygnus.com>
113 * Makefile.in (JAVA_OBJS): Added boehm.o.
114 (boehm.o): New target.
115 * Make-lang.in (JAVA_SRCS): Added boehm.c.
116 * java-tree.h (flag_use_boehm_gc): Declare.
117 (get_boehm_type_descriptor): Declare.
118 * lang.c (lang_f_options): Added `use-boehm-gc'.
119 (flag_use_boehm_gc): New global.
120 * lang-options.h: Added -fuse-boehm-gc.
122 * class.c (get_dispatch_table): If class uses a Boehm type
123 descriptor, put it in the vtable.
124 (make_class_data): Removed dead code.
126 2000-03-03 Per Bothner <per@bothner.com>
128 * decl.c (init_decl_processing): Initialize sizetype properly.
130 2000-03-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
132 * java-tree.h (LOCAL_CLASS_P): New flag usage and macro.
133 (PURE_INNER_CLASS_DECL_P, PURE_INNER_CLASS_TYPE_P): New macros.
134 * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
135 * jcf-parse.c (HANDLE_INNERCLASSES_ATTRIBUTE): Likewise.
136 (jcf_parse): New local `current'. Load innerclasses seen in outer
137 context being processed.
138 * jcf-reader.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
139 * jcf-write.c (append_innerclasses_attribute): New function.
140 (append_innerclasses_attribute_entry): Likewise.
141 (get_access_flags): Handle static classes. Set anonymous and local
142 classes to be private.
143 (generate_classfile): Attribute count adjusted. Call
144 append_innerclasses_attribute.
145 * parse.h (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use
146 PURE_INNER_CLASS_TYPE_P.
147 * parse.y (parser_qualified_classname): New parameter `is_static',
148 produce non qualified name accordingly.
149 (block_statement:): Set LOCAL_CLASS_P when declaring local class.
150 (create_interface): Added argument to parser_qualified_classname.
151 (create_class): Added argument to parser_qualified_classname. Setup
152 alias for top level classes. Use PURE_INNER_CLASS_DECP_P.
153 (add_inner_class_fields): Fixed indentation.
154 (method_declarator): Use PURE_INNER_CLASS_DECP_P.
155 (method_declarator): Fixed typo in comment.
156 (craft_constructor): Use PURE_INNER_CLASS_DECP_P.
157 (build_current_thisn): Likewise.
158 (patch_method_invocation): Likewise.
160 2000-03-01 Martin von Loewis <loewis@informatik.hu-berlin.de>
162 * decl.c (current_function_decl): Move to toplev.c.
164 Mon Feb 28 08:20:42 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
166 * java-tree.h (LABEL_PC): Relect name changes in ../tree.h.
167 (DECL_BIT_INDEX): Use underlying representation.
168 * parse.h (DECL_INHERITED_SOURCE_LINE): Likewise.
170 Sun Feb 27 16:40:33 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
172 * expr.c (build_java_ret): Pass proper type to size_binop.
174 2000-02-25 Anthony Green <green@cygnus.com>
176 * expr.c (build_class_init): Mark the decl to be ignored by
178 * java-tree.h (DECL_BIT_INDEX): Move definition from check-init.c
179 * check-init.c: Move DECL_BIT_INDEX to java-tree.h
180 * class.c (init_test_hash_newfunc): New function.
181 (decl_hash): New function.
182 (decl_compare): New function.
183 * decl.c (emit_init_test_initialization): New function.
184 (complete_start_java_method): Traverse the init test hashtable,
185 calling emit_init_test_initialization.
186 (always_initialize_class_p): Define.
187 * expr.c (build_class_init): Use initialization tests when
188 emitting class initialization code.
189 (always_initialize_class_p): Declare.
190 * jcf-parse.c (parse_class_file): Set always_initialize_class_p to
192 * java-tree.h: Include hash.h.
193 (DECL_FUNCTION_INIT_TEST_TABLE): Define.
194 (struct lang_decl): Add init_test_table field.
195 (init_test_hash_entry): Define.
197 Fri Feb 25 18:41:31 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
199 * gjavah.c (main): Avoid using `argi' to report unimplemented
202 Fri Feb 25 18:47:25 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
204 * jcf-write.c (generate_bytecode_insns): TRY_FINALLY_EXPR:
205 initialize locals to avoid warnings. Local `exception_type' moved
208 Fri Feb 25 18:00:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
210 * parse.y (resolve_expression_name): Use `orig' as a second
211 argument to resolve_field_access.
212 (resolve_field_access): Removed unecessary code when dealing with
215 Wed Feb 23 17:41:50 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
217 * class.c (push_super_field): Don't push the field twice.
218 * jcf-parse.c (parse_source_file): Call java_reorder_fields.
219 * parse.h (java_reorder_fields): Prototyped.
220 * parse.y (java_reorder_fields): New function.
221 (java_layout_class): Simplified not to worry about re-ordering.
223 2000-02-23 Tom Tromey <tromey@cygnus.com>
225 * gjavah.c (print_name): In JNI case, correctly quote string.
226 (print_method_info): Don't handle overrides in JNI mode.
228 2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
230 * parse.y (init_decl_processing): `_Jv_IsInstanceOf' returned
231 value type set to `boolean_type_node'.
233 Mon Jan 18 14:30:09 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
235 * jcf-dump.c (main): Test for correct condition after
236 output file creation.
238 2000-02-19 Anthony Green <green@cygnus.com>
240 * jcf-depend.c (add_entry): Fix test for first list entry.
242 Sat Feb 19 18:43:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
244 * class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT.
245 * constants.c (build_constants_constructor): Likewise.
247 2000-02-19 Anthony Green <green@cygnus.com>
249 * jcf-depend.c (add_entry): Add entries to the end of the list.
251 Wed Nov 03 02:16:00 PST 1999 Pekka Nikander <pekka.nikander@hut.fi>
253 * decl.c (INT_TYPE_SIZE): Define if necessary.
254 (expand_java_return): Handle the case of a native integer smaller
257 2000-02-18 Martin von Loewis <loewis@informatik.hu-berlin.de>
259 * gjavah.c (help): Use GCCBUGURL.
260 * jv-scan.c (help): Likewise.
261 * jcf-dump.c (help): Likewise.
263 Thu Feb 17 14:30:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
265 * jcf-write.c (generate_bytecode_insns): Don't generate empty
268 Thu Feb 17 13:20:58 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
270 * jcf-parse.c (load_class): Call `fatal' if no file containing
271 the target class are found.
273 2000-02-16 Zack Weinberg <zack@wolery.cumb.org>
275 * Makefile.in (PARSE_C, PARSE_SCAN_C): Move dependencies on
276 lex.c, lex.h, and PARSE_H to...
277 (parse.o, parse-scan.o): ...here, respectively.
279 * lex.c: Split out code that may trigger SIGFPE from yylex()
281 * lex.h (JAVA_FLOAT_RANGE_ERROR): Don't set value.
283 2000-02-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
285 * Make-lang.in (jvspec.o): Depend on $(GCC_H), not gcc.h.
287 2000-02-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
289 * parse.y (outer_field_access_p): Stop in time when outer contexts
291 (resolve_qualified_expression_name): Properly qualify *everything*
292 after a package.type to be resoled as expression names.
293 (find_applicable_accessible_methods_list): Save/restore `class' to
294 isolate it from a possible outer context search.
296 2000-02-15 Tom Tromey <tromey@cygnus.com>
298 * gjavah.c (jni_print_char): New function.
299 (print_full_cxx_name): Use it.
300 (decode_signature_piece): Likewise.
301 (print_cxx_classname): Likewise.
303 2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
305 * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
307 (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h.
309 * gjavah.c: Include version.h.
311 * jcf-dump.c: Likewise.
313 * jv-scan.c: Likewise.
315 Sat Feb 12 04:34:04 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
317 * parse.y (outer_field_access_fix): First parameter now a tree
318 node. Check for assignement to final. First argument to
319 build_outer_field_access_fix modified to accomodate prototype.
320 (build_outer_field_access): Don't check for assignment to final
322 (java_complete_lhs): MODIFY_EXPR case: Check for `error_mark_node'
323 possibly returned by outer_field_access_fix. Changed
324 outer_field_access_fix's first argument.
325 (check_final_assignment): $finit$'s context is OK.
326 (patch_unaryop): Use node instead of its line/column value when
327 calling outer_field_access_fix.
329 Fri Feb 11 17:38:26 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
331 * parse.y (interface_declaration:): No longer tagged
332 <node>. Re-installed default action.
333 (class_member_declaration:): Handle inner interfaces.
334 (interface_member_declaration): Handle inner interfaces and
336 (create_interface): Push error if one seen. Suspend parsing
337 context when processing an inner interface.
338 (register_fields): Inner class static field limitations not to
339 apply to inner interfaces.
341 Thu Feb 10 22:07:35 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
343 * jcf-parse.c (load_class): Update `java_error_count' when a
344 class' file can't be found.
345 (parse.y): Avoid (byte)code generation when errors seen.
347 Thu Feb 10 20:10:43 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
349 * parse.y (java_complete_lhs): Handle TRUNC_DIV_EXPR. Ensure `fatal'
350 decodes a valid node.
351 (patch_binop): Handle TRUNC_DIV_EXPR.
353 Thu Feb 10 16:04:26 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
355 * parse.y (resolve_package): New local `acc.' Try to progressively
356 build and guess a package and type name.
358 Thu Feb 10 12:52:09 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
360 * parse.y (find_applicable_accessible_methods_list): Load and
361 layout the search class if necessary.
362 (java_complete_tree): Keep to original type of the folded initial
365 2000-02-09 Alexandre Petit-Bianco <apbianco@cygnus.com>
367 * class.c (layout_class): Set and test CLASS_BEING_LAIDOUT.
368 Generate error message if circularity is detected. New static
370 * java-tree.h (CLASS_BEING_LAIDOUT): New flag usage, new macro. *
371 * jcf-write.c (generate_bytecode_insns): Very simply handle
373 * parse.y (java_check_circular_reference): Use
374 `cyclic_inheritance_report' during report, if necessary.
375 (java_complete_lhs): fixed comment with `THROW_EXPR:' case. Avoid
376 walking NEW_ARRAY_INIT twice.
378 2000-02-09 Tom Tromey <tromey@cygnus.com>
380 * parse.y (check_class_interface_creation): Allow inner classes to
381 be `private' or `protected', check modifiers' consistency. Prevent
382 block local classes from bearing any modifiers.
384 2000-02-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
386 * except.c (check_start_handlers): Re-add prototype lost in last
388 (maybe_start_try): Remove excess argument to `check_start_handlers'.
390 2000-02-09 Andrew Haley <aph@cygnus.com>
392 * decl.c (clear_binding_level): Remove excess initializer.
393 (maybe_poplevels): Remove unused variable.
394 (force_poplevels): Ditto.
395 (struct binding_level): Add comment.
397 2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
399 * jcf-write.c (generate_classfile): Don't consider
400 pre-initialization with reference value (use <clinit> instead.)
401 * parse.y (java_fix_constructors): No generated constructor for
403 (build_outer_field_access): Removed debug message.
404 (outer_field_expanded_access_p): Adapted to bytecode generation.
405 (build_outer_field_access_method): Use fix_method_argument_names.
406 (build_outer_method_access_method): Fixed indentation. Added
407 comment. Handle access method generation for static and also void
409 (build_access_to_thisn): Inserted debug message.
410 (maybe_build_thisn_access_method): Use fix_method_argument_names.
411 (resolve_qualified_expression_name): Fixed comment.
412 (not_accessible_p): Adapted to bytecode generation. Added comment.
413 (patch_method_invocation): Added comment.
414 (maybe_use_access_method): Fixed leading comment. Handle static
416 (java_complete_lhs): Don't shortcut handling of initialized upon
417 declaration String type static fields when generating bytecode.
418 (patch_unaryop): Handle outer field access when generating
421 Thu Feb 3 20:23:19 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
423 * java-tree.h (FIELD_THISN): New macro.
424 * jcf-write.c (append_synthetic_attribute): New function.
425 (generate_classfile): Set "Synthetic" attribute on this$<n>,
426 val$<name> fields, access$<n> and $finit$ methods. Fixed indentation.
427 * parse.y (add_inner_class_fields): Set FIELD_THISN for created
429 (build_outer_field_access): Turned on access functions usage and
430 generation when compiling to bytecode.
431 (maybe_use_access_method): Likewise.
433 2000-01-25 Andrew Haley <aph@cygnus.com>
435 * java-except.h (struct eh_range): Add `expanded' field.
436 (maybe_start_try): Add end_pc arg.
437 (maybe_end_try): Ditto.
438 * java-tree.h (force_poplevels): new function.
439 * expr.c (expand_byte_code): Don't call maybe_start_try or
441 * except.c (add_handler): Reset expanded.
442 (expand_start_java_handler): Set expanded.
443 (check_start_handlers): Don't expand a start handler that's
444 already been expanded.
445 (maybe_start_try): Add end_pc arg. Only expand a handler which
447 (expand_end_java_handler): call force_poplevels.
448 (force_poplevels): new function.
449 * decl.c (binding_level): Add start_pc of binding level.
450 (maybe_pushlevels): Call maybe_start_try when pushing binding
452 (maybe_poplevels): Call maybe_end_try when popping binding levels.
453 (LARGEST_PC): Define.
454 (clear_binding_level): Use LARGEST_PC.
456 * java-tree.h (DEBUG_JAVA_BINDING_LEVELS): new define.
457 * decl.c (DEBUG_JAVA_BINDING_LEVELS): new define.
458 (binding_depth, is_class_level, current_pc): new variables.
459 (struct binding_level): ditto.
460 (indent): new function.
461 (push_jvm_slot): add debugging info.
462 (maybe_pushlevels): ditto.
463 (maybe_poplevels): ditto.
466 (start_java_method): ditto.
467 (give_name_to_locals): comment only.
468 * except.c (binding_depth, is_class_level, current_pc):
470 (expand_start_java_handler): add debugging info.
471 (expand_end_java_handler): ditto.
473 2000-02-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
475 * gjavah.c (overloaded_jni_method_exists_p): Add prototype.
476 (print_name_for_stub_or_jni, process_file): Constify a char*.
478 2000-02-03 Tom Tromey <tromey@cygnus.com>
480 * jcf-io.c (jcf_print_utf8_replace): Handle UTF-8 input.
482 2000-01-31 Scott Bambrough <scottb@netwinder.org>
484 * gcc/java/javaop.h (WORDS_TO_DOUBLE): Allow WORDS_TO_DOUBLE to
485 assemble doubles correctly when HOST_FLOAT_WORDS_BIG_ENDIAN is
488 Wed Feb 2 18:43:37 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
490 * java-tree.def (INSTANCE_INITIALIZERS_EXPR): New tree code.
491 * java-tree.h (TYPE_II_STMT_LIST): New macro.
492 (struct lang_type): New field `ii_block'.
493 * lex.c (java_init_lex): Use CPC_INITIALIZER_LIST,
494 CPC_STATIC_INITIALIZER_LIST and CPC_INSTANCE_INITIALIZER_LIST.
495 * parse.h (struct parser_ctxt): New field `instance_initializers'.
496 (CPC_INITIALIZER_LIST, CPC_STATIC_INITIALIZER_LIST,
497 CPC_INSTANCE_INITIALIZER_LIST, CPC_INITIALIZER_STMT,
498 CPC_STATIC_INITIALIZER_STMT, CPC_INSTANCE_INITIALIZER_STMT): New
500 * parse.y (add_instance_initializer): New function.
501 (in_instance_initializer): New static global.
502 (class_body_declaration:): Link instance initializer block.
503 (static_initializer:): Use CPC_STATIC_INITIALIZER_STMT.
504 (array_creation_expression:): Remove unused local.
505 (java_parser_context_push_initialized_field): Fixed leading
506 comment. Use CPC_STATIC_INITIALIZER_LIST, CPC_INITIALIZER_LIST and
507 CPC_INSTANCE_INITIALIZER_LIST.
508 (java_parser_context_pop_initialized_field): Likewise.
509 (add_inner_class_fields): Use CPC_INITIALIZER_STMT.
510 (register_fields): Use CPC_STATIC_INITIALIZER_STMT and
511 CPC_INITIALIZER_STMT.
512 (fix_constructors): New local `class_type'. Use it. Call
513 add_instance_initializer.
514 (java_complete_lhs): New case INSTANCE_INITIALIZERS_EXPR.
515 (patch_return): Forbid return in instance initializers.
516 (patch_throw_statement): Enforce exception handling in the context
517 of instance initializers.
519 2000-02-03 Tom Tromey <tromey@cygnus.com>
521 * Make-lang.in (java.mostlyclean): Remove executables in
524 2000-01-31 Scott Bambrough <scottb@netwinder.org>
526 * gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
527 HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
528 (java_float_finite): Convert to use union Word from javaop.h.
529 (java_double_finite): Convert to use union DWord from javaop.h.
531 2000-02-02 Tom Tromey <tromey@cygnus.com>
533 * gjavah.c (options): Added `jni' entry.
534 (help): Document -jni.
535 (flag_jni): New global.
536 (process_file): Handle JNI output. Don't print text from
537 -prepend, -add, etc, when generating stubs. Only remove `.class'
538 suffix if it actually exists.
539 (main): Create a `.c' file when run with `--jni --stubs'. Create
540 correct output file name with `--jni'.
541 (print_include): Mangle header name differently in JNI case.
542 (HANDLE_METHOD): In JNI mode, call print_method_info to generate
544 (print_method_info): Handle JNI case. Put signature info into
545 method name. Handle case when STREAM is NULL.
546 (print_name_for_stub_or_jni): New function.
547 (print_stub_or_jni): Renamed from `print_stub'. Handle JNI.
548 (print_cxx_classname): Handle JNI.
549 (print_full_cxx_name): Likewise.
550 (decode_signature_piece): Likewise.
551 (overloaded_jni_method_exists_p): New function.
552 (struct method_name): Added `signature' and `sig_length' fields.
553 (HANDLE_END_FIELD): Do nothing in JNI mode.
555 2000-02-02 Tom Tromey <tromey@cygnus.com>
557 * jv-scan.c: Include version.c, <getopt.h>.
558 (LONG_OPT, OPT_HELP, OPT_VERSION): New macros.
559 (options): New array.
560 (usage): New function.
561 (version): New function.
562 (main): Use getopt_long to parse command line.
563 * jcf-dump.c: Include version.c, <getopt.h>.
564 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_VERSION,
565 OPT_JAVAP): New macros.
566 (options): New array.
567 (usage): Return `void'. Changed message.
568 (help): New function.
569 (version): New function.
570 (main): Use getopt_long_only to parse command line.
571 * gjavah.c: Include <getopt.h>.
572 (LONG_OPT, OPT_classpath, OPT_CLASSPATH, OPT_HELP, OPT_TEMP,
573 OPT_VERSION, OPT_PREPEND, OPT_FRIEND, OPT_ADD, OPT_APPEND, OPT_M,
574 OPT_MM, OPT_MG, OPT_MD, OPT_MMD): New macros.
575 (options): New array.
576 (java_no_argument): Removed.
577 (help): Updated with missing options.
578 (main): Use getopt_long_only to parse command line.
579 (usage): Changed message.
581 Tue Feb 1 22:23:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
583 * java-tree.def (NEW_ANONYMOUS_ARRAY_EXPR): New tree code.
584 * parse.h (ANONYMOUS_ARRAY_BASE_TYPE, ANONYMOUS_ARRAY_DIMS_SIG,
585 ANONYMOUS_ARRAY_INITIALIZER): New access macros.
586 * parse.y (array_creation_expression:): Handle anonymous arrays.
587 (build_array_from_name): Don't set `ret_name' if null.
588 (resolve_qualified_expression_name): New case NEW_ANONYMOUS_ARRAY_EXPR.
589 (qualify_ambiguous_name): Likewise.
590 (java_complete_expand_class): Likewise.
592 Tue Feb 1 14:59:35 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
594 * java-tree.def (SYNCHRONIZED_EXPR): Fixed typo.
595 * parse.h (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID): New macro.
596 (MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR): Likewise.
597 (SKIP_THIS_AND_ARTIFICIAL_PARMS): Use DECL_FINIT_P.
598 (AIPL_FUNCTION_FINIT_INVOCATION): Replaces
599 AIPL_FUNCTION_COMPLETED_INVOCATION.
600 (AIPL_FUNCTION_CTOR_INVOCATION): Replaces
601 AIPL_FUNCTION_INVOCATION_READY.
602 (AIPL_FUNCTION_DECLARATION): New enum entry.
603 * parse.y (reorder_static_initialized): New function.
604 (java_parser_context_pop_initialized_field): Use it.
605 (add_inner_class_fields): Use
606 MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID. Comment
607 augmented. Install marker after last alias initializer, if any.
608 (generate_finit): Fixed typo. Don't try to retain only the used
610 (method_header): Compute and set DECL_FUNCTION_NAP.
611 (method_declarator): Fixed comment. Insert alias initializer in
613 (build_alias_initializer_parameter_list): Fixed leading
614 comment. New case for AIPL_FUNCTION_DECLARATION. Old enum value
615 replaced by new ones. Use MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_ID.
616 (java_complete_expand_class): Code to retain only used aliases
618 (java_complete_expand_methods): New local `first_decl'. Generate
619 $finit$ first, then expand the constructors, regular methods and
621 (java_complete_expand_method): Don't report error on missing
622 return statement if previously detected bogus.
623 (fix_constructors): Don't patch constructor parameters list.
624 (patch_method_invocation): Use new AIPL enum values. Reverse
625 alias initializer list for anonymous classes.
627 2000-01-30 Anthony Green <green@redhat.com>
629 * jcf-write.c (generate_bytecode_insns): Use TYPE_IS_WIDE to
630 determine how many stack slots to pop.
632 2000-01-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
634 * parse.y (formal_parameter:): Set `$$' to NULL_TREE for better
635 error handling/recovery.
636 * java-tree.h (SYNCHRONIZED_EXPR): Fixed typo in comment.
638 Fri Jan 28 20:10:57 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
640 * java-tree.h (ARG_FINAL_P, FIELD_LOCAL_ALIAS,
641 FIELD_LOCAL_ALIAS_USED): New macros.
642 (DECL_FUNCTION_NAP): New macro.
643 (struct lang_decl): New field `nap'.
644 (TYPE_FINIT_STMT_LIST, TYPE_CLINIT_STMT_LIST): New macros.
645 (struct lang_type): New fields `finit_stmt_list' and
647 (CLASS_HAS_FINIT_P): Defined using TYPE_FINIT_STMT_LIST.
648 * parse.h (MANGLE_OUTER_LOCAL_VARIABLE_NAME): New macro.
649 (SKIP_THIS_AND_ARTIFICIAL_PARMS, MARK_FINAL_PARMS,
650 UNMARK_FINAL_PARMS, CRAFTED_PARAM_LIST_FIXUP): New macros.
651 (AIPL_FUNCTION_CREATION, AIPL_FUNCTION_COMPLETED_INVOCATION,
652 AIPL_FUNCTION_INVOCATION_READY): New enum fields.
653 (BUILD_THROW): Macro line separator re-indented.
654 * parse.y (end_class_declaration): New function.
655 (maybe_generate_pre_expand_clinit): New name for
656 java_pre_expand_clinit. Create <clinit> off TYPE_CLINIT_STMT_LIST,
657 pre-expand static fields.
658 (maybe_generate_clinit): Function deleted.
659 (check_for_static_method_reference): Prototype's parameter list
661 (generate_finit): New name for maybe_generate_finit. Changed
662 leading comment. Function rewritten to use
663 TYPE_FINIT_STMT_LIST. Call build_alias_initializer_parameter_list.
664 (build_alias_initializer_parameter_list): New function.
665 (java_parser_context_pop_initialized_field): Likewise.
666 (add_inner_class_fields): Likewise.
667 (type_declaration:): Call end_class_declaration.
668 (class_member_declaration:): Likewise.
669 (formal_parameter_list:): Fixed typos.
670 (formal_parameter:): Use ARG_FINAL_P to mark created tree list
671 element. Improved error handling.
672 (block_statement:): Call end_class_declaration.
673 (anonymous_class_creation:): Likewise.
674 (create_anonymous_class): Fixed comments.
675 (create_class): Call add_inner_class_fields.
676 (register_fields): Set FIELD_LOCAL_ALIAS according to ARG_FINAL_P.
677 (method_header): Use MARK_FINAL_PARMS.
678 (finish_method_declaration): Use UNMARK_FINAL_PARMS.
679 (method_declarator): Propagate final argument flag.
680 (craft_constructor): New local `artificial'. Call
681 build_alias_initializer_parameter_list. Use
682 CRAFTED_PARAM_LIST_FIXUP, assign DECL_FUNCTION_NAP.
683 (source_start_java_method): Mark parm decls with LOCAL_FINAL if
685 (complete_expand_class): Get rid of unused outer context local
687 (java_complete_expand_methods): Fixed leading
688 comment. Generate/pre-expand <clinit> first. Changed method
689 expansion order to regular, $finit$, constructors, <clinit>.
690 (java_complete_expand_method): Set current_function_decl.
691 (fix_constructors): Fix constructor parameter list to account for
692 outer context local alias initializers.
693 (verify_constructor_super): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
694 (resolve_expression_name): Lookup outer context local aliases. New
695 local `access', use it.
696 (patch_method_invocation): Patch inner class ctor invocation with
697 outer context local aliases initialization values. $finit$
698 invocation patching now includes things generated with
699 build_alias_initializer_parameter_list.
700 (argument_types_convertible): Use SKIP_THIS_AND_ARTIFICIAL_PARMS.
701 (build_super_invocation): Likewise.
702 (patch_assignment): Changed comment.
704 2000-01-27 Andrew Haley <aph@cygnus.com>
706 * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
710 2000-01-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
712 * parse.h (OBSOLETE_MODIFIER_WARNING): Don't use ANSI string
714 (OBSOLETE_MODIFIER_WARNING2): New macro allowing two args.
716 * parse.y (register_fields): Don't pass a format specifier to
717 OBSOLETE_MODIFIER_WARNING.
718 (check_abstract_method_header): Use OBSOLETE_MODIFIER_WARNING2
719 instead of OBSOLETE_MODIFIER_WARNING, and don't pass a format
721 (check_modifiers): Change function into a macro.
722 (check_class_interface_creation): Pass a literal format string.
724 2000-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
726 * buffer.h: PROTO -> PARAMS.
727 * check-init.c: Likewise.
729 * constants.c: Likewise.
730 * convert.h: Likewise.
732 * except.c: Likewise.
734 * gjavah.c: Likewise.
735 * java-except.h: Likewise.
736 * java-tree.h: Likewise.
737 * jcf-depend.c: Likewise.
738 * jcf-dump.c: Likewise.
739 * jcf-parse.c: Likewise.
740 * jcf-path.c: Likewise.
741 * jcf-reader.c: Likewise.
742 * jcf-write.c: Likewise.
744 * jv-scan.c: Likewise.
745 * jvgenmain.c: Likewise.
746 * jvspec.c: Likewise.
750 * parse-scan.y: Likewise.
753 * typeck.c: Likewise.
754 * verify.c: Likewise.
757 * zextract.c: Likewise.
758 * zipfile.h: Likewise.
760 2000-01-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
762 * class.c (make_class): Use MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
763 (is_compiled_class): Remove test on TYPE_LANG_SPECIFIC, use TYPE_JCF.
764 * constants.c (build_constant_data_ref): Check for cached
765 current_constant_pool_data_ref. Cache current_constant_pool_data_ref
766 in TYPE_CPOOL_DATE_REF.
767 * java-tree.h (TYPE_JCF, TYPE_CPOOL, TYPE_CPOOL_DATA_REF,
768 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC:) New macros.
769 (struct lang_type): New fields `cpool' and `cpool_data_ref'.
770 (LOCAL_FINAL): New macro.
771 * jcf-parse.c (init_outgoing_cpool): Always allocate new outgoing
772 constant pool -- don't try to reuse.
773 (parse_zip_file_entries): Use TYPE_JCF, don't lazily allocate
775 (find_in_current_zip): Use TYPE_JCF.
776 * parse.h (java_check_final): Prototype removed.
777 * parse.y (create_class): Reversed Jan 12, 2000 extra argument patch.
778 (maybe_create_class_interface_decl,
779 check_class_interface_creation): Likewise.
780 (java_expand_finals): Function removed.
781 (class_declaration:): Reversed Jan 12, 2000 extra argument patch.
782 (block_statement:): Fixed comment.
783 (anonymous_class_creation:): Likewise.
784 (check_class_interface_creation): Reversed Jan 12, 2000 extra
786 (check_class_interface_creation): Loosened error report on (inner)
787 public class declarations. CPC_INNER_P replaces GET_CPC_LIST.
788 (link_nested_class_to_enclosing): Reversed Jan 12, 2000 patch.
789 (maybe_create_class_interface_decl): Reversed Jan 12, 2000 extra
791 (create_interface): Likewise.
792 (anonymous_class_counter): New static global.
793 (create_anonymous_class): Reversed Jan 12, 2000 extra argument
794 patch. Fixed comments.
795 (create_class): Reversed Jan 12, 2000 extra argument patch. Reset
796 anonymous_class_counter when declaring a toplevel class.
797 (craft_constructor): Fixed constructor name when handling
798 anonymous classes. Anonymous class constructors to feature hidden
800 (java_fix_constructors): Added comment.
801 (java_check_final): Function removed.
802 (java_complete_expand_methods): Fixed comment. Don't generate
803 class data, save its outgoing constant pool instead.
804 (verify_constructor_super): Skip anonymous class constructor
805 hidden this$<n> parameter.
806 (java_expand_classes): New local `saved_ctxp'. Removed call to
807 java_expand_finals and java_check_final. Expand anonymous class
808 constructors. Generate class data.
809 (build_super_invocation): Skip anonymous class hidden this$<n>
811 * typeck.c (build_java_signature): Use TYPE_SIGNATURE and
812 MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC.
813 (set_java_signature): Likewise.
815 Mon Jan 18 14:30:09 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
817 * gjavah.c: Delete ACC_VISIBILITY define.
818 * jcf.h: Add ACC_VISIBILITY define.
819 * parse.y: final: rule tagged <value>.
820 (java_check_regular_methods): Use ACC_VISIBILITY define for
821 default package access check.
822 (local_variable_declaration_statement): Use final: rule.
824 Mon Jan 17 11:58:17 2000 Joerg Brunsmann <joerg.brunsmann@fernuni-hagen.de>
826 * parse.y (format_parameter:): Use final: rule instead of modifiers:.
829 2000-01-17 Tom Tromey <tromey@cygnus.com>
831 * gjavah.c (print_field_info): Allow non-static final fields.
833 Fri Jan 14 18:03:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
835 * parse.h (enum jdep_code): New entry `JDEP_ANONYMOUS'.
836 * parse.y (patch_anonymous_class): New function.
837 (create_anonymous_class): Register incomplete type when the
838 class/interface to extends/implement isn't known yet.
839 (parser_check_super_interface): Simplify argument to CLASS_INTERFACE.
840 (verify_constructor_super): Tuned error message.
842 Fri Jan 14 00:14:24 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
844 * java-tree.h (FOR_LOOP_P): Replaces IS_FOR_LOOP_P.
845 (ANONYMOUS_CLASS_P): New macro.
846 (TYPE_SIGNATURE, TYPE_JCF): New macros.
847 (INNER_CLASS_TYPE_P): Fixed typo in leading comment.
848 * parse.y (create_class): Added leading argument.
849 (maybe_create_class_interface_decl,
850 check_class_interface_creation): Likewise.
851 (craft_constructor): New function.
852 (verify_constructor_super): Added argument in prototype.
853 (class_declaration:): Inserted leading argument.
854 (for_begin:): Use FOR_LOOP_P.
855 (anonymous_class_creation): Create WFL of the anonymous class to
856 instantiate. Call build_new_invocation. Added comments.
857 (check_class_interface_creation): Handle parameter `anonymous' in
858 verbose mode class creation announce.
859 (link_nested_class_to_enclosing): Exclude anonymous classes.
860 (maybe_create_class_interface_decl): Don't set DECL_CONTEXT on
861 anonymous class, even though they appear to have an enclosing
863 (create_interface): Pass extra argument to
864 check_class_interface_creation.
865 (create_anonymous_class): Set ANONYMOUS_CLASS_P to 1.
866 (create_class): Call check_class_interface_creation and
867 maybe_create_class_interface_decl with extra new argument. Don't
868 add private this$<n> to anonymous classes.
869 (method_declarator): Insert hidden this$<n> to anonymous class
871 (java_fix_constructors): Deleted code creating default
872 constructor. Call craft_constructor instead.
873 (java_check_regular_methods): Set `saw_constructor' to 1 for
875 (fix_constructors): Pass extra argument to verify_constructor_super.
876 (verify_constructor_super): New local `sdecl', use it. Search for
877 matching constructor (possibly featuring arguments) in super
879 (lookup_method_invoke): Craft constructor according to arguments
880 list when dealing with anonymous class constructors.
881 (build_super_invocation): Pass arguments to anonymous class super
883 (search_loop): Use FOR_LOOP_P.
884 (labeled_block_contains_loop_p): Likewise.
886 Wed Jan 12 00:38:47 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
888 * class.c (set_super_info): Set CLASS_STATIC when appropriate.
889 (enclosing_context_p): New function.
890 (get_access_flags_from_decl): Handle CLASS_STATIC.
891 (maybe_layout_super_class): Extra first argument passed to
893 (layout_class_method): Use ID_FINIT_P, DECL_CLINIT_P and
895 * decl.c (access0_identifier_node): New global.
896 (init_decl_processing): access0_identifier_node initialized.
897 (pushdecl): Set DECL_CONTEXT only on non type decls.
898 * expr.c (lookup_field): Lookup inner class fields in enclosing
900 (expand_invoke): Use ID_INIT_P.
901 (expand_java_field_op): Use DECL_CLINIT_P.
902 * java-tree.def (CLASS_LITERAL): New tree code.
903 * java-tree.h (DECL_FUNCTION_ACCESS_DECL,
904 DECL_FUNCTION_INNER_ACCESS, FIELD_INNER_ACCESS): New macros.
905 (struct lang_decl): New field `inner_access'.
906 (enclosing_context_p): Prototyped.
907 (DECL_INIT_P, DECL_FINIT_P, DECL_CLINIT_P, ID_INIT_P, ID_FINIT_P,
908 ID_CLINIT_P): New macros.
909 (CLASS_STATIC): New macro.
910 (CLASS_ACCESS0_GENERATED_P): New macro.
911 (OUTER_FIELD_ACCESS_IDENTIFIER_P, INNER_CLASS_DECL_P,
912 TOPLEVEL_CLASS_DECL_P, INNER_CLASS_TYPE_P, TOPLEVEL_CLASS_TYPE_P,
913 INNER_CLASS_P): New macros.
914 (DECL_INNER_CLASS_LIST): New macro.
915 * jcf-parse.c (yyparse): Avoid the use of ANSI string
917 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
918 the shift value to int. Fixed typo in comment.
919 * lex.c (inst_id, wpv_id): Initialize.
920 * mangle.c (unicode_mangling_length): Take `$' into account.
921 * parse.h (DRECOVER, RECOVER): Terminate properly.
922 (IDENTIFIER_INNER_CLASS_OUTER_FIELD_ACCESS): New macro.
923 (typedef struct _jdep): New field `enclosing'.
924 (JDEP_ENCLOSING): New macro.
925 (IS_CLINIT): Deleted (DECL_CLINIT_P replaces it.)
926 (struct parser_ctxt): New fields `marker_beginning', `marked_end'.
927 (GET_CPC_LIST, CPC_INNER_P, GET_CPC, GET_CPC_UN, GET_CPC_UN_MODE,
928 GET_CPC_DECL_NODE, GET_ENCLOSING_CPC, GET_NEXT_ENCLOSING_CPC,
929 GET_ENCLOSING_CPC_CONTEXT): New macros.
930 (PUSH_CPC, PUSH_ERROR, POP_CPC): New macros.
931 (do_resolve_class): Added extra argument in prototype.
932 * parse.y (resolve_class): Added extra argument in prototype.
933 (maybe_create_class_interface_decl): Likewise.
934 (maybe_use_access_method, build_wfl_wrap): New functions.
935 (java_complete_expand_classes, java_complete_expand_class):
937 (java_parser_context_push_initialized_field,
938 java_parser_context_suspend, java_parser_context_resume):
940 (maybe_make_nested_class_name, make_nested_class_name,
941 set_nested_class_simple_name_value,
942 link_nested_class_to_enclosing, find_as_inner_class,
943 find_as_inner_class_do, check_inner_class_redefinition,
944 build_thisn_assign, build_current_thisn, build_access_to_thisn,
945 maybe_build_thisn_access_method, build_outer_field_access,
946 build_outer_field_access_methods, build_outer_field_access_expr,
947 build_outer_method_access_method, build_new_access_id,
948 build_outer_field_access_method, outer_field_access_p,
949 outer_field_expanded_access_p, outer_field_access_fix,
950 build_incomplete_class_ref, patch_incomplete_class_ref,
951 create_anonymous_class): Likewise.
952 (inst_id, wpv_id): New static global variables.
953 (synchronized:): New rule, tagged <node>.
954 (type_declaration:): No longer tagged <node>. Call POP_CPC in sub
956 (anonymous_class_creation:): New rule, tagged <node>.
957 (NEW_TK): Tagged <node>.
958 (type_literals, array_type_literal): New rules, tagged <node>.
959 (class_declaration:): Removed action when reducing by class_body:
960 (class_body:): Set DECL_END_SOURCE_LINE and rule's returned value
961 using GET_CPC in sub-rules.
962 (class_member_declaration): Handle inner classes.
963 (method_declaration): When reducing method_header:, reset
964 current_function_decl when appropriate.
965 (method_declarator:): Set the number of formal parameter to 0 for
966 method declared without arguments.
967 (constructor_declarator:): Likewise.
968 (static_initializer:): List of elements kept in a list.
969 (static:): Rule modifiers: replaces MODIFIER_TK. Enforce correct
970 use of the keyword `static' for type declarations.
971 (block_statement:): Handle inner class declarations.
972 (primary_no_new_array:): Use type_literals:. Fixed comment. Handle
973 type qualified `this'.
974 (class_instance_creation_expression): Use anonymous_class_creation:
975 to handle inner class instances creation. Handle qualified `new'.
976 (something_dot_new): Added appropriate actions.
977 (create_new_parser_context): New function.
978 (java_push_parser_context, java_parser_context_save_global,
979 java_parser_context_suspend): Use create_new_parser_context.
980 (check_modifiers): Changed leading comment.
981 (check_class_interface_creation): Handle interclasses.
982 (add_superinterfaces): Fixed comment.
983 (create_interface): Build qualified name from the raw_name instead
984 of its matching WFL. Push the initialized fields list. raw_name added
985 as an extra argument to maybe_create_class_interface_decl.
986 (create_class): Build qualified name from the raw_name instead of
987 its matching WFL. Removed assignment to current_parsed_class_un.
988 Call PUSH_ERROR before returning an error. Suspend the current
989 parser context when processing an inner class. Push the
990 initialized fields list. raw_name added as an extra argument to
991 maybe_create_class_interface_decl. Add the private this$<n>
993 (duplicate_declaration_error_p): Use GET_CPC when calling find_field.
994 (register_fields): Get the class type from GET_CPC and handle
995 previous errors. Added code to handle the creation of static
996 fields in inner classes. Initialized fields initialization
997 statements kept in a list of lists.
998 (maybe_generate_finit): Initialized fields initialization
999 statements kept in a list of lists. Use GET_CPC.
1000 (maybe_generate_clinit): Likewise.
1001 (method_header): Use GET_CPC and GET_CPC_UN.
1002 (parser_qualified_classname): Handle inner classes.
1003 (register_incomplete_type): Set JDEP_ENCLOSING using GET_CPC.
1004 (java_fix_constructors): Hide pointer to enclosing context
1005 instance in constructor list when dealing with inner classes.
1006 (jdep_resolve_class): Call resolve_class with extra first argument
1008 (resolve_class): Add enclosing context as a first extra argument
1009 to do_resolve_class.
1010 (do_resolve_class): Call find_as_inner_class. Handle WFLs
1012 (resolve_no_layout): Extra argument added to resolve_class
1014 (reset_method_name): Use DECL_CLINIT_P, DECL_FINIT_P.
1015 (java_get_real_method_name): Use GET_CPC_UN.
1016 (check_abstract_method_definitions): Use DECL_CLINIT_P.
1017 (java_check_abstract_methods): Handle static method declared in
1018 inner classes by an error.
1019 (java_check_regular_methods): Use DECL_CLINIT_P.
1020 (source_start_java_method): Also set DECL_MAX_LOCALS.
1021 (create_artificial_method): Call java_parser_context_save_global
1022 and java_parser_context_restore_global instead of saving/restoring
1023 the context by hand.
1024 (expand_start_java_method): Improved verbose mode message.
1025 (java_complete_expand_methods): Fixed leading comment. Use
1027 (fix_constructors): Added assignment to this$<n> if necessary.
1028 (java_expand_classes): Call java_complete_expand_classes instead
1029 of java_complete_expand_methods.
1030 (make_qualified_primary): Simplified.
1031 (merge_qualified_name): Optimized for missing left or right parts.
1032 (resolve_expression_name): Handle access to outer class fields from
1034 (resolve_qualified_expression_name): New macro
1035 RESTORE_THIS_AND_CURRENT_CLASS, used. Handle creation of inner
1036 classes. Report error on non appropriate qualification of
1037 `new'. Handle qualified `this'.
1038 (not_accessible_p): Allow access to outer class private fields from
1040 (patch_method_invocation): Handle method invocations through
1041 access methods and inner class constructor invocations.
1042 (find_applicable_accessible_methods_list): Search enclosing
1043 contexts of an inner class.
1044 (search_applicable_methods_list): Fixed typo.
1045 (argument_types_convertible): Handle inner class constructors'
1046 hidden outer context reference argument.
1047 (qualify_ambiguous_name): Handle qualified `this'.
1048 (java_complete_lhs): Handle use of field accessed through
1049 artificial access methods in various cases of assignments. Handle
1051 (check_final_assignment): Use DECL_CLINIT_P.
1052 (valid_ref_assignconv_cast_p): Handle the destination being an
1053 enclosing context of the source.
1054 (patch_unaryop): Handle use of field accessed through artificial
1056 (patch_return): Use DECL_CLINIT_P.
1057 (patch_throw_statement): Use DECL_CLINIT_P.
1058 (check_thrown_exceptions): Use DECL_FINIT_P and DECL_INIT_P.
1059 * verify.c (verify_jvm_instructions): Use ID_CLINIT_P and
1062 2000-01-16 Anthony Green <green@cygnus.com>
1064 * parse.y (build_string_concatenation): Only use
1065 StringBuffer(String) shortcut if String arg is constant.
1067 Wed Jan 12 20:20:11 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
1069 * jcf-write.c (generate_bytecode_insns): binop: Change the type of
1070 the shift value to int. Fixed typo in comment.
1072 2000-01-11 Mumit Khan <khan@xraylith.wisc.edu>
1074 * jcf-path.c: Delete PATH_SEPARATOR and DIR_SEPARATOR macros.
1075 * jcf-write.c: Likewise.
1076 * parse.y: Likewise.
1077 * parse.c: Regenerate.
1079 2000-01-09 Anthony Green <green@cygnus.com>
1081 * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
1082 bytecodes in the correct order.
1084 2000-01-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1086 * Makefile.in (jcf-dump, gcjh): Move ../errors.o before $(LIBS).
1088 Thu Jan 6 16:31:28 2000 Anthony Green <green@cygnus.com>
1090 * expr.c (java_lang_expand_expr): Switch to permanent obstack
1091 before building constant array decl.
1093 Thu Jan 6 00:54:10 2000 Alexandre Petit-Bianco <apbianco@cygnus.com>
1095 * jcf-write.c (generate_byecode_conditional): Fixed indentation in
1096 method invocation and typo in conditional expression.
1097 (generate_bytecode_insns): COND_EXPR can be part of a binop. Issue
1098 the appropriate NOTE_POP.
1099 * parse.y (patch_binop): Shift value mask to feature the right
1102 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1104 * class.c (assume_compiled, assume_compiled_node): Add static
1106 (add_assume_compiled): Use xmalloc/xstrdup, not malloc/strdup.
1108 * jcf-dump.c (ARRAY_NEW_NUM): Cast long to int in switch.
1110 * jvgenmain.c (usage): Add static prototype with ATTRIBUTE_NORETURN.
1112 * parse.h (OBSOLETE_MODIFIER_WARNING): Rename parameter `modifier'
1113 to `__modifier' to avoid stringifying it.
1115 * parse.y (verify_constructor_circularity): Don't call a variadic
1116 function with a non-literal format string.
1117 (java_check_abstract_methods): Move unreachable code inside
1118 `continue' statement.
1119 (lookup_method_invoke): Call xstrdup, not strdup.
1121 * expr.c (expand_java_field_op): Avoid the use of ANSI string
1124 * jcf-parse.c (yyparse): Likewise.
1126 * jv-scan.c (main): Likewise.
1128 1999-12-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1130 * parse.h (ABSTRACT_CHECK, JCONSTRUCTOR_CHECK,
1131 ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
1132 ERROR_CAST_NEEDED_TO_INTEGRAL): Avoid the use of ANSI string
1135 * parse.y (synchronized, variable_redefinition_error,
1136 check_class_interface_creation, create_interface, create_class,
1137 method_header, finish_method_declaration,
1138 check_modifiers_consistency, method_declarator,
1139 complete_class_report_errors, check_abstract_method_definitions,
1140 java_check_regular_methods, check_throws_clauses,
1141 java_check_abstract_methods, read_import_dir,
1142 check_pkg_class_access, declare_local_variables, fix_constructors,
1143 cut_identifier_in_qualified, resolve_expression_name,
1144 resolve_qualified_expression_name, patch_method_invocation,
1145 java_complete_lhs, patch_assignment, try_builtin_assignconv,
1146 patch_binop, patch_array_ref, patch_newarray, build_labeled_block,
1147 patch_exit_expr, patch_exit_expr, patch_switch_statement,
1148 patch_try_statement, patch_synchronized_statement,
1149 patch_throw_statement, check_thrown_exceptions,
1150 patch_conditional_expr): Likewise.
1152 Fri Dec 24 00:25:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1154 * Makefile.in (LIBDEPS): Added gcc's errors.o
1155 (../jcf-dump$(exeext):): Link with gcc's errors.o
1156 (../gcjh$(exeext):): Likewise.
1157 * expr.c (expand_java_NEW): Layout the entire target type instead of
1158 laying out its methods only.
1159 (lookup_field): Layout the class after having loaded it.
1160 * java-tree.h (java_debug_context): Declared.
1161 * jcf-io.c (toplev.h): Included.
1162 (find_class): Removed assignment to jcf's outofsynch
1163 field. Force source file to be read if newer than its matching
1164 class file. Tweaked debug messages.
1165 * jcf-parse.c (jcf_out_of_synch): Deleted.
1166 (read_class): Call to jcf_out_of_synch removed.
1167 * jcf.h (typedef struct JCF): Field `outofsynch' deleted.
1168 (jcf_out_of_synch): Prototype deleted.
1169 * parse.h (struct parser_ctxt): `minus_seen', `java_error_flag',
1170 `deprecated' and `class_err': integer turned into bit fields.
1171 New bit fields `saved_data_ctx' and `saved_data'. Fixed comments.
1172 * parse.y (package_list): New global.
1173 (package_declaration:): Record newly parsed package name.
1174 (extra_ctxp_pushed_p): Static global deleted.
1175 (java_parser_context_save_global): Create buffer context for the
1176 purpose of saving globals, if necessary.
1177 (java_parser_context_restore_global): Pop context pushed for the
1178 purpose of saving globals, if necessary.
1179 (java_debug_context_do): New prototype and function.
1180 (java_debug_context): Likewise.
1181 (do_resolve_class): Use already parsed package names to qualify
1182 and lookup class candidate.
1183 (java_pre_expand_clinit): Removed unnecessary local variable.
1185 1999-12-17 Tom Tromey <tromey@cygnus.com>
1187 * gjavah.c (decode_signature_piece): Print "::" in JArray<>. This
1189 (process_file): Use `\n\' at end of each line in string.
1191 Thu Dec 16 00:09:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1193 * expr.c (expand_invoke): Layout the loaded class before
1194 attempting to use it.
1195 (expand_java_field_op): Allow final field assignments to take
1197 * typeck.c (convert): Return error_mark_node if expr is null.
1199 1999-12-14 Alexandre Petit-Bianco <apbianco@cygnus.com>
1201 * class.c (class_depth): Return -1 if the class doesn't load
1203 * expr.c (can_widen_reference_to): Check for errors during depth
1204 computation and return 0 accordingly.
1205 * jcf-parse.c (parse_source_file): Call java_fix_constructors to
1206 create default constructors and add an other error check.
1207 * parse.h (java_fix_constructors): Prototyped.
1208 * parse.y (java_pre_expand_clinit): Likewise.
1209 (build_super_invocation): Re-prototyped to feature one argument.
1210 (java_check_circular_reference): Directly use `current'.
1211 (java_fix_constructors): New function.
1212 (java_check_regular_methods): Don't create default constructors
1213 here, but abort if none were found.
1214 (java_complete_expand_methods): Pre-process <clinit> calling
1215 java_pre_expand_clinit.
1216 (java_pre_expand_clinit): New function.
1217 (fix_constructors): build_super_invocation invoked with the
1218 current method declaration as an argument.
1219 (build_super_invocation): Use the context of the processed method
1220 decl argument instead of current_class.
1221 * typeck.c (lookup_java_method): Take WFLs in method names into
1224 Tue Dec 14 14:20:16 1999 Per Bothner <per@bothner.com>
1226 * class.c (make_class_data): flag_keep_inline_functions to keep
1227 private methods in the method array.
1229 1999-12-15 Anthony Green <green@cygnus.com>
1231 * check-init.c (check_init): Take into account both types of
1232 `throw's when checking for uninitialized variables.
1234 Fri Dec 10 21:53:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1236 * parse.y (java_complete_lhs): Force convertion of array
1237 dimensions to int_type_node, that's what runtime's ABI expects.
1239 Fri Dec 10 16:13:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1241 * parse.h (EXPR_WFL_QUALIFICATION): Temporary uses the third
1242 operand of a WFL, until the Java front-end gets fixed with regard
1243 to Mark Mitchell's gcc/tree.h patch (1999-12-04.)
1245 1999-12-10 Andrew Haley <aph@cygnus.com>
1247 * parse.h (BUILD_THROW): Add support for sjlj-exceptions.
1248 decl.c (init_decl_processing): Add _Jv_Sjlj_Throw.
1249 expr.c (build_java_athrow): Add support for sjlj-exceptions.
1253 Wed Dec 8 15:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1255 * expr.c (java_lang_expand_expr): Switch to permanent obstack
1256 before calling expand_eh_region_start and expand_start_all_catch.
1257 * except.c (expand_start_java_handler): Switch to permanent
1258 obstack before calling expand_eh_region_start.
1259 (expand_end_java_handler): Switch to permanent obstack before
1260 calling expand_start_all_catch.
1262 1999-12-5 Anthony Green <green@cygnus.com>
1264 * decl.c (init_decl_processing): Mark throw_node as a noreturn
1265 function with side effects.
1266 (init_decl_processing): Mark all memory allocating DECLs with
1269 Wed Dec 1 04:25:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1271 * except.c (expand_end_java_handler): Call
1272 expand_resume_after_catch and end_catch_handler.
1274 Tue Nov 30 12:36:15 1999 Anthony Green <green@cygnus.com>
1276 * verify.c (verify_jvm_instructions): Create new return label
1277 chain if non existant (don't rely on the verified state of the jsr
1280 Tue Nov 30 12:28:34 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1282 * jcf-write.c (generate_byecode_insns): Fixed indentation for
1283 COMPOUND_EXPR and FIX_TRUNC_EXPR cases.
1285 * parse.y (patch_assignment): Removed bogus final class test on
1286 lhs when checking on whether to emit an ArrayStoreException runtime
1288 * expr.c (expand_java_arraystore): Likewise.
1290 1999-11-28 Anthony Green <green@cygnus.com>
1292 * decl.c (find_local_variable): Reuse single slot decls when
1295 Wed Nov 24 17:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1297 * jcf-parse.c (saw_java_source): Global variable removed.
1298 (read_class): Don't use `saw_java_source'. Added extra braces.
1299 (yyparse): Code setting `saw_java_source' removed.
1301 1999-11-24 Mark Mitchell <mark@codesourcery.com>
1303 * except.c (emit_handlers): Zero catch_clauses after emitting them.
1305 Tue Nov 23 17:29:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1307 * verify.c (merge_type_state): Non verified subroutines being
1308 considered more than once to trigger passive type merge.
1310 Tue Nov 23 10:55:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1312 * parse.y (catch_clause_parameter:): Still set `$$' to NULL_TREE
1313 in case of error. Error message tuned.
1315 1999-11-21 Anthony Green <green@cygnus.com>
1317 * constants.c (find_methodref_index): Unwrap method names before
1318 inserting them in the constant pool.
1320 * jcf-parse.c (jcf_parse): Display `interface' when appropriate.
1322 * class.c (assume_compiled_node): New typedef.
1323 (assume_compiled_tree): New static data.
1324 (find_assume_compiled_node): New function.
1325 (add_assume_compiled): New function.
1326 (assume_compiled): New function.
1327 * class.c (make_class_data): Use assume_compiled.
1328 (is_compiled_class): Use assume_compiled.
1330 * java-tree.h (add_assume_compiled): Declare.
1332 * lang.c (lang_decode_option): Parse new options.
1334 Wed Nov 17 21:09:28 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1336 * class.c (layout_class): Always convert TYPE_SIZE_UNIT to
1337 int_type_node: that's what `_Jv_AllocObject' expects.
1339 Thu Nov 11 01:57:14 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1341 * parse.y (lookup_method_invoke): Use lang_printable_name to
1342 reliably build the type name during error report. Fixes PR gcj/97.
1344 1999-11-09 Tom Tromey <tromey@cygnus.com>
1346 * jcf-path.c: Include <sys/stat.h>.
1347 (jcf_path_init): Search for libjava.zip. Fixes PR gcj/84.
1348 (DIR_UP): New macro.
1350 Tue Nov 9 12:12:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1352 * parse.y (source_end_java_method): Resume permanent allocation,
1353 reversing Apr 27 1998 patch.
1354 (patch_string_cst): Pop obstacks after having pushed the permanent
1357 1999-11-05 Tom Tromey <tromey@cygnus.com>
1359 * class.c (finish_class): Emit inlined methods if any native
1360 methods exist in the class. Fixes PR gcj/85.
1362 Thu Nov 4 16:27:01 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1364 * parse.y (resolve_qualified_expression_name): Handle PLUS_EXPR.
1365 (qualify_ambiguous_name): Likewise.
1367 Wed Nov 3 15:20:02 MST 1999 Godmar Back <gback@cs.utah.edu>
1369 * typeck.c: (lookup_java_method): search all inherited
1370 interfaces when looking up interface method.
1372 Mon Nov 1 23:42:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1374 * parse.y (method_header:): Issue error message for rule `type
1376 (synchronized:): Error report when not using synchronized.
1378 Mon Nov 1 01:32:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1380 * parse.y (resolve_qualified_expression_name): Prevent `this' from
1381 being used before the superclass constructor has been called.
1382 (complete_function_arguments): Use CALL_EXPLICIT_CONSTRUCTOR_P
1383 instead of `CALL_THIS_CONSTRUCTOR_P'.
1385 Sat Oct 30 21:35:13 1999 Todd T. Fries <todd@lighthouse.fries.net>
1387 * check-init.c: Fix typo in comment.
1389 Fri Oct 29 14:35:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1391 * class.c (add_method_1): Set DECL_INLINE to 1 for private, static
1394 Fri Oct 29 14:23:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1396 * parse.y (expression_statement:): Call function to report
1397 improper invocation of a constructor.
1398 (parse_ctor_invocation_error): New function.
1400 1999-10-26 Mark Mitchell <mark@codesourcery.com>
1402 * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS or call
1405 1999-10-21 Tom Tromey <tromey@cygnus.com>
1407 * jvgenmain.c (main): _Jv_Compiler_Properties now an extern; set
1408 in generated `main'.
1410 Thu Oct 21 01:27:31 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1412 * parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
1413 (qualify_ambiguous_name): Likewise.
1415 Wed Oct 20 01:41:47 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1417 * parse.y (java_complete_tree): fold_constant_for_init to work on
1419 (java_complete_lhs): Likewise.
1420 (array_constructor_check_entry): Complete an initializer element
1421 on permanent_obstack.
1423 1999-10-19 Tom Tromey <tromey@cygnus.com>
1425 * jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
1426 From Mike Moreton <mike@pillim.demon.co.uk>.
1428 1999-10-15 Greg McGary <gkm@gnu.org>
1430 * java-tree.h (flag_bounds_check): Remove extern decl.
1431 * lang.c (flag_bounds_check): Remove global variable.
1432 (lang_f_options): Remove "bounds-check" entry.
1433 (lang_init_options): Default flag_bounds_check to "on".
1435 1999-10-14 Tom Tromey <tromey@cygnus.com>
1437 * jvgenmain.c (usage): New function.
1438 (main): Use it. Also, handle `-D' options.
1439 * jvspec.c (lang_specific_driver): Recognize -D.
1440 (jvgenmain_spec): Added `%{D*}' to jvgenmain invocation.
1442 * jvspec.c (jvgenmain_spec): Use `%umain', not just `%u'.
1444 1999-10-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1446 * jcf-dump.c (print_constant, disassemble_method): Don't call a
1447 variadic function with a non-literal format string.
1449 * parse-scan.y (report_main_declaration): Likewise.
1451 * parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.
1453 * parse.y (read_import_dir, patch_assignment, patch_binop,
1454 patch_array_ref): Likewise.
1456 * typeck.c (build_java_array_type): Likewise.
1458 * verify.c (verify_jvm_instructions): Likewise.
1460 Tue Oct 12 22:28:10 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1462 * jcf-write.c (RELOCATION_VALUE_1): Fixed integer value from 0 to 1.
1464 1999-10-07 Anthony Green <green@cygnus.com>
1466 * jcf-write.c (generate_classfile): Use UNSAFE_PUTx in cases
1467 where CHECK_PUT may fail for valid reasons.
1469 * jcf-write.c (UNSAFE_PUT1, UNSAFE_PUT2, UNSAFE_PUT3,
1470 UNSAFE_PUTN): New macros.
1472 1999-10-04 Tom Tromey <tromey@cygnus.com>
1474 * lex.h (BUILD_OPERATOR2): Return ASSIGN_ANY_TK in `lite' case as
1475 well. Fixes Java PR gcj/59.
1476 * parse-scan.y (yyerror): Report errors.
1478 Fri Sep 24 12:23:05 1999 Glenn Chambers <GChambers@provsol.com>
1480 * decl.c (insert_block): Remove unconditional `abort'.
1482 Fri Sep 24 10:48:10 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1484 * decl.c (builtin_function): No longer static. New arg CLASS. Arg
1485 FUNCTION_CODE now of type int. All callers changed.
1486 Set the builtin's DECL_BUILT_IN_CLASS.
1488 1999-09-23 Tom Tromey <tromey@cygnus.com>
1490 * jvspec.c (lang_specific_driver): Don't read spec file if
1491 -fsyntax-only given.
1493 1999-09-22 Tom Tromey <tromey@cygnus.com>
1495 * lang-specs.h: Added `%(jc1)' to the jc1 spec.
1497 * javaop.h (WORD_TO_FLOAT): Use `inline' unconditionally.
1498 (WORDS_TO_LONG): Likewise.
1499 (WORDS_TO_DOUBLE): Likewise.
1501 Tue Sep 14 16:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1503 * jcf-write.c (RELOCATION_VALUE_0): New macro.
1504 (RELOCATION_VALUE_1): Likewise.
1505 (emit_iinc, emit_reloc, push_constant1, push_constant2,
1506 push_in_const, push_long_const): Prototyped.
1507 (push_constant1): Argument `index' is of type HOST_WIDE_INT.
1508 (push_constant2): Likewise.
1509 (push_int_const): Cast find_constant1's integer arguments to `jword'.
1510 (find_constant_wide): Cast find_constant2's integer arguments to
1512 (find_constant_index): Cast find_constant2's and find_constant2's
1513 integer arguments to `jword'.
1514 (emit_pop): Argument `value' is of type HOST_WIDE_INT.
1515 (emit_switch_reloc): Use RELOCATION_VALUE_0.
1516 (emit_if): Use RELOCATION_VALUE_1.
1517 (emit_goto): Likewise.
1518 (emit_jsr): Likewise.
1519 (generate_bytecode_insns): Use RELOCATION_VALUE_0. Cast second
1520 argument to push_long_const to HOST_WIDE_INT.
1522 1999-09-15 Andreas Schwab <schwab@suse.de>
1524 * Makefile.in (parse.o): Depend on $(JAVA_TREE_H).
1526 1999-09-20 Nick Clifton <nickc@cygnus.com>
1528 * lang.c (lang_decode_option): Extend comment.
1530 Thu Sep 16 15:42:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1532 * parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
1535 1999-09-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1537 * gjavah.c (get_field_name, print_method_info, print_include,
1538 add_namelet): Use xmalloc, not malloc.
1540 * jcf-depend.c (add_entry): Likewise. Use xstrdup, not strdup.
1541 (munge): Use xrealloc, not realloc, trust xrealloc to handle a
1544 * jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.
1546 * jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.
1548 * jcf-path.c (add_entry): Likewise.
1550 * jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.
1552 * jv-scan.c (xmalloc): Remove definition.
1554 * jvgenmain.c (xmalloc): Likewise.
1556 * jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.
1558 * lex.c (java_store_unicode): Use xrealloc, not realloc.
1560 * parse-scan.y: Use concat, not of xmalloc/assign/strcpy. Use
1561 concat, not xmalloc/sprintf.
1562 (java_push_parser_context): Use xcalloc, not xmalloc/bzero.
1563 (xstrdup): Remove definition.
1565 * parse.y (duplicate_declaration_error_p,
1566 constructor_circularity_msg, verify_constructor_circularity,
1567 check_abstract_method_definitions, java_check_regular_methods,
1568 java_check_abstract_methods, patch_method_invocation,
1569 check_for_static_method_reference, patch_assignment, patch_binop,
1570 patch_cast, array_constructor_check_entry, patch_return,
1571 patch_conditional_expr): Use xstrdup, not strdup.
1573 * zextract.c (ALLOC): Use xmalloc, not malloc.
1575 Sun Sep 12 23:30:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1577 * Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
1579 * jvspec.c: Include gcc.h. Don't include gansidecl.h.
1580 (do_spec, lang_specific_pre_link, lang_specific_driver,
1581 input_filename, input_filename_length): Don't declare.
1582 (main_class_name, jvgenmain_spec, lang_specific_driver):
1584 (lang_specific_driver): All calls to the function pointer
1585 parameter now explicitly call `fatal'.
1587 Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1589 * parse.y (find_applicable_accessible_methods_list): Search
1590 abstract classes as interfaces.
1592 Thu Sep 9 17:33:28 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1594 * class.c (finish_class): We're now outside a valid method
1595 declaration. Tell the rest of gcc so.
1597 1999-09-08 Bruce Korb autogen@linuxbox.com
1599 * Makefile.in: Give the gperf user a hint about why "gperf -F" fails.
1601 1999-09-07 Tom Tromey <tromey@cygnus.com>
1603 * gjavah.c (add_class_decl): Generate include for gcj/array.h, not
1605 (decode_signature_piece): Don't emit "::" in JArray<>.
1606 (print_namelet): Only print trailing `;' when printing a class.
1608 Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
1610 * java-tree.h: Delete declarations for all tree nodes now moved to
1612 * decl.c: Delete their definitions.
1614 1999-09-04 Mark Mitchell <mark@codesourcery.com>
1616 * Make-lang.in (jc1): Depend on ggc-callbacks.o.
1617 * Makefile.in (OBJS): Add ggc-callbacks.o.
1618 (OBJDEPS): Likewise.
1620 1999-09-03 Tom Tromey <tromey@cygnus.com>
1622 * parse.y (strip_out_static_field_access_decl): Return operand if
1623 it satisfies JDECL_P.
1625 1999-09-02 Tom Tromey <tromey@cygnus.com>
1627 * gjavah.c (decode_signature_piece): Emit "::" in JArray<>.
1628 Handle nested arrays, like `[[I'.
1630 1999-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1632 * class.c (finish_class): Remove unused parameter, all callers
1635 * expr.c (build_java_athrow): Change return type to void.
1636 (java_lang_expand_expr): Make sure each case in switch returns a
1639 * java-tree.h (finish_class): Fix prototype to take void args.
1641 * jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
1642 (main): Issue return from main, not exit.
1644 * jcf-parse.c (parse_class_file): Fix call to `finish_class'.
1646 * jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.
1648 * jv-scan.c (main): Issue return from main, not exit.
1650 * parse.y (check_abstract_method_definitions,
1651 java_check_abstract_method_definitions): Add static prototypes.
1652 (java_complete_expand_methods): Fix call to `finish_class'.
1654 * verify.c (verify_jvm_instructions): Initialize variables `oldpc'
1657 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1659 * lang.c (language_string): Constify.
1661 1999-08-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1663 * Makefile.in (LIBS): Fix definition so we link with $(CLIB).
1664 Remove hacks for stuff which comes from libiberty.
1666 * Make-lang.in: Likewise.
1668 Mon Aug 30 16:41:41 1999 Hans-Peter Nilsson <hp@axis.se>
1670 * Makefile.in (xref.o): Depend on xref.c explicitly.
1672 1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1674 * java-tree.h (lang_printable_name): Constify a char*.
1676 * lang.c (lang_printable_name): Likewise.
1678 Fri Aug 27 23:31:57 1999 Jeffrey A Law (law@cygnus.com)
1680 * gjavah.c, jcf-write.c, verify.c: Do not use C++ style
1683 1999-08-26 Tom Tromey <tromey@cygnus.com>
1685 * gjavah.c (print_cxx_classname): Print "::" before qualified
1688 Thu Aug 26 09:10:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1690 * parse.y (lookup_cl): Changed leading comment. Now does its best
1691 to set the column number.
1692 (qualify_ambiguous_name): Take WFL wrappers into account.
1694 Wed Aug 25 15:37:15 1999 Gregg Townsend <gmt@cs.arizona.edu>
1696 * verify.c (verify_jvm_instructions): Don't check instruction
1697 validity beyond end of method.
1699 1999-08-25 Tom Tromey <tromey@cygnus.com>
1701 * jvspec.c (lang_specific_driver): Correctly handle --help again.
1703 1999-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1705 * gjavah.c (print_name, print_base_classname, utf8_cmp,
1706 cxx_keyword_subst, generate_access, name_is_method_p,
1707 get_field_name, print_field_name, super_class_name, print_include,
1708 decode_signature_piece, print_class_decls, usage, help,
1709 java_no_argument, version, add_namelet, print_namelet): Add static
1711 (print_base_classname, utf8_cmp, cxx_keyword_subst,
1712 name_is_method_p): Constify a char*.
1713 (get_field_name): Likewise. Prefer xstrdup over malloc/strcpy.
1714 Provide a final else clause in an if-else-if.
1715 (print_field_info): Add missing final arg in function call to
1717 (print_method_info, decompile_method, decode_signature_piece,
1718 print_c_decl, print_full_cxx_name, print_stub,
1719 print_mangled_classname, super_class_name, print_include,
1720 add_namelet, add_class_decl, print_class_decls, process_file,
1721 help): Constify a char*.
1723 * jcf-write.c (jcf_handler, push_constant1, push_constant2,
1724 push_int_const, find_constant_wide, find_constant_index,
1725 push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
1726 emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
1727 emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
1728 emit_if, emit_goto, emit_jsr, call_cleanups,
1729 make_class_file_name): Add static prototypes.
1730 (generate_bytecode_return, generate_bytecode_insns): Pass a
1731 NULL_PTR, not a NULL_TREE.
1733 * jv-scan.c: Include "jcf.h".
1734 (main): Declare using DEFUN macro.
1736 * jvspec.c (find_spec_file, lang_specific_pre_link,
1737 lang_specific_driver): Add prototypes.
1738 (find_spec_file): Constify a char*.
1740 * keyword.gperf (hash, java_keyword): Add prototypes.
1742 * lang.c (lang_print_error): Add static prototype.
1743 (lang_init): Prefer memcpy over bcopy to avoid casts.
1745 * lex.c (yylex): Add static prototype.
1747 * parse-scan.y: Include "lex.c" earlier.
1749 * parse.h: Remove redundant declaration for `yylex'.
1751 * parse.y (java_decl_equiv, binop_compound_p, search_loop,
1752 labeled_block_contains_loop_p): Add static prototypes.
1753 (not_accessible_p): Make static to match prototype.
1755 * verify.c (start_pc_cmp): Don't needlessly cast away const.
1757 Sun Aug 22 11:07:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1759 * parse.y (check_method_redefinition): Changed leading comment.
1760 (check_abstract_method_definitions): New function.
1761 (java_check_abstract_method_definitions): New function.
1762 (java_check_regular_methods): Call it.
1763 (verify_constructor_super): Fixed indentation.
1764 (lookup_method_invoke): Likewise.
1766 Thu Aug 19 10:26:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1768 * parse.y (method_header): Return a null pointer if the current
1770 (finish_method_declaration): Return if the current function decl
1772 (source_start_java_method): Likewise.
1773 (java_method_add_stmt): Likewise.
1775 Wed Aug 18 13:17:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1777 * class.c (emit_register_class): Removed unnecessary call to
1779 * parse.y (labeled_block_contains_loop_p): Removed unused local
1782 Tue Aug 17 22:51:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1784 * parse.y (java_refold): Added prototype.
1786 Tue Aug 17 21:48:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
1788 * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
1789 (java_stabilize_reference): Removed unnecessary `else'.
1790 (java_complete_lhs): Set flag to remember boolean. Call
1791 java_refold. Added comments.
1792 (java_decl_equiv): New function.
1793 (binop_compound_p): Likewise.
1794 (java_refold): Likewise.
1795 (patch_unaryop): Striped static field access assigned to decl and
1796 op. Changed promotion scheme for ++/-- operators.
1797 (search_loop): New function.
1798 (labeled_block_contains_loop_p): Likewise.
1799 (patch_loop_statement): Call labeled_block_contains_loop_p. Added
1801 (patch_bc_statement): Call search_loop. Fixed comment.
1803 1999-08-14 Anthony Green <green@cygnus.com>
1805 * expr.c (java_lang_expand_expr): Mark static array data as
1808 Tue Aug 10 00:28:31 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
1810 * jvgenmain.c (main): NUL-terminate name_obstack.
1812 1999-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1814 * check-init.c (check_bool2_init, done_alternative): Add static
1817 * class.c (add_interface_do, maybe_layout_super_class): Likewise.
1818 (add_method, build_utf8_ref, build_class_ref,
1819 append_gpp_mangled_type, layout_class_method): Constify a char*.
1821 * decl.c (push_promoted_type, make_binding_level): Add static
1823 (push_promoted_type, pushdecl): Constify a char*.
1825 * except.c (find_handler_in_range, link_handler,
1826 check_start_handlers): Add static prototypes.
1828 * expr.c (process_jvm_instruction): Constify a char*.
1830 * gjavah.c (main): Constify a char*.
1832 * java-tree.h (verify_jvm_instructions, process_jvm_instruction):
1835 * jcf-depend.c (free_entry, add_entry, munge, print_ents): Add
1837 (add_entry, jcf_dependency_set_target, jcf_dependency_add_target,
1838 munge, print_ents): Constify a char*.
1840 * jcf-dump.c (disassemble_method): Constify a char*.
1841 (print_constant_pool, print_exception_table): Add static prototypes.
1842 (print_constant, print_exception_table, main, disassemble_method):
1845 * jcf-io.c (find_classfile, find_class): Likewise.
1847 * jcf-parse.c (JPOOL_UTF_DATA, find_in_current_zip): Likewise.
1848 (set_source_filename, predefined_filename_p): Add static prototypes.
1849 (set_source_filename, get_constant, get_class_constant,
1850 find_in_current_zip): Constify a char*.
1852 * jcf-path.c (free_entry, append_entry, add_entry, add_path): Add
1854 (add_entry, add_path, jcf_path_classpath_arg,
1855 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
1857 * jcf-reader.c (get_attribute, jcf_parse_preamble,
1858 jcf_parse_constant_pool, jcf_parse_class, jcf_parse_fields,
1859 jcf_parse_one_method, jcf_parse_methods,
1860 jcf_parse_final_attributes): Add static prototypes.
1861 (get_attribute): Constify a char*.
1863 * jcf.h (find_class, find_classfile, jcf_dependency_set_target,
1864 jcf_dependency_add_target, jcf_path_classpath_arg,
1865 jcf_path_CLASSPATH_arg, jcf_path_include_arg): Constify a char*.
1867 * jv-scan.c (main): Constify a char*.
1868 (gcc_obstack_init): Add prototype arguments.
1870 * jvgenmain.c (gcc_obstack_init): Likewise.
1871 (main): Constify a char*.
1873 * lang.c (put_decl_string, put_decl_node, java_dummy_print): Add
1875 (put_decl_string, lang_print_error): Constify a char*.
1876 (lang_init): Remove redundant extern prototype.
1878 * mangle.c (emit_unicode_mangled_name): Constify a char*.
1880 * typeck.c (convert_ieee_real_to_integer, parse_signature_type):
1881 Add static prototypes.
1882 (get_type_from_signature): Constify a char*.
1884 * verify.c (check_pending_block, type_stack_dup, start_pc_cmp ):
1885 Add static prototypes.
1886 (start_pc_cmp): Prefer PTR over GENERIC_PTR.
1887 (verify_jvm_instructions): Constify a char*.
1889 * xref.c (xref_flag_value): Likewise.
1891 * xref.h (xref_flag_value): Likewise.
1893 * zextract.c (makeword, makelong): Add static prototypes.
1894 (makeword, makelong): Constify a uch*.
1896 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1898 * lang.c (java_dummy_print): Constify a char*.
1899 (lang_print_error): Likewise.
1900 (lang_init): Remove redundant prototype for `print_error_function'.
1901 (lang_init_source): Likewise.
1902 (lang_identify): Constify a char*.
1904 1999-08-09 Tom Tromey <tromey@cygnus.com>
1906 * javaop.h (WORD_TO_FLOAT): only inline if building with gcc.
1907 (WORDS_TO_LONG): Likewise.
1908 (WORDS_TO_DOUBLE): Likewise.
1910 1999-08-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1912 * Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).
1914 * expr.c (java_stack_pop, java_array_data_offset,
1915 build_java_throw_out_of_bounds_exception, case_identity,
1916 build_java_check_indexed_type): Add static prototypes.
1917 (linenumber_table, expand_invoke, expand_java_field_op,
1918 build_primtype_type_ref, expand_byte_code): Constify a char*.
1920 * java-tree.h (build_primtype_type_ref, linenumber_table):
1922 (java_lang_expand_expr): Add prototype.
1924 * lang.c: Include rtl.h and expr.h. Remove extern prototype for
1925 `java_lang_expand_expr'.
1927 * lex.c (java_lex_error): Constify a char*.
1928 (java_get_unicode, java_read_char, java_allocate_new_line,
1929 java_unget_unicode, java_sneak_unicode): Prototype.
1931 * parse-scan.y (current_class, package_name, method_declarator,
1932 report_class_declaration, yyerror): Constify a char*.
1934 * parse.h (java_report_errors): Prototype.
1935 (yyerror): Constify a char*.
1937 * parse.y (classitf_redefinition_error, check_modifiers,
1938 parse_jdk1_1_error, lookup_package_type,
1939 lookup_package_type_and_set_next, get_printable_method_name,
1940 purify_type_name): Constify a char*.
1941 (build_super_invocation, maybe_generate_finit,
1942 verify_constructor_super, parser_add_interface,
1943 add_superinterfaces, jdep_resolve_class, note_possible_classname,
1944 java_complete_expand_methods, java_expand_finals,
1945 cut_identifier_in_qualified, java_stabilize_reference,
1946 do_unary_numeric_promotion, operator_string, do_merge_string_cste,
1947 merge_string_cste): Prototype.
1948 (single_type_import_declaration, yyerror,
1949 variable_redefinition_error, build_array_from_name,
1950 build_unresolved_array_type, check_class_interface_creation,
1951 resolve_class, complete_class_report_errors,
1952 note_possible_classname, read_import_dir,
1953 find_in_imports_on_demand, resolve_package, fix_constructors,
1954 check_deprecation, lookup_method_invoke,
1955 maybe_build_primttype_type_ref, array_constructor_check_entry):
1957 (java_complete_expand_methods, java_expand_finals): Make static.
1958 (convert_narrow): Remove static prototype.
1960 Tue Aug 3 20:21:20 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
1962 * Makefile.in (decl.o): Depends on $(srcdir)/../defaults.h.
1964 1999-08-02 Richard Henderson <rth@cygnus.com>
1966 * decl.c: Include defaults.h instead of expr.h.
1967 * parse.y: Likewise.
1969 1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
1971 * java/decl.c (start_java_method): Change all uses of
1972 PROMOTE_PROTOTYPES, so that it tests it as a C expression.
1973 Ensure expr.h is included.
1974 * java/expr.c (pop_arguments): Ditto.
1975 * java/parse.y (expand_start_java_method): Ditto.
1977 1999-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1979 * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
1981 1999-07-31 Bernd Schmidt <bernds@cygnus.co.uk>
1983 * decl.c: Include "function.h".
1984 * except.c: Likewise.
1985 * parse.y: Likewise.
1986 * Makefile.in: Update dependencies.
1988 1999-07-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1990 * expr.c (build_java_soft_divmod): Provide a default case in switch.
1991 (java_lang_expand_expr): Mark parameters `target', `tmode' and
1992 `modifier' with ATTRIBUTE_UNUSED.
1994 * gjavah.c (process_file): Add braces around ambiguous `else'.
1996 * jcf-dump.c (print_access_flags, localvar_free): Change return
1999 * parse.y (java_complete_expand_method): Initialize variable
2001 (resolve_qualified_expression_name): Likewise for `field_decl'.
2002 (patch_method_invocation): Likewise for `class_to_search'.
2003 (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
2004 (patch_assignment): Likewise for `lhs_type'.
2006 * verify.c (verify_jvm_instructions): Remove unused variable
2009 1999-07-25 Richard Henderson <rth@cygnus.com>
2011 * decl.c (va_list_type_node): New.
2013 1999-07-25 Anthony Green <green@cygnus.com>
2015 * gjavah.c (print_stub): New function.
2016 (METHOD_IS_NATIVE): New macro.
2017 (print_mangled_classname): Make static.
2018 (HANDLE_END_FIELD): Don't emit fields during stub generation.
2019 (process_file): Perform stub generation.
2020 (HANDLE_METHOD): Don't emit class decls during stub
2022 (HANDLE_END_METHOD): Take into account stub generation.
2023 (print_method_info): Handle stub generation.
2024 (print_stub): New function.
2025 (print_cxx_classname): Make signature consistant with others.
2026 (help): Describe -stubs option.
2027 (main): Create stub file.
2028 (version): Use version.c.
2029 (print_full_cxx_name): New function.
2030 (print_c_decl): Use print_full_cxx_name.
2032 Thu Jul 22 12:41:12 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2034 * check-init.c (check_init): Handle MAX_EXPR.
2036 1999-07-15 Andrew Haley <aph@cygnus.com>
2038 * lang.c (flag_use_divide_subroutine): New variable.
2039 * typeck.c: (convert_ieee_real_to_integer): Bounds check
2040 fp-to-integer conversion.
2041 (convert): Call convert_ieee_real_to_integer when flag_fast_math
2044 * expr.c (build_java_soft_divmod): New function.
2045 (build_java_binop): Call build_java_soft_divmod if
2046 flag_use_divide_subroutine is set.
2047 * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
2048 soft_lrem_node: new builtin functions.
2049 (init_decl_processing) Initialize the new builtins.
2050 * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
2051 soft_lrem_node: new builtin functions.
2052 (build_java_soft_divmod): New function.
2053 * parse.y: Call build_java_soft_divmod if
2054 flag_use_divide_subroutine is set.
2057 * jvspec.c (lang_specific_driver): Always allow an extra arg (for
2058 a --specs= arg) even if not linking.
2059 * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
2060 -fuse-divide-subroutine
2062 Tue Jul 20 13:20:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2064 * parse.y (resolve_and_layout): Check methods only once.
2065 (resolve_qualified_expression_name): Verify thrown exceptions
2067 (check_thrown_exceptions): Reject exceptions thrown in
2068 initializer. Error message tuned.
2070 1999-07-14 Andrew Haley <aph@cygnus.com>
2072 * expr.c (expand_expr): Do not return the last statement in a
2073 block as the block's value.
2075 Sat Jul 3 22:26:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2077 * expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
2078 CALL_EXPR, to avoid order of evaluation changes.
2080 Fri Jul 2 17:44:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2082 * parse.y (qualify_ambiguous_name): Do not use
2083 IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
2085 Thu Jul 1 23:31:16 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2087 * check-init.c (check_init): Handle MAX_EXPR.
2088 * expr.c (force_evaluation_order): Force method call arguments to
2089 be evaluated in left-to-right order.
2090 * parse.y (qualify_ambiguous_name): Loop again to qualify
2091 NEW_ARRAY_EXPR properly.
2093 Wed Jun 30 17:27:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2095 * parse.y (patch_invoke): Resolve unresolved invoked method
2097 (qualify_ambiguous_name): STRING_CST to qualify expression for
2098 type name resolution.
2100 1999-06-24 Andrew Haley <aph@cygnus.com>
2102 * class.c (finish_class): Whenever a deferred method is
2103 output, rescan the list of methods to see if a new candidate for
2104 output can be found.
2106 1999-06-28 Tom Tromey <tromey@cygnus.com>
2108 * jvspec.c (lang_specific_driver): Recognize --help.
2110 Fri Jun 25 13:35:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2112 * parse.y (resolve_package): Fixed bogus return statement.
2113 (patch_method_invocation): Resolve method invocation beginning with
2114 a package name qualifier.
2116 1999-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2118 * Make-lang.in (java.stage1): Depend on stage1-start.
2119 (java.stage2): Likewise for stage2-start.
2120 (java.stage3): Likewise for stage3-start.
2121 (java.stage4): Likewise for stage4-start.
2123 Thu Jun 24 13:12:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2125 * parse.y (java_complete_lhs): When doing cross referencing, don't
2126 try to keep file location on a WFL expanded as a CALL_EXPR.
2128 Wed Jun 23 14:37:15 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2130 * parse.y (finish_method_declaration): Insert a RETURN_EXPR when
2131 compiling to class file a void method with an empty method body.
2132 As a side effect, the bytecode backend will generate the
2133 appropriate `return' instruction.
2135 Tue Jun 22 20:43:49 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2137 * parse.y (lookup_package_type_and_set_next): New function prototype.
2138 (resolve_package): Search current and imported packages.
2139 (lookup_package_type_and_set_next): New function.
2141 1999-06-22 Andrew Haley <aph@cygnus.com>
2143 * verify.c (verify_jvm_instructions): Check for pending blocks
2144 before invalid PC test and opcode switch, not after.
2146 1999-06-21 Andrew Haley <aph@cygnus.com>
2148 * except.c (find_handler_in_range): The upper limit for exception
2149 ranges is exclusive, not inclusive: (start <= pc < end).
2150 (link_handler): find child pointer which points to outer by
2151 searching sibling list: previous code incorrectly assumed that
2152 outer->outer->first_child must point to outer.
2153 * verify.c (verify_jvm_instructions): FIXME added to code for
2155 (verify_jvm_instructions): Do not assume that the last block
2156 processed in a subroutine is a block which ends with a `ret'
2157 instruction. With some control flows it is possible that the last
2158 block ends with an `athrow'.
2160 Mon Jun 14 13:13:39 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2162 * parse.y (qualify_ambiguous_name): Reorganized the post
2163 evaluation of non WFL leading expression nodes.
2165 Fri Jun 11 21:37:18 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2167 * parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
2170 Thu Jun 10 22:26:17 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2172 * parse.y (qualify_ambiguous_name): Handle qualified expression
2173 beginning with a STRING_CST.
2175 Thu Jun 10 20:27:25 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2177 * parse.y (register_fields): Set DECL_INITIAL on both
2178 pre-initialized static and public fields.
2179 (resolve_field_access): Static field access expressions to always
2181 (qualify_ambiguous_name): Work out buried CALL_EXPR for proper
2182 qualification. CONVERT_EXPR to be resolved as an expression name.
2183 (java_complete_lhs): Identify and access qualified final
2184 initialized field in switch statement case expression.
2185 (fold_constant_for_init): Pre-initialized field decl constant to
2188 Mon Jun 7 16:09:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2190 * parse.y (note_possible_classname): Mark returned node with
2191 QUALIFIED_P only if the original class name contained a '/'.
2193 Sat Jun 5 11:46:59 1999 Anthony Green <green@cygnus.com>
2195 * Make-lang.in (gcjh): More parallel build fixes.
2197 1999-06-03 Mike Stump <mrs@wrs.com>
2199 * Make-lang.in (JCF_DUMP_SOURCES, jvgenmain): Fix parallel builds.
2201 Wed Jun 2 10:44:38 1999 Anthony Green <green@cygnus.com>
2203 * except.c (link_handler): Chain exception handlers in order.
2205 Wed Jun 2 10:41:24 1999 Anthony Green <green@cygnus.com>
2207 * expr.c (expand_byte_code): Fill unreachable bytecode regions
2208 with nops and process as usual in order to always set correct EH
2209 ranges. Emit detailed warnings about unreachable bytecodes.
2211 Wed Jun 2 10:35:13 1999 Anthony Green <green@cygnus.com>
2213 * class.c (build_utf8_ref): Mark cinit and utf8 tree nodes as
2216 Fri May 28 18:22:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2218 * parse.y (lookup_field_wrapper): Unified returned value to NULL
2219 or the searched field decl.
2221 Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2223 * parse.y (fold_constant_for_init): Convert numerical constant
2224 values to the type of the assigned field.
2226 Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2228 * expr.c (lookup_field): Relaxed the test on class loading error
2230 * parse.y (fold_constant_for_init): Enabeled old code.
2232 Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2234 * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
2235 decide the validity of the cast of a java.lang.Cloneable reference
2237 (patch_conditional_expr): Fixed first argument passed to
2238 binary_numeric_promotion.
2240 Wed May 26 15:33:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2242 * parse.y (qualify_ambiguous_name): Take into account that a
2243 CONVERT_EXPR might specify a type as a WFL.
2245 Tue May 25 15:06:13 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2247 * parse.y (patch_assignment): Save the rhs before using it as an
2248 argument to _Jv_CheckArrayStore.
2250 Tue May 25 11:23:59 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2252 * lex.c (java_parse_doc_section): Fixed `tag' buffer size.
2254 Mon May 24 13:26:00 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2256 * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
2257 floating point litteral only when the exponent indicator has been
2260 Sat May 22 13:54:41 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2262 * parse.y (formal_parameter:): Construct argument tree list
2263 element even if a yet unsupported final parameter was encountered.
2265 Tue May 18 00:28:58 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2267 * parse.y (finish_method_declaration): Issue errors for native or
2268 abstract methods declared with a method body, as well as for non
2269 native or non abstract methods with no method body.
2271 1999-05-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2273 * class.c (build_utf8_ref): Initialize variable `field'.
2275 * decl.c (init_decl_processing): Initialize variable `field'.
2277 * expr.c (build_known_method_ref): Mark parameters `method_type',
2278 `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
2279 (process_jvm_instruction): Likewise for parameter `length'.
2281 * jvspec.c (lang_specific_driver): Mark variables `saw_math',
2282 `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
2285 * parse.y (maybe_generate_clinit): Remove unused variable
2286 `has_non_primitive_fields'.
2287 (find_in_imports_on_demand): Initialize variables `node_to_use'
2289 (patch_binop): Likewise for variable `prom_type'.
2290 (patch_unaryop): Likewise for variable `prom_type'.
2292 * verify.c (verify_jvm_instructions): Likewise for variable `last'.
2294 * xref.c (xref_table): Add missing initializer.
2296 1999-05-14 Tom Tromey <tromey@cygnus.com>
2298 * java-except.h (struct eh_range): Removed unused `next' member.
2299 * verify.c (verify_jvm_instructions): Call check_nested_ranges
2300 after adding all exception handlers. Sort exception ranges in
2302 (struct pc_index): New structure.
2303 (start_pc_cmp): New function.
2304 * except.c (add_handler): Return `void'. Don't call link_handler;
2305 instead construct an ordinary linked list and do range
2307 (check_nested_ranges): New function.
2308 (link_handler): Changed interface to allow merging of eh_ranges.
2309 Split overlapping ranges. Return `void'.
2311 Mon May 17 19:20:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2313 * parse.y (constructor_block_end:): New rule, tagged <node>.
2314 (constructor_body:): Use `constructor_block_end' instead of
2317 Mon May 17 18:01:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2319 * parse.y (statement_nsi:): Pop `for' statement block.
2320 (java_complete_lhs): Labeled blocks containing no statement are
2321 marked as completing normally.
2323 Fri May 14 12:31:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2325 * xref.c (xref_set_current_fp): New function, defined.
2326 * xref.h (xref_set_current_fp): New function, prototyped.
2328 Fri May 14 11:57:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2330 * check-init.c (check_init): Take into account that
2331 LABELED_BLOCK_STMT can be empty.
2333 Thu May 13 18:30:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2335 * parse.y (java_check_regular_methods): Warning check on not
2336 overriding methods with default access in other packages does not
2337 apply to `<clinit>'.
2338 (java_complete_lhs): If block body is an empty_stmt_node, replace
2339 it by NULL_TREE. This prevents gcc from generating an irrelevant
2342 Thu May 13 13:23:38 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2344 * check-init.c (check_init): Removed code accepting to see things
2345 falling through default:, when doing xrefs.
2346 * java-tree.h (do_not_fold): New global variable, declared.
2347 * parse.y (do_not_fold): New global variable, defined.
2348 (java_complete_expand_method): Set `do_not_fold' to the value of
2349 `flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
2350 and reinstall them after them have been purged; do not check for
2351 initializations; do not issue missing return errors.
2352 (java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
2354 (patch_binop): Skip the fold part when doing xrefs.
2355 (build_string_concatenation): Skip the concatenation part when
2357 (patch_synchronized_statement): Do not generate a try-finally when
2359 (patch_throw_statement): When doing xrefs, do not call BUILD_THROW
2360 and keep the location where the throw was seen.
2361 * typeck.c (convert): When `do_not_fold' is set, do not attempt
2362 any treatment on the converted node an simply return a NOP_EXPR of
2364 * xref.c (xref_get_data): New function, defined.
2365 * xref.h (xref_get_data): New function, declared.
2366 (XREF_GET_DATA): Use xref_get_data.
2368 1999-05-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2370 * gjavah.c (print_include): Cast the result of `strlen' to int
2371 when comparing against a signed value.
2372 (add_namelet): Likewise.
2374 1999-05-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2376 * expr.c (expand_invoke): Mark parameter `nargs' with
2378 (PRE_LOOKUP_SWITCH): Likewise for variable `match'.
2380 * jcf-io.c (jcf_unexpected_eof): Mark parameter `count' with
2383 * jcf-reader.c (get_attribute): Cast a value to long
2384 when comparing against a signed expression. Likewise.
2386 * lex.h: Never define HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT or
2389 1999-05-11 Andrew Haley <aph@cygnus.com>
2391 * parse.y (source_end_java_method): If the current method contains
2392 any exception handlers, force asynchronous_exceptions: this is
2393 necessary because signal handlers in libjava may throw exceptions.
2394 * decl.c (end_java_method): Ditto.
2396 1999-05-11 Tom Tromey <tromey@cygnus.com>
2398 * Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
2400 * jvspec.c (THREAD_NAME): Removed.
2401 (GC_NAME): Likewise.
2402 (MATHLIB): Likewise.
2403 (WITHLIBC): Likewise.
2405 (THREADLIB): Likewise.
2406 (MATH_LIBRARY): Likewise.
2407 (lang_specific_driver): Don't add `-l' options to command line.
2408 Instead, add a single --specs option. Recognize `-L' options and
2409 use them to search for spec file.
2410 (find_spec_file): New function.
2411 (SPEC_FILE): New define.
2413 Tue May 11 11:46:36 1999 Dave Brolley <brolley@cygnus.com>
2415 * lang-options.h: -MD, -MMD, -M and -MM not needed here for
2416 cpplib-enabled build.
2418 1999-05-05 Per Bothner <bothner@cygnus.com>
2420 * class.c (make_field_value): DECL_INITIAL may be a string literal;
2421 temporarily zero it while calling rest_of_decl_compilation.
2423 * java-tree.h (string_ptr_type_node): Add declaration.
2424 * decl.c: Define and initialize string_ptr_type_node.
2425 * parse.y (patch_string_cst): Use string_ptr_type_node.
2427 * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed.
2428 * parse.y (for_statement): Now unconditionally exit_block.
2429 (finish_labeled_statement): No longer exit_block if for-loop.
2430 (patch_loop_statement): Check harder if the loop is already labeled.
2432 * parse.y (patch_initialized_static_field): Removed function.
2433 (maybe_generate_clinit): Removed special handling for interfaces.
2434 (java_complete_expand_methods): Do a preliminary java_complete_tree
2435 on <clinit> to determine if it can be removed.
2436 (java_complete_expand_method): Remove special handling for <clinit>.
2437 (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION
2438 optimize if we get back empty_stmt_node.
2439 For MODIFY_EXPR, re-do checking of static initializers.
2440 (fold_constant_for_init): Don't return immediate if VAR_DECL.
2441 For VAR_DECL, pass correct context.
2443 * verify.c (verify_jvm_instructions): Better error messages.
2445 1999-05-03 Tom Tromey <tromey@cygnus.com>
2447 * parse-scan.y (interface_declaration): Call
2448 report_class_declaration for interfaces.
2450 1999-04-30 20:54 -0400 Zack Weinberg <zack@rabi.columbia.edu>
2452 * Makefile.in: Remove -v from bison command lines.
2454 Fri Apr 30 17:54:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2456 * check-init.c (check_init): Exclude a case of error when doing
2458 * class.c (layout_class_method): Don't generate the error message
2459 twice when compiling from source.
2460 * lang-options.h: Added `-Wredundant-modifers' and
2461 `-Wunusupported-jdk11' flags and help text.
2462 * lang.c (lang_decode_option): Added support for
2463 `-Wunsupported-jdk11' and `-Wredundant-modifiers'.
2464 flag_static_local_jdk11 and flag_redundant set accordingly.
2465 * lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
2466 * parse.h (EXPR_WFL_ADD_COL): New macro.
2467 (DECL_END_SOURCE_LINE): Likewise.
2468 (DECL_INHERITED_SOURCE_LINE): Likewise.
2469 * parse.y (static_ref_err): New function, prototyped.
2470 (CCB_TK): Now tagged <operator>.
2471 (class_body:): Remember the location of the closing '}' of a class
2472 definition when doing xrefs.
2474 (block_end:): Likewise.
2475 (create_class): Remember the location of the inherited class
2476 identifier when doing xrefs.
2477 (register_fields): Added test on first operand of `init' before
2478 testing it TREE_CODE.
2479 (method_header): Store the location of the class identifier in the
2480 class decl when doing xrefs.
2481 (finish_method_declaration): Don't combine first/last method line
2483 (java_check_regular_methods): Warning check on not overriding
2484 methods with default access on other packages move before check on
2485 static methods. Initialization of `aflags' also moved up.
2486 (resolve_expression_name): Call static_ref_err to report the error.
2487 (static_ref_err): New function, implemented.
2488 (resolve_field_access): Returned simplified static field access
2490 (resolve_qualified_expression_name): Check for illegal use of
2491 static fields in a non static context. Call static_ref_err to
2492 report error in various places.
2493 (java_complete_tree): Do not fold initialized static fields when
2495 (java_complete_lhs): Likewise.
2497 1999-04-29 Anthony Green <green@cygnus.com>
2499 * expr.c (generate_name): Use ASM_GENERATE_INTERNAL_LABEL to
2500 create internal labels.
2501 (lookup_label): Ditto.
2503 Sat Apr 24 16:50:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2505 * class.c (layout_class_method): Generate <clinit>'s rtl for
2507 * decl.c (complete_start_java_method): Don't call _Jv_InitClass
2508 for interfaces' <clinit>.
2509 * expr.c (lookup_field): Search for fields in interfaces.
2510 (expand_invoke): Fixed indentation.
2511 (expand_java_field_op): Likewise. Use IS_CLINIT.
2512 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
2513 (IS_CLINIT): New macro.
2514 * parse.y (type_declaration:): Call maybe_generate_clinit after an
2515 interface was parsed.
2516 (maybe_generate_clinit): Don't generate if the current class is an
2517 interface with only fields of primitive types.
2518 (reset_method_name): Use IS_CLINIT.
2519 (java_complete_expand_method): Expand <clinit> when it exists for
2520 interfaces. Use IS_CLINIT.
2521 (resolve_expression_name): Use DECL_CONTEXT instead of
2522 current_class to build static field references.
2523 (java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
2524 ARRAY_REF when doing xreferencing.
2525 (check_final_assignment): Fixed typo in leading comment. Use
2527 (patch_array_ref): Don't fully expand array references when
2529 (patch_return): Use IS_CLINIT.
2530 (patch_throw_statement): Likewise.
2532 1999-04-22 Tom Tromey <tromey@cygnus.com>
2534 * Make-lang.in (JAVA_SRCS): Added check-init.c.
2536 Wed Apr 21 11:13:36 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2538 * decl.c (predef_filenames, predef_filenames_size): New globals
2539 (init_decl_processing): predef_filenames and predef_filenames_size
2541 * java-tree.h (predef_filenames, predef_filenames_size): Declared
2543 * jcf-parse.c (predefined_filename_p): New function.
2544 (yyparse): Check that files on the command line are specified only
2545 once and issue a warning otherwise.
2546 * parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
2547 * parse.y (source_end_java_method): Nullify NOP method bodies, to
2548 avoid a gcc warning with -W -Wall turned on.
2549 (java_expand_classes): Abort if errors were encountered.
2550 (java_complete_lhs): If the cross reference flag is set, wrap
2551 field DECL node around a WFL when resolving expression name.
2553 Mon Apr 19 14:44:48 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2555 * lang.c (lang_decode_option): Fixed returned value when parsing
2556 `-fxref=...' and `-Wall'.
2557 * parse.y (source_end_java_method): Do not generate code when
2558 flag_emit_xref is set.
2559 (resolve_expression_name): Do not build static field access when
2560 flag_emit_xref is set.
2561 (resolve_field_access): No special treatment on `length' when
2562 flag_emit_xref is set. Do not build qualified static field access
2563 when flag_emit_xref is set.
2564 (patch_invoke): Keep the method DECL as operand 0 of the CALL_EXPR
2565 when flag_emit_xref is set.
2566 (patch_assignment): Do not generate array store runtime check when
2567 flag_emit_xref is set.
2568 * xref.c (xref_flag_value): Fixed function declaration
2570 (xset_set_data): New function.
2571 * xref.h (xref_set_data): Added prototype for new function.
2572 (typedef struct xref_flag_table): New field data.
2573 (XREF_GET_DATA): New macro.
2575 1999-04-19 Tom Tromey <tromey@cygnus.com>
2577 * xref.h (enum): Removed trailing comma.
2579 * parse.y (resolve_qualified_expression_name): Added missing
2582 Thu Apr 15 13:08:03 1999 Anthony Green <green@cygnus.com>
2584 * gjavah.c: New prototypes for java_float_finite and
2587 Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2589 * parse.y (patch_unaryop): Fixed ++/-- operator check on array
2592 Tue Apr 6 23:15:52 1999 Jeffrey A Law (law@cygnus.com)
2594 * Makefile.in (TREE_H): Add tree-check.h.
2595 (RTL_H): Add genrtl.h.
2597 Tue Apr 6 15:15:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2599 * parse.y (patch_assignment): Added ArrayStoreException runtime
2602 1999-04-06 Per Bothner <bothner@cygnus.com>
2604 * expr.c (pop_type_0): New function.
2605 (pop_type): Use pop_type_0.
2606 * java-tree.h (pop_type_0): New declaration.
2607 * verify.c (verify_jvm_instructions): Check return instructions.
2609 * parse.y (patch_binop): Don't fold if non-constant and emiting
2612 Mon Apr 5 16:06:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2614 * Makefile.in (gjavah.o): Depend on $(JAVA_TREE_H).
2616 * gjavah.c: Include math.h earlier. Include tree.h/java-tree.h.
2617 (main_jcf): Don't define.
2618 (process_file): Don't set `main_jcf'.
2620 * java-tree.h (main_jcf): Don't declare.
2622 * jcf-parse.c (main_jcf): Add static definition.
2624 * lang.c (main_jcf): Don't define.
2626 Mon Apr 5 15:43:51 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2628 * class.c (add_method_1): Cast the argument of `bzero' to PTR.
2630 * decl.c (copy_lang_decl): Likewise for `bcopy'.
2632 * jcf-depend.c: Include "config.h", not <config.h>.
2634 * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
2637 * jcf-path.c: Include "config.h", not <config.h>.
2639 * lex.c: Don't include various system header files.
2640 (java_init_lex): Cast the argument of `bzero' to PTR
2642 * parse-scan.y (java_push_parser_context): Likewise.
2644 * parse.y (java_push_parser_context): Likewise.
2645 (patch_bc_statement): Match format specifier to variable argument.
2647 * xref.c: Don't include <stdio.h>.
2649 Mon Apr 5 11:24:19 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2651 * parse.y (struct parser_ctxt *ctxp): Now global.
2652 (declare_local_variables): Use WFL compound value for the
2653 declaration source line value, when doing cross-referencing.
2655 1999-03-31 Tom Tromey <tromey@cygnus.com>
2657 * gjavah.c (print_field_info): Allow constants of other types.
2658 (print_include): Generate include when new name is proper prefix
2659 of already printed name.
2660 (add_namelet): Likewise.
2661 (cxx_keyword_subst): New function.
2662 (print_method_info): Use it.
2663 (print_field_name): New function.
2664 (get_field_name): New function.
2665 (print_field_info): Use get_field_name and print_field_name.
2667 Wed Mar 31 11:00:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2669 * Makefile.in (keyword.h): Generate using gperf language 'C', not
2670 'KR-C', so gperf uses the `const' keyword on strings.
2672 * keyword.gperf (java_keyword): Const-ify a char*.
2674 Tue Mar 30 11:31:53 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2676 * parse.y (patch_bc_statement): Fixed identation and a bogus
2679 Tue Mar 30 11:29:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2681 * parse.y (patch_assignment): Allow static variables in other
2682 classes to be assigned.
2684 Sun Mar 28 22:12:10 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2686 * class.c (maybe_add_interface): Remove unused variable
2688 (make_class_data): Use = for assignment, not ==. Likewise.
2689 (emit_register_classes): Remove unused variable `decl'.
2691 * lex.c: Fix comment so as not to contain an embedded `/*'.
2693 * verify.c (verify_jvm_instructions): Remove unused variable
2696 Sat Mar 27 15:49:18 1999 Per Bothner <bothner@cygnus.com>
2698 * parse.y (complete_loop_body): Rename to finish_loop_body.
2699 (complete_labeled_statement): Rename to finish_labeled_statement.
2700 (complete_for_loop): Rename to finish_for_loop.
2701 (complete_method_declaration): Rename to finish_method_declaration.
2703 * java-tree.h (continue_identifier_node): New global node.
2704 * decl.c: Define and initialize continue_identifier_node.
2705 * parse.y (generate_labeled_block): Remove - no longer needed.
2706 (build_loop_body): Use continue_identifier_node for continue block.
2707 (finish_labeled_statement): Also do pop_labeled_block actions.
2708 (java_complete_lhs): POP_LOOP even if error.
2709 (build_labeled_block): Special handling for continue_identifier_node.
2710 (patch_loop_statement): Re-organize.
2711 (patch_bc_statement): Re-write.
2713 Sat Mar 27 15:13:21 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2715 * parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
2716 using a WFL compound value.
2717 * parse.y (xref.h): Include.
2718 (maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
2720 (register_fields): Set WFL compound value to lineno if doing
2722 (java_complete_expand_method): Call expand_xref if flag_emit_xref
2724 * xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
2725 * xref.h (expand_xref): Prototype renamed from xref_generate.
2727 Sat Mar 27 14:16:32 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2729 * parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
2730 (GET_CURRENT_BLOCK): New macro.
2731 * parse.y (current_static_block): New global variable.
2732 (method_body:): Define action.
2733 (complete_method_declaration): Set current_function_decl to NULL
2734 when work on the current method is done.
2735 (declare_local_variables): Use GET_CURRENT_BLOCK.
2736 (java_method_add_stmt): Likewise.
2737 (java_complete_expand_method): Disable the use of `this' when
2739 (enter_a_block): If no current method exist, use
2740 current_static_block to link static initializer blocks.
2741 (exit_block): Rewritten to use current_static_block when no current
2743 (lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
2744 (patch_return): Forbid the use of `return' in static initializers.
2745 (patch_throw_statement): Fixed indentation. Issue specific error
2746 for uncaught thrown checked exception in static initializer
2747 blocks. Removed FIXME.
2749 1999-03-25 Zack Weinberg <zack@rabi.columbia.edu>
2751 * java/Make-lang.in: Remove all references to gcj.o/gcj.c.
2752 Link gcj from gcc.o.
2754 Tue Mar 23 10:48:24 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2756 * parse.y (find_applicable_accessible_methods_list): When dealing
2757 with interface: ensure that a given interface or java.lang.Object
2758 are searched only once.
2760 Tue Mar 23 10:05:27 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2762 * gjavah.c (print_c_decl): Remove unused argument `flags'.
2764 * jcf-dump.c (print_access_flags): Add braces around if-else.
2766 * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
2769 * lex.c (build_wfl_node): Add static prototype.
2771 * lex.h (build_wfl_node): Remove static prototype.
2773 * parse.y: Include lex.c early enough to declare everything needed.
2774 Ensure calls to `build_wfl_node' pass the proper arguments.
2775 (create_class): Remove unused variable `super_decl'.
2776 (get_printable_method_name): Initialize variable `name'.
2778 Mon Mar 22 20:14:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
2780 * Changelog: Fixed 1999-03-22 typos.
2781 * lang.c (lang_decode_option): Fixed typo in error string in the
2784 1999-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com>
2786 * Makefile.in (JAVA_OBJS): Added entry xref.o.
2788 * java-tree.h (flag_emit_xref): Declared extern.
2789 * lang.c (xref.h): Included.
2790 (flag_emit_xref): New global variable.
2791 (lang_decode_option): Added support for -fxref.
2795 1999-03-21 Manfred Hollstein <manfred@s-direktnet.de>
2797 * Make-lang.in ($(GCJ)$(exeext)): Add intl.o to list of files to be
2800 Sun Mar 21 08:30:30 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2802 * Makefile.in (jcf-dump.o): Depend on $(CONFIG_H)
2803 $(srcdir)/../system.h and $(JAVA_TREE_H).
2804 (jcf-io.o): Depend on $(JAVA_TREE_H).
2805 (mangle.o): Likewise.
2807 * check-init.c (check_cond_init): Add static prototype.
2809 * class.c (build_java_method_type, hashUtf8String,
2810 make_field_value, get_dispatch_vector, get_dispatch_table,
2811 append_gpp_mangled_type, mangle_static_field): Likewise.
2812 (strLengthUtf8): Hide unused definition.
2813 (hashUtf8String): Const-ify.
2814 (make_field_value): Un-ANSI-fy.
2816 * constants.c: Move inclusion of jcf.h above java-tree.h.
2817 (set_constant_entry, find_class_or_string_constant,
2818 find_name_and_type_constant, get_tag_node,
2819 build_constant_data_ref): Add static prototype.
2821 * decl.c (push_jvm_slot, builtin_function,
2822 lookup_name_current_level): Likewise.
2823 (builtin_function): Const-ify.
2825 * except.c (expand_start_java_handler, expand_end_java_handler):
2826 Add static prototype.
2828 * expr.c (flush_quick_stack, push_value, pop_value,
2829 java_stack_swap, java_stack_dup, build_java_athrow,
2830 build_java_jsr, build_java_ret, expand_java_multianewarray,
2831 expand_java_arraystore, expand_java_arrayload,
2832 expand_java_array_length, build_java_monitor, expand_java_pushc,
2833 expand_java_return, expand_java_NEW, expand_java_INSTANCEOF,
2834 expand_java_CHECKCAST, expand_iinc, expand_java_binop, note_label,
2835 expand_compare, expand_test, expand_cond, expand_java_goto,
2836 expand_java_call, expand_java_ret, pop_arguments, expand_invoke,
2837 expand_java_field_op, java_push_constant_from_pool): Likewise.
2839 (decode_newarray_type, expand_iinc): Un-ANSI-fy.
2840 (build_java_arraynull_check): Mark parameters `node' and `type'
2841 with ATTRIBUTE_UNUSED.
2842 (note_label): Likewise for parameter `current_pc'.
2843 (expand_java_call, expand_java_ret): Hide unused definition.
2845 * java-tree.h (make_class, build_constants_constructor,
2846 java_set_exception_lang_code, pop_labeled_block, emit_handlers,
2847 init_outgoing_cpool, register_class, emit_register_classes,
2848 java_layout_seen_class_methods): Prototype.
2849 (unicode_mangling_length): Const-ify.
2850 (append_gpp_mangled_name, append_gpp_mangled_classtype,
2851 emit_unicode_mangled_name, format_int, format_uint,
2852 jcf_trim_old_input, jcf_print_utf8, jcf_print_char,
2853 jcf_print_utf8_replace, open_class): Prototype.
2855 * jcf-dump.c: Include "config.h", not <config.h>. Don't include
2856 <stdio.h>. Include tree.h/java-tree.h.
2857 (utf8_equal_string usage, process_class): Add static prototype.
2858 (open_class): Don't prototype this here.
2859 (utf8_equal_string): Match arguments to format specifiers.
2860 (HANDLE_CODE_ATTRIBUTE, BRANCH, JSR, RET, LOOKUP_SWITCH,
2861 TABLE_SWITCH, disassemble_method): Likewise.
2863 * jcf-io.c: Include tree.h/java-tree.h.
2864 (open_class, find_classfile, jcf_print_utf8,
2865 jcf_print_utf8_replace): Const-ify.
2867 * jcf-parse.c (parse_zip_file_entries, process_zip_dir,
2868 parse_class_file): Add static prototype.
2869 (find_in_current_zip): Match definition to existing static
2872 * jcf-write.c: Include jcf.h before tree.h/java-tree.h.
2873 (alloc_chunk, append_chunk, append_chunk_copy, gen_jcf_label,
2874 finish_jcf_block, define_jcf_label, get_jcf_label_here,
2875 put_linenumber, localvar_alloc, localvar_free, get_access_flags,
2876 write_chunks, adjust_typed_op, generate_bytecode_conditional,
2877 generate_bytecode_return, perform_relocations, init_jcf_state,
2878 init_jcf_method, release_jcf_state, generate_classfile):
2879 Add static prototype.
2880 (emit_unop): Mark parameter `type' with ATTRIBUTE_UNUSED.
2881 (make_class_file_name): Const-ify.
2883 * jcf.h (find_classfile): Const-ify.
2885 * jv-scan.c (reset_report): Remove prototype.
2887 * jvgenmain.c: Include jcf.h/tree.h/java-tree.h.
2888 (error): Rewrite to allow varargs.
2890 * lang.c (lang_f_options): Const-ify.
2892 * lex.c (java_parse_escape_sequence): Add static prototype.
2893 (java_allocate_new_line): Match definition to existing static
2896 * mangle.c Include tree.h/java-tree.h.
2897 (unicode_mangling_length, emit_unicode_mangled_name,
2898 append_gpp_mangled_name, append_gpp_mangled_classtype): Const-ify.
2900 * parse.h (jdep_code): Remove trailing comma in enumeration.
2901 (java_get_line_col): Move prototype outside of !JC1_LITE test.
2902 (reset_report): Add prototype.
2904 * verify.c (push_pending_label, merge_types): Add static
2907 * zipfile.h (opendir_in_zip, open_in_zip): Prototype.
2909 1999-03-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
2911 * parse.y (find_applicable_accessible_methods_list): Extend the
2912 search to superinterfaces when relevant.
2913 (search_applicable_methods_list): New function.
2915 1999-03-18 Alexandre Petit-Bianco <apbianco@cygnus.com>
2917 * class.c (unmangle_classname): Implemented stricter testing
2918 before setting the QUALIFIED_P flag on an identifier.
2920 Tue Mar 16 15:15:41 1999 Per Bothner <bothner@cygnus.com>
2922 * parse.y (java_complete_lhs): Call force_evaluation_order
2923 after patch_newarray.
2924 (patch_binop): Don't call fold if there are side effects.
2926 1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
2928 * parse.y (java_stabilize_reference): Use save_expr instead of
2929 building a SAVE_EXPR node.
2930 (java_complete_lhs): Patch the resulting string of the `+='
2931 operator (if necessary) and complete the RHS after having built
2934 Mon Mar 15 12:18:29 1999 Per Bothner <bothner@cygnus.com>
2936 * class.c (make_class): Don't set CLASS_P here (because
2937 this function is also called by build_java_array_type).
2938 (push_class): Set CLASS_P here instead.
2939 * parse.h (TYPE_CLASS_P): Check for TYPE_ARRAY_P is redundant.
2941 * jcf-dump.c (print_access_flags): Take extra parameter to indicate
2942 context. If the context is class, perfer "super" over "synchronized".
2943 * jcf-write.c (generate_classfile): Don't add ACC_SUPER if interface.
2945 * parse.y (create_class): Don't call parser_check_super here;
2946 it is not robust. Always wait until later.
2948 * parse.y (method_header): For interfaces, set ACC_ABSTRACT (to
2949 match what JDK 1.2 does), but don't set ACC_PUBLIC.
2951 Sat Mar 13 18:16:34 1999 Per Bothner <bothner@cygnus.com>
2953 * lex.c (java_read_char): UNGET invalid non-initial utf8 character.
2954 * lex.h (UNGETC): Change misleading macro.
2956 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
2958 * parse.y (java_stabilize_reference): Return NODE when patching a
2960 (java_complete_lhs): Put parenthesis around truth values.
2962 1999-03-12 Alexandre Petit-Bianco <apbianco@cygnus.com>
2964 * class.c (layout_class_method): Don't make rtl for interface
2966 * parse.h (GET_TYPE_NAME): New macro.
2967 * parse.y (if_then_statement:): Fixed indentation.
2968 (if_then_else_statement:): Likewise.
2969 (for_statement:): Fixed spacing.
2970 (try_statement:): Fixed indentation.
2971 (create_interface): Don't force interfaces to be abstract.
2972 (method_header): Abstract methods are OK in interfaces.
2973 (declare_local_variables): Fixed typo in comment.
2974 (java_complete_expand_method): Fixed indentation.
2975 (resolve_qualified_expression_name): Use GET_TYPE_NAME to report
2976 non accessible fields.
2977 (java_stabilize_reference): New function.
2978 (java_complete_lhs): Fixed indentation. Use
2979 java_stabilize_reference in compound assignement. Insert the
2980 cast. If not processing `+' fix string constants before processing
2983 Fri Mar 12 19:42:55 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2985 * constants.c (find_class_or_string_constant): Cast variable `j'
2986 to a `jword' when comparing against one.
2988 * expr.c (java_lang_expand_expr): Remove unused variables
2989 `has_finally_p' and `op0'.
2991 * gjavah.c (print_field_info): Cast a value to jint when comparing
2992 against one. Likewise for a jlong.
2993 (add_namelet): Likewise cast a `sizeof' to an int when comparing
2994 against a signed quantity.
2996 * jcf-dump.c (print_signature_type): Remove unused variable `digit'.
2997 (print_signature): Don't needlessly dereference variable `str'
2999 * jcf-reader.c (get_attribute): Mark variables `max_stack' and
3000 `max_locals' with ATTRIBUTE_UNUSED.
3001 (jcf_parse_class): Likewise for variable `index'.
3003 * parse.h (reverse_jdep_list): Remove static prototype.
3005 * parse.y (build_jump_to_finally): Remove prototype and definition.
3006 (reverse_jdep_list): Add static prototype.
3008 * typeck.c (convert_ieee_real_to_integer): Remove unused variables
3009 `assignment' and `expr_decl'.
3011 * verify.c (verify_jvm_instructions): Remove unused label `bad_ldc'.
3013 1999-03-12 Andrew Haley <aph@cygnus.com>
3015 * jcf-path.c (add_entry): alloca len+2 rather than len+1 bytes;
3016 we'll need a directory separator and a null character.
3018 Wed Mar 10 23:20:11 1999 Per Bothner <bothner@cygnus.com>
3020 * jcf-write.c (generate_bytecode_insns): Handle __builtin_fmod, for %.
3022 Tue Mar 9 11:52:08 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3024 * parse.y (method_header): Don't set ACC_ABSTRACT flags on
3027 Fri Mar 5 15:17:29 1999 Per Bothner <bothner@cygnus.com>
3029 * lex.c (java_parse_end_comment): Take extra parameter (next char).
3031 * class.c (build_utf8_ref): Fix possible name class/ambiguity.
3033 * class.c (layout_class_method): A static method in a base class
3034 is never overridden, so treat it like it doesn't exist.
3035 However, do complain about private non-static method overriding
3036 public static method.
3038 * parse.y: Don't set unused INITIALIZED_P flag.
3039 * java-tree.h (INITIALIZED_P): Removed no-longer needed flag.
3041 * parse.y (find_expr_with_wfl): Optimize tail-calls.
3042 (build_array_from_name): Re-order &index[string] to &string[index].
3044 * parse.y (java_complete_lhs): Don't call patch_assignment if rhs is
3045 error_mark (it might catch more errors, but it is more likely to lose).
3047 Sat Mar 6 11:17:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3049 * Makefile.in (jcf-parse.o): Depend on $(PARSE_H).
3050 (parse-scan.o): Depend on toplev.h.
3052 * class.c (make_method_value): Add prototype. Make it static.
3053 Remove unused second argument, caller changed.
3055 * expr.c (java_lang_expand_expr): Remove unused variable
3058 * java-tree.h: Don't prototype find_in_current_zip.
3059 Add prototypes for verify_constant_pool, start_java_method,
3060 end_java_method, give_name_to_locals, expand_byte_code,
3061 open_in_zip, set_constant_value, find_constant1, find_constant2,
3062 find_utf8_constant, find_string_constant, find_class_constant,
3063 find_fieldref_index, find_methodref_index, write_constant_pool,
3064 count_constant_pool_bytes and encode_newarray_type.
3066 * jcf-dump.c: Remove unused variable `LONG_temp'.
3068 * jcf-parse.c: Include parse.h.
3069 (jcf_parse_source): Remove unused parameter, all callers changed.
3070 (jcf_figure_file_type): Add static prototype.
3071 (find_in_current_zip): Likewise. Also remove unused parameter,
3072 all callers changed.
3073 (read_class): Initialize variable `saved_pos'.
3075 * jcf-reader.c (jcf_parse_preamble): Mark variables
3076 `minor_version' and `major_version' with ATTRIBUTE_UNUSED.
3078 * lex.c (java_is_eol): Wrap prototype and definition in !JC1_LITE.
3079 (java_init_lex): Wrap variable `java_lang_imported' in !JC1_LITE.
3080 (java_parse_doc_section): Initialize variable `seen_star'.
3081 (java_lex): Wrap variable `number_beginning' in !JC1_LITE.
3082 (java_lex_error): Mark parameters `msg' and `forward' with
3084 (java_get_line_col): Mark parameters `filename' and `line' with
3087 * parse-scan.y: Include toplev.h.
3088 (yyerror): Mark parameter `msg' with ATTRIBUTE_UNUSED.
3090 * parse.h: use `struct JCF', not plain `JCF'.
3091 (java_parser_context_save_global, java_expand_classes
3092 java_parser_context_restore_global, java_parse): Add prototypes.
3094 * typeck.c (convert_ieee_real_to_integer): Remove unused variable
3097 Wed Feb 24 16:13:59 1999 Per Bothner <bothner@deneb.cygnus.com>
3099 * check-init.c (check_init): COPYN takes word count, not bit count.
3101 Fri Feb 26 14:06:21 1999 Per Bothner <bothner@cygnus.com>
3103 * typeck.c (convert_ieee_real_to_integer): Use save_expr instead of
3104 explicit build_decl. (Avoids crash in reload when optimizing.)
3106 Thu Feb 25 21:05:04 1999 Per Bothner <bothner@cygnus.com>
3108 * decl.c (complete_start_java_method): Handle synchronized method
3109 even when compiling from bytecode.
3111 1999-02-26 Tom Tromey <tromey@cygnus.com>
3113 * gjavah.c (add_class_decl): Only generate `#include' if outer
3114 class is not the name of the class we are processing. Correctly
3115 append `.h' in #include.
3116 (process_file): Clean up newlines around generated `#include's.
3117 (decode_signature_piece): Correctly handle inner classes.
3118 (struct include): New structure.
3119 (all_includes): New global.
3120 (print_include): New function.
3121 (add_class_decl): Use it.
3122 (process_file): Likewise.
3123 (add_class_decl): Generate include for java-array.h if array
3125 (process_file): Don't generate java-array.h include.
3127 * gjavah.c (add_namelet): Check for standard package names here.
3128 (add_class_decl): Don't check for standard package names here.
3130 1999-02-25 Tom Tromey <tromey@cygnus.com>
3132 * parse.y (read_import_dir): Use `|=', not `+=', to set `found'.
3133 When reading a zip file, only use strncmp if both strings are
3134 bigger than the buffer length. Initialize `k' when looping
3137 1999-02-24 Tom Tromey <tromey@cygnus.com>
3139 * gjavah.c (struct namelet): New structure.
3140 (add_namelet): New function.
3141 (print_namelet): New function.
3142 (print_class_decls): Use add_namelet and print_namelet to generate
3143 namespaces and not classes.
3144 (method_printed): New global.
3145 (HANDLE_END_METHOD): Examine method_printed.
3146 (print_method_info): Set method_printed when required. Print
3147 error if function to be ignored is marked virtual. Handle $finit$
3149 (METHOD_IS_FINAL): New macro.
3150 (print_field_info): Use it.
3151 (HANDLE_METHOD): Clear method_printed.
3152 (method_pass): New global.
3153 (HANDLE_END_FIELD): Call add_class_decl on the first pass.
3154 (process_file): Do two passes over both fields and methods.
3155 (HANDLE_METHOD): Examine method_pass.
3157 (add_class_decl): New function.
3158 (print_class_decls): Don't scan over entire constant pool.
3160 1999-02-23 Tom Tromey <tromey@cygnus.com>
3162 * jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
3163 disable linking in that case.
3165 1999-02-20 Tom Tromey <tromey@cygnus.com>
3167 * jcf.h (UTF8_GET): Mask first byte of 3-byte encoding with 0x0f,
3170 Sun Feb 21 14:56:11 1999 Per Bothner <bothner@cygnus.com>
3172 * decl.c (build_result_decl), java-tree.h: New method.
3173 (complete_start_java_method): Handle synchronized methods.
3174 Don't build DECL_RESULT here. (Ordering dependency problem.)
3175 (start_java_method): Call build_result_decl here instead ...
3176 * parse.y (java_complete_expand_method): ... and here.
3177 (expand_start_java_method): Don't call complete_start_java_method here.
3178 (java_complete_expand_method): Call it here instead.
3179 * parse.h (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Moved to ..
3180 * java-tree.h: ... here.
3182 * expr.c (force_evaluation_order): Fix typo, don't handle ARRAY_REF.
3183 * parse.y (java_complete_lhs): Don't call force_evaluation_order
3184 for ARRAY_REF - it doesn't work when array bounds are checked.
3185 (patch_array_ref): Handle it here instead.
3187 * jcf-write.c (generate_classfile): Emit "Exceptions" attribute.
3189 Fri Feb 19 15:35:01 1999 Per Bothner <bothner@cygnus.com>
3191 Force left-to-right evaluation of binary operations etc.
3192 * expr.c (force_evaluation_order), java-tree.h: New function.
3193 * parse.y (java_complete_lhs): Pass binary operations, procedure
3194 calls, and ARRAY_REFs to force_evaluation_order.
3195 (various): Set TREE_SIDE_EFFECTS more carefully.
3197 Tolerate random (non-UTF8) encoding in comments without complaining.
3198 * lex.c (java_read_char): Return 0xFFFE if bad UTF8 encoding.
3199 (java_is_eol): Handle '\r' followed by '\n' instead of vice versa.
3201 * parse.y (resolve_qualified_expression_name): Handle error_mark.
3202 (java_complete_node case EXPR_WITH_FILE_LOCATION): Likewise.
3204 * parse.y (java_complete_lhs): Ignore an empty statement in a
3205 COMPOUND_EXPR. Don't complain about empty statement after return.
3207 Fri Feb 19 13:00:56 1999 Per Bothner <bothner@cygnus.com>
3209 * parse.y (obtain_incomplete_type): Don't wrap unknown types
3210 in TREE_LIST - just chain the POINTER_TYPEs together.
3211 (resolve_class): If type already resolved, return decl.
3212 After resolving, update TREE_TYPE(class_type), and name (if array).
3213 * parse.h (do_resolve_class), parse.y: Make non-static.
3214 * class.c (maybe_layout_super_class): Take this_class argument.
3215 Do do_resolve_class if necessary.
3216 (layout_class, layout_class_methods): Adjust calls appropriately.
3217 * parse.h (JDEP_TO_RESOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
3218 JDEP_RESOLVED_P): Redefined for new TREE_LIST-less convention.
3219 * typeck.c (build_java_array_type): Don't call layout_class.
3221 Wed Feb 17 15:47:20 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3223 * parse.y (check_pkg_class_access): Allow private class access
3224 within the same package.
3225 (strip_out_static_field_access_decl): New function.
3226 (patch_unaryop): Call strip_out_static_field_access_decl on ++/--
3227 operator argument before testing its nature.
3229 Wed Feb 3 12:38:43 1999 Per Bothner <bothner@cygnus.com>
3231 * java-tree.def (FINALLY_EXPR): Removed. (Now uses TRY_FINALLY_EXPR.)
3232 (TRY_EXPR): Simplify - it no longer has a finally clause.
3233 * check-init.c (check_init): Handle TRY_FINALLY_EXPR.
3234 Simpler handling of TRY_EXPR, which no longer has a finally clause.
3235 * expr.c (java_lang_expand_expr): Likewise.
3236 * java-tree.h (CATCH_EXPR_GET_EXPR): Removed - no longer needed.
3237 * parse.h (java_get_catch_block), parse.y: Removed - no longer needed.
3238 * parse.y (java_complete_lhs): Add support for TRY_FIANLLY_EXPR.
3239 (build_try_statement): Remove finally parameter and handling.
3240 (build_try_finally_statement): New function.
3241 (patch_try_statement): No longer need to support finally clause.
3242 (try_statement): Update grammar action rules.
3243 * jcf-write.c (generate_bytecode_insns): Handle TRY_FINALLY_EXPR.
3244 Simpler handling of TRY_EXPR, which no longer has a finally clause.
3246 1998-11-26 Andrew Haley <aph@viagra.cygnus.co.uk>
3248 * jcf-parse.c (get_constant): Add braces around computation of 'd'
3249 when REAL_ARITHMETIC is not defined. [Oct 26 fix got overwritten -PB]
3251 1999-02-17 Andrew Haley <aph@cygnus.com>
3253 * class.c (build_utf8_ref): Back out broken patch which was
3254 intended to to output signatures using '.' as a separator.
3256 * class.c (make_class_data): Output signatures using '.' as a
3257 separator, rather than '/'.
3258 (mangled_classname): Likewise.
3259 (make_field_value): Likewise.
3260 (make_method_value): Likewise.
3261 * constants.c (alloc_class_constant): Likewise.
3262 * expr.c (build_invokeinterface): Likewise.
3264 Thu Feb 11 21:25:51 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3266 * parse.y (valid_builtin_assignconv_identity_widening_p): Got rid
3267 of an ancient workaround.
3269 Wed Feb 10 23:27:33 1999 Jeffrey A Law (law@cygnus.com)
3271 * jvspec.c (xmalloc): Kill the prototype. It does not belong
3274 1999-02-10 Alexandre Petit-Bianco <apbianco@cygnus.com>
3276 * lex.c (yylex): Encode \0 as UTF8.
3278 1999-02-10 Tom Tromey <tromey@cygnus.com>
3280 * jvspec.c (lang_specific_driver): Use libgcj, not libjava.
3281 * Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
3282 (libgcj_zip): Renamed.
3283 * jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
3285 (jcf_path_init): Use LIBGCJ_ZIP_FILE.
3287 * jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
3288 (GC_NAME): Renamed -lgc to -lgcjgc.
3290 Tue Feb 9 19:31:09 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3292 * lex.c (java_lang_cloneable): Initialize.
3293 * parse.y (java_lang_cloneable): New static variable.
3294 (qualify_ambiguous_name): Take CONVERT_EXPR into account when
3295 doing one more qualification round.
3296 (valid_ref_assignconv_cast_p): Reject null source or
3297 destination. Allow an array to be cast into java.lang.Cloneable.
3298 (patch_cast): Swapped two first arguments to first call to
3299 valid_ref_assignconv_cast_p.
3301 Mon Feb 8 11:50:50 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3303 * parse.h: DECL_P renamed JDECL_P.
3304 * parse.y: DECL_P replaced by JDECL_P.
3305 (build_array_from_name): Always use pointer's type.
3306 (patch_bc_statement): Extra code to search continue target in a
3307 for loop. Fixed comments. Continue target is current loop when
3310 1999-02-05 Andrew Haley <aph@cygnus.com>
3312 * class.c (make_class_data): The superclass of an interface should
3313 be null, not class Object.
3315 * lex.c (java_lex): Sign extend hex literals.
3317 1999-02-04 Andrew Haley <aph@cygnus.com>
3319 * class.c (build_utf8_ref): Output signatures using '.' as a
3320 separator, rather than '/'.
3321 (make_class_data): Likewise.
3323 Wed Feb 3 22:50:17 1999 Marc Espie <Marc.Espie@liafa.jussieu.fr>
3325 * Make-lang.in ($(GCJ)(exeext)): Remove choose-temp.o, pexecute.o and
3326 mkstemp.o. Get them from libiberty now.
3328 Tue Feb 2 19:49:12 1999 Jeffrey A Law (law@cygnus.com)
3330 * jcf-io.c: Do not include sys/stat.h or sys/wait.h
3332 Tue Feb 2 20:04:50 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3334 * jvspec.c (xmalloc): Fix the prototype to match the one obtained
3337 Tue Feb 2 10:39:47 1999 Per Bothner <bothner@cygnus.com>
3339 Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
3340 * jcf-write.c (generate_bytecode_return): New function.
3341 (generate_bytecode_insns): Use it, for RETURN_EXPR.
3343 * jcf-write.c (generate_bytecode_insns): For REAL_CST that is 0 or 1,
3344 generate special [fd]const_[01] instructions.
3346 * jcf-parse.c (yyparse): Don't emit_register_classes if -fsyntax-only.
3348 * verify.c (verify_jvm_instructions): Do INVALIDATE_PC after
3349 handling OPCODE_lookupswitch or OPCODE_tableswitch.
3351 Mon Feb 1 20:44:47 1999 Per Bothner <bothner@cygnus.com>
3353 * parse.y (patch_method_invocation): Handle calling static methods,
3354 even in the form EXPR.METHOD(ARGS), not just TYPE.METHOD(ARGS).
3356 * parse.y (java_complete_lhs): Don't complain about unreachable
3357 exit condition in a do-while statement.
3359 Fri Jan 29 18:19:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3361 * lex.c (java_read_char): Fixed utf8 decoding.
3362 (java_unicode_2_utf8): Fixed utf8 encoding in the 0x800-0xffff
3364 * parse.y (valid_builtin_assignconv_identity_widening_p): Fixed
3365 comments. Local variable `all_primitive' is gone. Broadened
3366 acceptance of `0' to floating point targets. `long' can now be
3367 widened to `double' or `float'.
3368 (valid_method_invocation_conversion_p): Added leading
3369 comment. Fixed tabulation.
3370 (build_string_concatenation): Optimize out left or right empty
3373 Thu Jan 28 18:51:26 1999 Per Bothner <bothner@cygnus.com>
3375 * jcf-write.c (localvar_alloc): Only emit entry for
3376 LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
3377 (generate_bytecode_insns): Only call put_linenumber if
3378 debug_info_level > DINFO_LEVEL_NONE.
3379 * jvspec.c (lang_specific_driver): If no -O* or -g* option
3380 is specified, add -g1 (for compatibility wih javac).
3382 Thu Jan 28 09:17:51 1999 Hans-Peter Nilsson <hp@axis.se>
3384 * java/Makefile.in: Add missing dependencies for jcf-dump.o,
3385 gjavah.o, check-init.o, jv-scan.o
3387 Mon Feb 1 09:50:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3389 * Makefile.in (gjavah.o): Depend on $(CONFIG_H) and system.h.
3391 * gjavah.c: Include config.h and system.h.
3393 * javaop.h (inline): Don't define, its handled by system.h.
3394 (WORD_TO_FLOAT, WORDS_TO_LONG, WORDS_TO_DOUBLE): Change these
3395 from `inline' to `static inline'.
3397 * jcf.h (inline): Don't define, its handled by system.h.
3399 * lex.c (inline): Likewise.
3401 Sun Jan 31 20:34:29 1999 Zack Weinberg <zack@rabi.columbia.edu>
3403 * lang-specs.h: Map -Qn to -fno-ident.
3405 Fri Jan 29 16:51:56 1999 Richard Henderson <rth@cygnus.com>
3407 * check-init.c (check_init): Fix CLEANUP_POINT_EXPR typo.
3409 1999-01-29 Tom Tromey <tromey@cygnus.com>
3411 * parse.h (BUILD_APPEND): If ARG is a non-String object reference,
3412 then cast it to Object before calling `append' method.
3414 Thu Jan 28 14:45:39 1999 Per Bothner <bothner@cygnus.com>
3416 * check-init.c (check_bool2_init, check_bool_init, check_init):
3417 Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
3418 * jcf-write.c (generate_bytecode_insns): Likewise.
3420 Thu Jan 28 11:50:11 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3422 * jcf-parse.c (jcf_parse): Don't parse the same class file twice.
3423 * parse.y (patch_cast): Allow a boolean to be cast into a
3426 Wed Jan 27 10:19:29 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3428 * parse.y: (class_declaration:): Fixed indentation.
3429 (class_member_declaration:): Extra `;' after field declaration now
3431 (interface_declaration:): Removed debug messages in error reports.
3432 (patch_binop): Nodes created and returned inherit the orignal
3433 node's COMPOUND_ASSIGN_P flag value.
3434 (patch_cast): Fix cast from char to floating point.
3436 Mon Jan 25 17:39:19 1999 Andrew Haley <aph@cygnus.com>
3438 * except.c, java-except.h (expand_resume_after_catch): new
3440 * expr.c (java_lang_expand_expr): call expand_resume_after_catch
3441 to branch back to main flow of control after a catch block.
3443 Sat Jan 23 23:02:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3445 * Makefile.in (parse.o): Depend on $(CONFIG_H) and
3446 $(srcdir)/../system.h.
3447 (class.o): Depend on $(PARSE_H) and $(srcdir)/../output.h.
3448 (jcf-parse.o): Depend on $(srcdir)/../toplev.h.
3449 (jcf-write.o): Likewise.
3450 (jv-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
3451 (mangle.o): Depend on $(srcdir)/../toplev.h.
3452 (parse-scan.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
3453 (zextract.o): Depend on $(CONFIG_H) and $(srcdir)/../system.h.
3455 * class.c: Include output.h and parse.h.
3456 (mangled_classname): Add the `const' keyword to a char*.
3457 (find_named_method): Hide unused function definition.
3458 (build_utf8_ref): Change type of variable `c' to unsigned char.
3459 Use ISALPHA/ISDIGIT instead of isalpha/isdigit.
3460 (build_class_ref): Add the `const' keyword to a char*.
3461 (layout_class_method): Remove unused variable `buf'.
3463 * decl.c (find_local_variable): Remove unused variable `rtl'.
3464 (pushdecl): Likewise for variables `different_binding_level' and
3466 (pushlevel): Mark parameter `unused' with ATTRIBUTE_UNUSED.
3467 (maybe_build_cleanup): Likewise for parameter `decl'.
3469 * except.c (expand_start_java_handler): Mark parameter `range'
3470 with ATTRIBUTE_UNUSED.
3472 * expr.c: Include except.h.
3473 (pop_type): Remove unused variable `i'.
3474 (pop_value): Likewise for variables `n_words' and `i'.
3475 (expand_java_arrayload): Likewise for variable `convert'.
3476 (java_lang_expand_expr): Likewise for variables `op0', `type',
3477 `mode', `unsignedp', `node' and `elements'.
3478 (expand_byte_code): Likewise for variables `prev_eh_ranges' and
3480 (process_jvm_instruction): Add a `const' qualifier to a char*.
3482 * gjavah.c (output_directory): Add the `const' keyword to a char*.
3483 (temp_directory): Likewise.
3484 (print_c_decl): Likewise.
3485 (print_method_info): Likewise.
3486 (decode_signature_piece): Likewise.
3487 (print_mangled_classname): Likewise.
3489 * java-except.h: Provide prototypes for maybe_start_try,
3490 maybe_end_try and add_handler.
3492 * java-tree.h (mangled_classname): Add the `const' keyword to a char*.
3493 (parse_error_context): Likewise. Also add ATTRIBUTE_PRINTF_2.
3494 (pushdecl_top_level, alloc_class_constant, unicode_mangling_length,
3495 init_expr_processing, push_super_field, init_class_processing,
3496 can_widen_reference_to, class_depth, verify_jvm_instructions,
3497 maybe_pushlevels, maybe_poplevels, process_jvm_instruction,
3498 set_local_type, merge_type_state, push_type, load_type_state,
3499 add_interface, find_in_current_zip, append_gpp_mangled_classtype,
3500 emit_unicode_mangled_name): Add prototypes.
3502 * jcf-dump.c (print_constant): Add the `const' keyword to a char*.
3503 (print_signature_type): Use ISDIGIT, not isdigit.
3504 (print_signature): Remove unused variable `j'.
3506 * jcf-io.c (jcf_filbuf_from_stdio): Cast the result of `fread' to
3507 int when comparing against one.
3509 * jcf-parse.c: Include toplev.h.
3511 * jcf-write.c: Likewise. Don't include <string.h> or <sys/stat.h>.
3512 (localvar_free): Remove unused variable `i'.
3513 (generate_bytecode_conditional): Likewise for variable `kind'.
3515 * jv-scan.c: Include config.h and system.h. Remove redundant
3516 OS header and gansidecl.h includes.
3517 (warning): Add the `const' keyword to a char*. Also add
3518 ATTRIBUTE_PRINTF_1 to the prototype. Check ANSI_PROTOTYPES, not
3519 __STDC__, when determining whether to use ANSI-isms.
3520 (fatal): Likewise. Also add ATTRIBUTE_UNUSED.
3521 (xmalloc): Don't redundantly prototype here.
3522 (main): Remove unused parameter `envp'. Also fix the arguments
3523 passed to function `fatal' to match the format specifier.
3525 * lang.c (java_tree_code_name): Add the `const' keyword to a char*.
3527 * mangle.c: Include toplev.h.
3528 (emit_unicode_mangled_name): Declare parameter `len'.
3530 * parse.y (parse_warning_context): Add the `const' keyword to a
3531 char*. Also add ATTRIBUTE_PRINTF_2 to the prototype. Check
3532 `ANSI_PROTOTYPES' not `__STDC__' for whether to use ANSI-isms.
3533 (issue_warning_error_from_context): Add the `const' keyword to
3535 (parse_error_context): Likewise. Also check `ANSI_PROTOTYPES'
3536 not `__STDC__' for whether to use ANSI-isms.
3538 * typeck.c (incomplete_type_error): Mark parameters `value' and
3539 `type' with ATTRIBUTE_UNUSED.
3540 (parse_signature_type): Use ISDIGIT, not isdigit.
3542 * verify.c (check_pending_block): Add the `const' keyword to a char*.
3543 (verify_jvm_instructions): Likewise. Remove unused variables
3544 `field_name' and `default_val'.
3546 * zextract.c: Include config.h and system.h. Remove redundant
3549 * zipfile.h: Prototype `read_zip_archive'.
3551 Thu Jan 21 16:00:06 1999 Andrew Haley <aph@cygnus.com>
3553 * typeck.c (convert): Allow conversions to void type: some
3554 optimizations in gcc do this.
3556 Thu Jan 21 15:21:49 1999 Andrew Haley <aph@cygnus.com>
3558 * typeck.c (convert_ieee_real_to_integer): New function.
3559 (convert): When not using fast-math and using hardware fp, convert
3560 an IEEE NaN to zero.
3562 1999-01-18 Andrew Haley <aph@cygnus.com>
3564 * parse.y (patch_binop): Do a type conversion from signed to
3565 unsigned and then back to signed when a ">>>" is found.
3567 Sun Jan 17 22:34:22 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3569 * java-tree.h: (check_for_initialization): Added prototype.
3570 * lex.c (java_parse_doc_section): `\n' breaks the `*/' string.
3571 * parse.y (do_resolve_class): Removed unused locals.
3572 (read_import_dir): Likewise.
3573 (resolve_qualified_expression_name): Array creation
3574 expressions are valid primary expressions.
3575 (qualify_ambiguous_name): Likewise.
3576 (patch_synchronized_statement): Removed unused local.
3578 Sun Jan 17 21:55:42 1999 Jeffrey A Law (law@cygnus.com)
3580 * Makefile.in (zextract.o): Add dependencies.
3582 * Makefile.in: Do not put ^Ls at the start of a line.
3584 Fri Jan 15 20:16:20 1999 Per Bothner <bothner@cygnus.com>
3586 * expr.c (process_jvm_instruction): Coerce to correct Throwable
3587 sub-type the result of the call that gets the exception value.
3589 * parse.y (java_complete_expand_methods): If flags_syntax_only,
3590 don't call finish_class.
3592 * parse.y (java_check_regular_methods): If METHOD_PRIVATE,
3593 clear found before continuing.
3595 * verify.c (verify_jvm_instructions): On an array load, allow
3596 and handle top of stack to be TYPE_NULL.
3598 * gjavah.c (generate_access): Translate Java package private or
3599 protected access to C++ public, but with a comment.
3601 1999-01-13 Andrew Haley <aph@cygnus.com>
3603 * expr.c (generate_name): Name prefix changed to avoid clashes
3604 with assembler temp labels.
3606 * parse.y (patch_synchronized_statement): Set TREE_SIDE_EFFECTS on
3607 MODIFY_EXPR. Without this, code for the assignement may not be
3608 generated at all and the synchronized statement will read an
3609 uninitialized variable.
3611 Wed Jan 13 01:24:54 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
3613 * class.c (maybe_layout_super_class): Fixed returned value.
3614 * lex.c: Added 1999 to the copyright.
3615 (java_init_lex): Initialize java_lang_imported.
3616 * lex.h: Added 1999 to the copyright.
3617 * parse.h: Added 1999 to the copyright.
3618 (REGISTER_IMPORT): Fixed typo in trailing macro.
3619 (CURRENT_OSB): New macro.
3620 (struct parser_ctxt): New fields osb_depth, osb_limit.
3621 * parse.y (java_lang_id): New global variable.
3622 (type_import_on_demand_declaration): Don't import java.lang.* twice.
3623 (array_creation_expression:): Use CURRENT_OSB.
3624 (dims:): Uses a stack to keep track of array dimensions.
3625 (cast_expression:): Use CURRENT_OSB.
3626 (find_expr_with_wfl): Return NULL if node found doesn't meet the
3628 (register_fields): Fixed typos in comment.
3629 (check_method_redefinition): Fixed comment indentation.
3630 (java_check_regular_methods): Set saved found wfl to NULL after
3631 having reinstalled it in the previously found DECL_NAME.
3633 Sun Jan 10 13:36:14 1999 Richard Henderson <rth@cygnus.com>
3635 * gjavah.c (java_float_finite): Use a union to do type punning.
3636 (java_double_finite): Likewise.
3638 Sat Jan 9 11:25:00 1999 Per Bothner <bothner@cygnus.com>
3640 * parse.y (build_new_array_init): Don't set EXPR_WFL_LINECOL
3641 on CONSTRUCTOR (since that trashes TREE_CST_RTL).
3642 (patch_new_array_init): Clear TREE_CONSTANT also if INDIRECT_REF.
3643 (register_fields): Set TREE_STATIC on NEW_ARRAY_INIT, not on
3644 CONSTRUCTOR (which causes expand_expr to call output_constant_def).
3645 * expr.c (java_lang_expand_expr): Check TREE_STATIC of NEW_ARRAY_INIT.
3647 Fri Jan 8 15:48:03 1999 Per Bothner <bothner@cygnus.com>
3649 * check-init.c (check_init): If compiling to native, we don't
3650 see THROW_EXPR. Instead, look for a call to throw_node (_Jv_Throw).
3652 1999-01-08 Tom Tromey <tromey@cygnus.com>
3654 * parse-scan.y (variable_declarator_id): Set or increment
3656 (bracket_count): New global.
3657 (formal_parameter): Handle case where bracket pairs trail variable
3660 1999-01-07 Andrew Haley <aph@viagra.cygnus.co.uk>
3662 * jcf-parse.c (yyparse): variable len changed from a char to an
3663 int to prevent overflow.
3665 Wed Jan 6 17:19:46 1999 Per Bothner <bothner@cygnus.com>
3667 * java-tree.h: Declare read_class.
3668 * jcf-parse.c (read_class): New function.
3669 (load_class): Now just call read_class.
3671 * java-tree.h (java_parse_abort_on_error): Only return if new errors.
3672 * jcf-parse.c (parse_source_file): Declare save_error_count,
3673 which is needed by java_parse_abort_on_error macro,
3674 * parse.y (java_layout_classes, java_expand_classes): Likewise.
3676 * parse.y (register_fields): Set TREE_STATIC flag of NEW_ARRAY_INIT
3677 constructor, if initializing a static field.
3678 (patch_new_array_init): Set TREE_CONSTANT if it is.
3679 * expr.c (java_lang_expand_expr): For a static array constructor
3680 of primitive elements, allocate the array itself statically.
3681 Disabled until we can set the vtable field statically.
3683 * check-init.c: New file. Checks for definite assignment.
3684 * Makefile.in (JAVA_OBJS): Add check-init.o.
3685 * parse.y (java_complete_expand_method): Call check_for_initialization.
3686 * parse.h (BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY): Moved to java-tree.h.
3688 Wed Jan 6 14:53:10 1999 Graham <grahams@rcp.co.uk>
3690 * parse.y : include system.h instead of including
3691 standard headers directly with the exception of <dirent.h>.
3693 Wed Jan 6 16:20:06 1999 Per Bothner <bothner@cygnus.com>
3695 * lex.h: Moved static function declarations to lex.c,
3696 to shut up some -Wall warnings.
3697 * lex.c: Static function declarations moved here.
3698 * jcf-dump.c: Small fixes to shut up -Wall warnings.
3700 Tue Jan 5 22:15:40 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3702 * Make-lang.in ($(GCJ).o): Depend on prefix.h.
3704 Tue Dec 22 11:25:19 1998 Per Bothner <bothner@cygnus.com>
3706 * expr.c (process_jvm_instruction): Do load_type_state after JSR.
3707 * verify.c (verify_jvm_instructions): Fix off-by-one error.
3709 * jcf-write.c (CHECK_PUT): Add (void) cast to avoid -Wall warnings.
3710 (localvar_alloc): Change return type to void,
3711 (emit_unop): Remove unused variable size.
3713 * jcf-write.c (struct jcf_block): Add new union.
3714 (PENDING_CLEANUP_PC, PENDING_EXIT_PC, UNDEFINED_PC): New macros.
3715 (call_cleanups): New functions.
3716 (struct jcf_partial): New fields num_finalizers and return_value_decl.
3717 (generate_bytecode_insns): Support CLEANUP_POINT_EXPR and
3718 WITH_CLEANUP_EXPR. Handle cleanups in RETURN_EXPR and EXIT_BLOCK_EXPR.
3719 * lang.c (lang_init): Call using_eh_for_cleanups.
3720 * parse.y (java_complete_lhs): For SYNCHRONIZED_EXPR, defer
3721 completing operands to patch_synchronized_statement.
3722 Support CLEANUP_POINT_EXPR, WITH_CLEANUP_EXPR.
3723 (patch_synchronized_statement): Re-write suing CLEANUP_POINT_EXPR and
3724 WITH_CLEANUP_EXPR instead of TRY_EXPR.
3726 Sun Dec 20 16:15:44 1998 John F. Carr <jfc@mit.edu>
3728 * Make-lang.in: Comment out control-Ls; they upset some makes.
3730 1998-12-18 Tom Tromey <tromey@cygnus.com>
3732 * parse.y (check_class_interface_creation): Use DIR_SEPARATOR
3735 1998-12-17 Tom Tromey <tromey@cygnus.com>
3737 * parse.y (DIR_SEPARATOR): New define.
3738 (check_class_interface_creation): Use it.
3740 * parse-scan.y (report_main_declaration): Recognize
3741 `java.lang.String' in argument to main.
3743 Wed Dec 16 16:18:59 1998 Per Bothner <bothner@cygnus.com>
3745 * parse.y (create_interface): Remove bogus test.
3747 Wed Dec 16 14:42:19 1998 Per Bothner <bothner@cygnus.com>
3749 * jcf-parse.c (get_constant): Set TREE_TYPE for string constants.
3750 (HANDLE_CONSTANTVALUE): If flag_emit_class_files, call get_constant.
3752 1998-12-16 Tom Tromey <tromey@cygnus.com>
3754 * parse-scan.y (qualified_name): Use correct sprintf format.
3756 1998-12-15 Tom Tromey <tromey@cygnus.com>
3758 * gjavah.c (print_field_info): Changed how most negative number is
3761 Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com>
3763 * parse.y (fold_constant_for_init): New function.
3764 (resolve_expression_name): Don't replace static final
3765 constant-initialized fields by its value.
3766 (java_complete_lhs): New. Same as java_complete_tree, except does
3767 not replace static final constant-initialized fields by their values.
3768 (register_fields): If there is an initializer, set DECL_INITIAL and
3769 MODIFY_EXPR_FROM_INITIALIZATION_P.
3770 (java_complete_tree): For MODIFY_EXPR, use java_complete_lhs for lhs.
3771 Only call patch_initialized_static_field if
3772 MODIFY_EXPR_FROM_INITIALIZATION_P.
3773 (patch_initialized_static_field): If not valid constant, clear
3776 * parse.y (lookup_field_wrapper): Fix thinko.
3778 * parse.y (java_complete_tree): In EXPR_WITH_FILE_LOCATION,
3779 set and restore global lineno.
3781 1998-12-14 Tom Tromey <tromey@cygnus.com>
3783 * gjavah.c (print_field_info): If value to print is the smallest
3784 value of its size, then print as hex to avoid later warnings from
3787 1998-12-14 Tom Tromey <tromey@cygnus.com>
3789 * gjavah.c (decompile_method): Decompile `return null'.
3790 (process_file): Generate `#pragma interface'.
3791 (method_declared): New global.
3792 (print_method_info): Set it.
3793 (HANDLE_CODE_ATTRIBUTE): Only print it method_declared set.
3794 (print_method_info): Handle abstract methods.
3796 Sun Dec 13 17:31:40 1998 Per Bothner <bothner@cygnus.com>
3798 * parse.y (patch_method_invocation): If class_decl is null
3799 (e.g. an array type), use original type.
3801 * parse.y (check_thrown_exceptions): Temporary hack to suppress
3802 errors about uncaught exception from clone (of array, specifically).
3804 1998-12-13 Tom Tromey <tromey@cygnus.com>
3806 * gjavah.c (decompile_method): Handle all types of `return'
3807 opcode. Decompile `return this' and `return'.
3808 (method_access): New global.
3809 (print_method_info): Set it.
3810 (decompile_method): Don't decompile a synchronized method.
3812 1998-12-13 Tom Tromey <tromey@cygnus.com>
3814 * jcf-reader.c (jcf_parse_one_method): Recognize
3816 * gjavah.c (HANDLE_END_METHOD): New macro.
3817 (HANDLE_CODE_ATTRIBUTE): New macro.
3818 (decompile_method): New function.
3819 (print_method_info): Don't print `;\n' at end of function decl.
3820 Include java-opcodes.h.
3821 (decompiled): New global.
3823 Sat Dec 12 20:13:19 1998 Per Bothner <bothner@cygnus.com>
3825 * class.c (build_class_ref): Handle PRIMTYPE.class if
3826 flag_emit_class_files.
3827 * expr.c (expand_java_field_op): Don't optimize java.lang.XXX.TYPE
3828 if flag_emit_class_files.
3829 * parse.y (java_complete_tree): Pre-liminary support for
3830 COMPONENT_REF - only to handle PRIMCLASS.TYPE.
3832 * parse.y (patch_synchronized_statement): Don't call monitorexit
3833 unless block CAN_COMPLETE_NORMALLY. Propagate that flag properly.
3835 * java-tree.h (DECL_LOCAL_STATIC_VALUE): Removed - no longer used.
3837 * zipfile.h (opendir_in_zip): New declaration.
3838 * jcf-io.c (saw_java_source): Moved to jcf-parse.c.
3839 (opendir_in_zip): New function, using code from open_in_zip.
3840 (open_in_zip): Call opendir_in_zip.
3841 (find_class): Remove no-longer-used do_class_file parameter,
3842 but add source_ok parameter. Change logic so if we find a .java file,
3843 we don't look for .class in later classpath emtries.
3844 * jcf-parse.c (load_class): Pass saw_java_source to find_class.
3845 (jcf_figure_file_type): Only call open_in_zip if correct magic number.
3846 * gjavah.c: Update call to find_class.
3847 * jcf-dump.c: Likewise.
3849 * jcf-write.c (put_linenumber): Handle duplicate line numbers.
3850 (generate_bytecode_insns): For EXPR_WITH_FILE_LOCATION, do
3851 nothing if body is empty_stmt_node.
3852 Various little fixes so SP gets correctly adjusted.
3853 For NEW_ARRAY_INIT, handle IGNORE_TARGET.
3854 For CALL_EXPR, test if static first.
3855 (generate_classfile): Ignore fields that are DECL_ARTIFICIAL,
3856 such as the ones we create for Object and Class.
3857 Set and restore current_function_decl.
3858 * parse.y: Check/set IS_AN_IMPORT_ON_DEMAND_P in read_import_dir.
3859 (note_possible_classname): New function.
3860 (read_import_entry): Removed. Merged with read_import_dir.
3861 (read_import_dir): Don't call find_class - that only gives us
3862 the first classpath entry having the needed package.
3863 Use the struct buffer data structure from buffer.h.
3864 (read_import_dir, find_in_imports_on_demand): The remembered
3865 class names now use '.' (not '/') as package separator.
3867 * parse.y (java_complete_expand_methods): Call write_classfile
3868 here, and not in java_expand_classes (which only gets first class).
3870 Sat Dec 12 19:46:04 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3872 * parse.y (<type_declaration>): Do maybe_generate_clinit last.
3873 (register_fields): If a static fields has an initializer, just
3874 chain it on ctxp->static_initialized, and handle later.
3875 (java_complete_expand_methods): Force <clinit> first.
3876 (resolve_expression_name, resolve_field_access): Just get DECL_INITIAL
3877 - it's already been completed.
3878 (patch_initialized_static_field): New function.
3879 (java_complete_field): Call it.
3881 Sat Dec 12 19:21:11 1998 Per Bothner <bothner@cygnus.com>
3883 * expr.c (encode_newarray_type, build_new_array): New functions.
3884 * java-tree.h: Declare build_new_array.
3885 * jcf-write.c (patch_newarray): Use build_new_array.
3887 * expr.c (java_lang_expand_exp): Support NEW_ARRAY_INIT.
3888 * jcf-write.c (generate_bytecode_insns): Support NEW_ARRAY_INIT.
3890 * parse.y (patch_new_array_init): Re-organize.
3891 Now is passed the actual array (pointer) type of the value.
3892 Set the type of the CONSTRUCTOR to be an ARRAY_TYPE.
3893 (patch_array_constructor): Removed - merged into patch_new_array_init.
3894 (java_complete_tree): Update patch_new_array_init.
3896 * jcf-write.c (find_constant_index): New function.
3897 (generate_bytecode_insns): Use find_constant_index.
3898 (generate_classfile): Use find_constant_index for ConstantValue.
3900 1998-12-11 Tom Tromey <tromey@cygnus.com>
3902 * expr.c (invoke_build_dtable): Renamed dtable -> vtable.
3903 * decl.c (init_decl_processing): Renamed dtable -> vtable.
3904 * class.c (make_class_data): Renamed dtable -> vtable, and
3905 dtable_method_count -> vtable_method_count.
3907 Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3909 * decl.c (long_zero_node, float_zero_node, double_zero_node): New
3910 global variables, initialized.
3911 * java-tree.h (long_zero_node, float_zero_node, double_zero_node):
3912 Declared new global variables.
3913 * lex.c (java_lex): Return long_zero_node, float_zero_node,
3914 double_zero_node, integer_zero_node upon direct matching.
3915 * parse.y (purify_type_name): Added function prototype.
3916 (duplicate_declaration_error_p): Consider new_type as potentially
3917 being a incomplete type. Use purify_type_name on type string.
3918 (method_header): saved_type: unused variable removed. Don't figure
3919 return type if method name is invalid.
3920 (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was
3921 processed by patch_unaryop.
3922 (patch_unaryop): Fixed typo in comment. Re-convert pre/post
3923 increment/decrement node into its original type after binary
3924 numeric promotion on its operands.
3926 Thu Dec 10 11:02:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3928 * parse.y (array_initializer:): Array init operand is NULL_TREE
3929 instead of a TREE_LIST of NULL_TREEs when parsing `{}'. `{,}' is
3930 now an error. Fixed indentation problems.
3931 (patch_string): Handle error_mark_node as an argument.
3932 (patch_new_array_init): Fixed indentation problems.
3933 (array_constructor_check_entry): Removed check on null wfl_value.
3934 Return an error if wfl_value's walk returns an error.
3936 Wed Dec 9 15:37:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3938 * java-tree.def (NEW_ARRAY_INIT): New Java tree code.
3939 * lex.c (java_lex): Remember column position before advancing one
3940 token. Retain location information on OCB_TK.
3941 * lex.h (typedef struct java_lc): Added new field.
3942 * parse.h (GET_SKIP_TYPE): New macro.
3943 (QUAL_DECL_TYPE): Redefined using GET_SKIP_TYPE.
3944 * parse.y (build_new_array_init, patch_new_array_init,
3945 patch_array_constructor, maybe_build_array_element_wfl,
3946 array_constructor_check_entry): New function prototypes.
3947 (switch_block:): Tagged <node>.
3948 (OCB_TK): Tagged <operator>.
3949 (array_initializer:): Installed actions.
3950 (variable_initializer): Build location information on element if
3952 (switch_statement:): Fixed indentation typo.
3953 (switch_block:): Redefined default action.
3954 (java_complete_tree): Handle NEW_ARRAY_INIT in MODIFY_EXPR:.
3955 (patch_assignment): Removed duplicate code.
3956 (maybe_build_array_element_wfl, build_new_array_init,
3957 patch_new_array_init, patch_array_constructor,
3958 array_constructor_check_entry): New functions.
3960 Mon Dec 7 15:13:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
3962 * parse.y (array_initializer): Tagged <node>.
3963 (variable_initializer:): Use default rule.
3964 (array_initializer:): Defined actions.
3965 (variable_initializers:): Likewise.
3966 (resolve_qualified_expression_name): Use DECL_CONTEXT to build
3967 non-static field accesses.
3968 (patch_invoke): Fixed indentation typo.
3969 (java_complete_tree): Likewise.
3970 (build_labeled_block): Changed leading comment. Generate an error
3971 in case of duplicate loop labels.
3972 (patch_conditional_expr): Patch results of string concatenation
3975 Sun Dec 6 13:45:00 1998 Per Bothner <bothner@cygnus.com>
3977 * constants.c (find_methodref_index): When the class is an interface,
3978 generate CONSTANT_InterfaceMethodref instead of a CONSTANT_MethodRef.
3980 * decl.c (finit_identifier_node): Use "$finit$", rather than
3981 "<finit>" (which Sun's verifier rejects).
3982 * parse.y (maybe_generate_finit): Leave out meaningless final flag.
3983 (generate_field_initialization_code): Removed.
3984 (fix_constructors) Don't add call to $finit$ here (wrong order).
3985 (patch_method_invocation): Add $finit$ call here.
3987 * java-tree.h (CALL_USING_SUPER): New macro.
3988 * parse.y (patch_invoke): Remove im local variable.
3989 (patch_method_invocation, patch_invoke): Don't pass super parameter.
3990 (patch_invoke): Use CALL_USING_SUPER instead of from_super parameter.
3991 (resolve_qualified_expression_name): Maybe set CALL_USING_SUPER.
3993 * jcf-write.c (get_access_flags): Fix typo ACC_PUBLIC -> ACC_FINAL.
3995 * parse.y (java_complete_tree): Don't complain about unreachable
3996 statement if it is empty_stmt_node.
3998 * jcf-write.c (find_constant_wide): New function.
3999 (push_long_const): Use find_constant_wide.
4001 * jcf-write.c (generate_bytecode_insn): Fix bug in switch handling.
4002 (generate_bytecode_insn): Use correct dup variant for MODIFY_EXPR.
4003 Add "redundant" NOTE_PUSH/NOTE_POP uses so code_SP_max gets set.
4004 Emit invokeinterface when calling an interface method.
4005 Emit invokespecial also when calling super or private methods.
4007 * jcf-write.c (generate_classfile): Emit ConstantValue attributes.
4009 Sun Dec 6 13:21:18 1998 Per Bothner <bothner@cygnus.com>
4011 * jcf-dump.c (INVOKE): If invokeinterface, print number of args.
4013 Thu Dec 3 17:11:12 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4015 * java-tree.h (java_layout_seen_class_methods): New function
4017 (LAYOUT_SEEN_CLASS_METHODS): Macro removed.
4018 * jcf-parse.c (parse_class_file): Call java_layout_seen_class_methods.
4019 * parse.h (PROMOTE_RECORD_IF_COMPLETE): New macro.
4020 * parse.y (method_declarator:): Defined action.
4021 (issue_warning_error_from_context): input_filename saved, set to
4022 the appropriate value and restored after java_error is called.
4023 (build_unresolved_array_type): Fixed comment.
4024 (register_fields): Use PROMOTE_RECORD_IF_COMPLETE.
4025 (method_header): Deal with return type the same way type are
4026 handled for fields and method's parameters and local variables
4028 (check_method_redefinition): Removed extra CR.
4029 (declare_local_variables): Use PROMOTE_RECORD_IF_COMPLETE.
4030 (java_layout_seen_class_methods): New function.
4031 (java_layout_classes): Call java_layout_seen_class_methods.
4033 Thu Dec 3 15:56:50 1998 Per Bothner <bothner@cygnus.com>
4035 * parse,y (patch_synchronized_statement): Set CAN_COMPLETE_NORMALLY.
4037 Thu Dec 3 15:08:30 1998 Per Bothner <bothner@cygnus.com>
4039 * jcf-dump.c (main): Fix error message.
4040 * jcf-path.c (add_entry): Style fix.
4042 Wed Dec 2 15:52:25 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4044 * class.c (layout_class_method): Call build_java_argument_signature
4045 on constructors too.
4046 * parse.y (check_method_redefinition): Use TYPE_ARGUMENT_SIGNATURE.
4047 (patch_method_invocation): Define a primary when resolving an
4048 expression name. Augmented comment on code checking illegal `this'
4049 usage. Loosened it test by accepting NEW_CLASS_EXPR.
4051 Tue Dec 1 13:53:24 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4053 * class.c (layout_class_method): Don't report error on non-static
4054 overriding static if the method is private.
4055 * java-tree.h (finish_class): Prototype added.
4056 * lex.c (java_get_line_col): Handle col argument -2 value.
4057 * parse.h: All static method declarations moved to parse.y.
4058 * parse.y: Now contains all static method declarations previously
4060 (find_expr_with_wfl, missing_return_error,
4061 unreachable_stmt_error): New functions.
4062 (java_get_real_method_name): Identify constructors bearing class
4063 names in source code compiled classes only.
4064 (java_complete_expand_methods): Call missing_return_error.
4065 (invocation_mode): Private methods invoked as static methods.
4066 (java_complete_tree): Call unreachable_stmt_error.
4068 1998-12-01 Tom Tromey <tromey@cygnus.com>
4070 * Makefile.in (+target): Removed.
4071 (+xmake_file): Likewise.
4072 (+tmake_file): Likewise.
4073 (.NOEXPORT): Removed duplicate.
4075 Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
4077 * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
4079 * jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
4081 * jvgenmain.c: Remove the xmalloc prototype, we get it from
4082 libiberty.h. Provide an xmalloc definition.
4084 * jvspec.c: Remove the xmalloc prototype.
4086 * parse-scan.y: Include config.h and system.h. Don't include
4087 OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
4088 Provide an xstrdup definition.
4090 Thu Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
4092 * jcf-path.c (add_entry): Recognize ".jar" too.
4093 * lang-specs.h: Likewise.
4095 Thu Nov 26 12:44:07 1998 Per Bothner <bothner@cygnus.com>
4097 * jcf-write.c (generate_bytecode_insns): In Call_EXPR, handle
4098 soft_monitorenter_node, soft_monitorexit_node, throw_node.
4100 * jcf-write.c (generate_bytecode_insns):
4101 Handle pre/post-increment/decrement of long.
4103 * jcf-write.c (generate_bytecode_insns):
4104 Handle missing exception handler (finally for synchronized).
4106 Wed Nov 25 09:47:15 1998 Per Bothner <bothner@cygnus.com>
4108 * java-tree.h (end_params_node): Declare global.
4109 * decl.c (end_params_node): New global.
4110 (init_decl_processing, start_java_method): Use end_params_node for
4111 end of list of parameter types. Follows correct gcc conventions.
4112 * expr.c (pop_argument_types, pop_arguments): Likewise.
4113 * lang.c (put_decl_node): Likewise.
4114 * typeck.c (various places): Likewise.
4115 * class.y (various places): Likewise.
4116 * parse.y (various places): Likewise.
4118 * parse.y (java_complete_tree): Move CAN_COMPLETE_NORMALLY.
4119 (build_jump_to_finally): Add missing CAN_COMPLETE_NORMALLY.
4121 * class.c: Add #include flags.h, remove no-longer needed declaration.
4123 * class.c (layout_class_method): Remove commented-out code, re-format.
4124 Don't add vtable entry (or index) for private methods.
4125 * expr.c (expand_invoke): A private method is implicitly final.
4126 * class.c (make_class_data): If inlining or optimizing,
4127 skip private methods.
4129 * class.c (finish_class): New function. Calls existing methods,
4130 but alls emits deferred inline functions.
4131 * jcf-parse.c (parse_class_file): Call finish_class.
4132 * parse.y (java_complete_expand_methods): Likewise.
4134 * expr.c (build_java_binop): Explicit default, to silence -Wall.
4136 * expr.c (CHECK_PC_IN_RANGE): Add void cast to kill warnings.
4138 Wed Nov 25 00:50:58 1998 Marc Espie <espie@quatramaran.ens.fr>
4140 * jcf-write.c (generate_bytecode_conditional): Fix typo.
4142 Tue Nov 24 17:06:38 1998 Per Bothner <bothner@cygnus.com>
4144 * (generate_classfile): Always write class access flag with
4147 Tue Nov 24 16:34:33 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4149 * class.c (maybe_layout_super_class): New function.
4150 (layout_class): Reorganized. Loop on class methods dispatched into
4151 a new function. Call maybe_layout_super_class.
4152 (layout_class_methods, layout_class_method): New functions.
4153 * expr.c (expand_java_NEW): Call layout_class_methods on loaded
4155 (expand_invoke): Likewise.
4156 * java-tree.h (all_class_list): New global variable declared.
4157 (layout_class_methods, layout_class_method): New function
4159 (LAYOUT_SEEN_CLASS_METHODS): New macro.
4160 * jcf-parse.c (all_class_list): New global variable.
4161 (load_class): Extended what class_or_name can be. Use parser
4162 context mechanism to save globals before calling jcf_parse.
4163 (jcf_parse_source): Don't parse twice if HAS_BEEN_ALREADY_PARSED_P
4164 is set on the file name.
4165 (jcf_parse): Layout class methods when Object is loaded, otherwise
4166 record class in all_class_list for delayed method layout.
4167 (parse_class_file): Use LAYOUT_SEEN_CLASS_METHODS.
4168 * lang.c (put_decl_node): Decode <init> into the decl context
4170 * lex.c (java_allocate_new_line): Use xmalloc.
4171 * parse.h (INCOMPLETE_TYPE_P): Redefined to work with incomplete
4172 pointers, not TREE_LIST elements.
4173 (struct parser_ctxt): Fixed comment indentations, added comments
4174 and reordered some fields.
4175 (java_check_methods): Function prototype removed.
4176 * parse.y (java_push_parser_context): Use xmalloc.
4177 (java_parser_context_restore_global): Pop extra pushed ctxp only
4178 when there's nothing next.
4179 (maybe_create_class_interface_decl): Fixed comment, add new
4180 created class decl to all_class_list.
4181 (method_header): Use GET_REAL_TYPE on argument's types.
4182 (method_declarator): Use GET_REAL_TYPE, change type to the real
4183 type in TREE_LIST dependency node. Build argument list with the
4185 (create_jdep_list): Use xmalloc. Removed allocation error message.
4186 (obtain_incomplete_type): Fixed leading comment. Broadened
4187 incoming argument meaning.
4188 (register_incomplete_type): Use xmalloc. Removed allocation error
4190 (safe_layout_class): Fixed leading comment.
4191 (jdep_resolve_class): Reversed if statement condition and switch
4193 (resolve_and_layout): Fixed leading comment. Broadened incoming
4195 (complete_class_report_errors): New local variable name, for
4196 clarity. purify_type_name used for all error cases.
4197 (java_get_real_method_name): Stricter check on constructors.
4198 (java_check_regular_methods): Reverse methods list only if not
4199 already laid out. Layout artificial constructor.
4200 (java_check_methods): Deleted.
4201 (source_start_java_method): Obtain incomplete type for patchable
4203 (java_layout_classes): Fixed leading comment. Use
4204 LAYOUT_SEEN_CLASS_METHODS, use a loop to check methods. Added else
4205 statement to layout operation, reuse LAYOUT_SEEN_CLASS_METHODS
4206 before returning. Fixed comments.
4207 (java_expand_classes): Check for errors up front.
4208 (patch_method_invocation): Class to search is resolved and laid
4211 Tue Nov 24 12:57:13 1998 Per Bothner <bothner@cygnus.com>
4213 * expr.c (java_lang_expand_expr): Add missing emit_queue.
4215 * javaop.h (int8): Removed - not used.
4216 (jbyte): Redefine portably with correct signedness.
4218 * jcf-write.c (generate_bytecode_insns): Don't free sw_state.cases.
4220 * jcf-write.c (generate_bytecode_insns): Fix typo
4221 OPCODE_getstatic to OPCODE_getfield.
4223 * java-tree.def (CASE_EXPR, DEFAULT_EXPR): Kind is 'x', not '1'.
4224 * parse.y (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR,
4225 set TREE_SIDE_EFFECTS (otherwise expand_expr may skip them).
4227 Thu Nov 19 11:16:55 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4229 * jcf-parse.c (jcf_parse_source): Function returned type is
4230 void. Added prototype.
4231 (jcf_parse): Function returned type is void.
4232 (yyparse): Remove call to fclose on the last parsed file.
4234 * java-tree.h (jcf_parse): Changed jcf_parse prototype.
4236 Wed Nov 18 23:54:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4238 * class.c (unmangle_classname): Set QUALIFIED_P when appropriate.
4239 (layout_class): Cope with methods featuring WFL in decl names.
4240 * decl.c (unqualified_object_id_node): New global variable,
4242 (build_decl_no_layout): Removed.
4243 * expr.c (build_primtype_type_ref): Handle Double.
4244 (java_lang_expand_expr): Fixed indentations.
4245 * java-tree.h (CLASS_METHOD_CHECKED_P): Flag deleted.
4246 (flag_wall, flag_redundant, flag_not_overriding,
4247 flag_static_local_jdk1_1, unqualified_object_id_node): Global
4248 variable declarations.
4249 (build_decl_no_layout): Removed prototype.
4250 (java_get_real_method_name): Added prototype.
4251 (IS_UNCHECKED_EXPRESSION_P): Renamed IS_UNCHECKED_EXCEPTION_P.
4252 (java_parse_abort_on_error): Macro now just returns.
4253 * jcf-parse.c (jcf_parse_source): Check fclose returned
4254 value. Call emit_register_classes if java_report_errors returns
4256 * lanc.c (flag_wall, flag_redundant, flag_not_overriding,
4257 flag_static_local_jdk1_1): New integer flags.
4258 (lang_decode_option): New flags set here.
4259 * parse.h (GET_REAL_TYPE, GET_METHOD_NAME): New macros.
4260 (OBSOLETE_MODIFIER_WARNING): Issue error message conditionally to
4261 the flag_redundant variable.
4262 (SET_TYPE_FOR_RESOLUTION): Consider Object being java.lang.Object
4263 when parsing java.lang.Object class.
4264 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT): Added terminal
4266 (resolve_qualified_expression_name): Fixed indentation.
4267 (patch_array_ref): Changed prototype.
4268 (not_initialized_as_it_should_p): Prototype removed.
4269 (java_report_errors): Added function prototype.
4270 * parse.y (formal_parameter:): Changed error message for not yet
4271 supported final parameters.
4272 (class_type_list:): Set both PURPOSE and VALUE of created
4273 TREE_LIST to be class_type.
4274 (primary_no_new_array:): Handle class literals on primitive types.
4275 (parse_warning_context): Reinstalled correct force_error and
4276 do_warning flags setups.
4277 (java_report_errors): Changed prototype. Return java_error_count
4279 (variable_redefinition_error): Consider treating variable type as
4281 (create_interface): Warn about redundant abstract modifier if
4282 flag_redundant is set. Changed error message.
4283 (lookup_field_wrapper): Save/restore globals before/after looking
4285 (duplicate_declaration_error_p): Consider treating declaration
4286 type as a fake pointer.
4287 (register_fields): Extract real type from dependency node. Check
4288 for duplicate field declaration after type adjustment. Use
4289 DECL_INITIAL to store static final initialized values.
4290 (method_header): Extract real function type from dependency node.
4291 (check_abstract_method_header): Use GET_METHOD_NAME.
4292 (obtain_incomplete_type): Layout fake pointer type.
4293 (safe_layout_class): Don't try to check for methods before layout.
4294 (java_complete_class): Don't check for correct throws clause
4295 elements inheritance here.
4296 (resolve_and_layout): Broadened name parameter meaning.
4297 (reset_method_name): Use GET_METHOD_NAME.
4298 (java_get_real_method_name): New function.
4299 (java_check_regular_methods): Don't check methods in
4300 java.lang.Object. Verify lineage of throws clause elements. Use
4301 flag_no_overriding in warning report.
4302 (check_throws_clauses): Don't check if class was from
4303 bytecode. Use IS_UNCHECKED_EXCEPTION_P macro.
4304 (java_check_methods): Don't set CLASS_METHOD_CHECKED_P flag.
4305 (declare_local_variables): Use flag_static_local_jdk1_1 to report
4306 warning on unsupported final local variables. Use build_decl
4307 instead of build_decl_no_layout. Get real local variable type from
4309 (source_start_java_method): Get real parameter type from
4310 dependency node. Call build_decl instead of build_decl_no_layout.
4311 (java_layout_classes): Reverse tree and layout type and class as
4312 required. Mark class as loaded when done.
4313 (resolve_field_access): Fixed indentation. Restricted condition
4314 leading to static field access code generation. Set field_type
4315 decl's TREE_TYPE if QUAL_DECL_TYPE not available.
4316 (resolve_qualified_expression_name): Initialize type_found to
4317 null. Handle static field resolved during qualification. Fixed
4318 layout on non primitive field decl types.
4319 (not_accessible_p): Fixed typo in comment.
4320 (patch_method_invocation): Resolve and layout class to search from
4322 (lookup_method_invoke): Keep integer constant 0 as is. Resolve and
4323 layout non primitive type, if necessary. Make method node only to
4325 (find_applicable_accessible_methods_list): Consider WFL'ed method
4326 decl names. Fixed indentation.
4327 (argument_types_convertible): Resolve and layout target type if
4329 (java_complete_tree): Fixed indentation problems. Rewrote
4330 CALL_EXPR thrown exceptions check. Re-installed further processing
4331 of the assignment in certain cases.
4332 (patch_assignment): Call maybe_build_primttype_type_ref to perform
4333 inlining on class literals.
4334 (valid_builtin_assignconv_identity_widening_p): Cope with constant
4336 (valid_method_invocation_conversion_p): Likewise.
4337 (patch_string): Temporary disable forbidden use of `this' in
4338 explicit constructor invocations when doing string concatenation
4340 (patch_unaryop): Added comment. Reinstalled code to disable
4341 further check on assignment operation with cast expression RHS.
4342 (patch_switch_statement): Fixed indentation.
4343 (build_try_statement): Call build_decl instead of
4344 build_decl_no_layout.
4345 (patch_synchronized_statement): Likewise.
4346 (patch_throw_statement): Use IS_UNCHECKED_EXCEPTION_P instead of
4347 IS_UNCHECKED_EXPRESSION_P.
4348 (check_thrown_exceptions_do): Changed leading comment. Resolve and
4349 layout argument exception type.
4350 (purge_unchecked_exceptions): Use IS_UNCHECKED_EXCEPTION_P instead
4351 of IS_UNCHECKED_EXPRESSION_P.
4353 Wed Nov 18 14:21:48 1998 Anthony Green <green@cygnus.com>
4355 * jcf-parse.c (yyparse): Open class file in binary mode.
4357 Sun Nov 15 17:14:17 1998 Per Bothner <bothner@cygnus.com>
4359 * jvgenmain.c: Need to #include "gansidecl.h" (to get PROTO).
4361 * jcf-write.c (perform_relocations): Move check out one loop.
4363 Sun Nov 15 15:09:56 1998 Anthony Green <green@hoser.cygnus.com>
4365 * Make-lang.in: Fix reference to srcdir.
4366 * jv-scan.c: Add missing xmalloc prototype.
4367 * jvgenmain.c: Ditto.
4369 Sun Nov 15 14:36:29 1998 Per Bothner <bothner@cygnus.com>
4371 * decl.c (error_mark_node), java-tree.h: New global.
4372 * parse.y: Use empty_stmt_node instead of size_zero_node.
4373 (build_if_else_statement): If missing else, use empty_stmt_node.
4375 * parse.y (not_initialized_as_it_should_p): Removed, with its callers.
4376 (java_complete_expand_method): Complain if return is missing.
4377 (java_check_regular_methods): Comment out incorrect error check.
4378 (not_accessible_p): Fix incorrect handling of protected methods.
4379 (patch_method_invocation): Pass correct context to not_accessible_p.
4380 (find_applicable_accessible_methods_list): Likewise.
4381 (qualify_ambiguous_name): If ARRAY_REF, it's an expression name.
4382 (java_complete_tree): For CASE_EXPR and DEFAULT_EXPR, set
4383 TREE_TYPE (to void_type_node); otherwise expand_expr crashes.
4384 (patch_if_else_statement): Fix setting of CAN_COMPLETE_NORMALLY.
4386 * jcf-write.c (CHECK_OP, CHECK_PUT): Add some error checking.
4387 (push_int_const): Remove reundant NOTE_PUSH.
4388 (generate_bytecode_insns - case STRING_CST): Do NOTE_PUSH.
4389 (- case SWITCH_EXPR): Fix code generation bug.
4390 (- case PREDECREMENT_EXPR etc): Remove redundant NOTE_PUSH.
4391 (generate_classfile): More robust for abstract methods.
4393 Sun Nov 15 13:52:39 1998 Anthony Green <green@cygnus.com>
4395 * Makefile.in: jv-scan and jvgenmain all require libiberty.
4396 * Make-lang.in: Ditto.
4398 * jv-scan.c: Remove xmalloc and xstrdup definitions.
4401 Sun Nov 15 14:10:56 1998 Per Bothner <bothner@cygnus.com>
4403 * jcf-parse.c (HANDLE_EXCEPTIONS_ATTRIBUTE): New macro.
4405 * jcf-io.c (find_class): Simpler/cleaner structure fixes a bug.
4407 Sat Nov 14 17:19:18 1998 Per Bothner <bothner@cygnus.com>
4409 Allow uses of interface types to verify. This is not really
4410 type-safe, but it matches what Sun does, and is OK as long as
4411 there are appropriate run-time checks.
4412 * verify.c (merge_types): If merging two interface types,
4413 just set the result to java.lang.Object.
4414 * expr.c (pop_type): Any interface is matches by java.lang.Object.
4416 1998-11-13 Tom Tromey <tromey@cygnus.com>
4418 * gjavah.c (main): Handle --output-class-directory argument.
4419 * jvspec.c (lang_specific_driver): Translate `-d' into
4421 * jcf.h (jcf_write_base_directory): Declare.
4422 * lang.c (lang_decode_option): Recognize -foutput-class-dir.
4423 * lang-options.h: Mention -foutput-class-dir.
4424 * jcf-write.c (jcf_write_base_directory): New global.
4425 (make_class_file_name): Put generated .class file into `-d'
4426 directory, or into source directory if -d not given. Function now
4428 (write_classfile): Free class file name. Handle case where class
4430 (DIR_SEPARATOR): New macro.
4431 Include <sys/stat.h>
4433 * Makefile.in (prefix): New macro.
4435 Thu Nov 12 14:15:07 1998 Per Bothner <bothner@cygnus.com>
4437 * parse.y (patch_invoke): Do less if flag_emit_class_files.
4438 * expr.c (build_known_method_ref): Don't check flag_emit_class_files
4439 here (done in patch_invoke instead).
4440 (case_identity): Moved here from parse.y.
4442 * java-tree.h (CAN_COMPLETE_NORMALLY): New macro.
4443 * parse.y (java_complete_tree etc): Maybe set CAN_COMPLETE_NORMALLY.
4444 * parse.y (java_complete_tree): Re-order COMPOUND_EXPR in BLOCK
4445 so they can be efficiently scanned without recursion.
4446 Error it ! CAN_COMPLETE_NORMALLY first part of COMPOUND_EXPR.
4447 * expr.c (java_lang_expand_expr): Expand statements of COMPOUND_EXPR
4448 in BLOCK iteratively, rather than recursively.
4450 * parse.y (do_unary_numeric_promotion): New function.
4451 (patch_unaryop, patch_binop, patch_array_ref): Use it.
4453 * parse.y (patch_newarray): Various fixes.
4455 Re-do handling of switch statements (for proper block scoping).
4456 * parse.y: Add just a single block for the enture switch block,
4457 but don't create any "case blocks".
4458 (group_of_labels): Rmeoved unneeded non-terminal.
4459 CASE_EXPR and DEFAULT_EXPR are added to current block.
4460 * expr.c (java_lang_expand_expr): Inline SWITCH_EXPR here.
4461 Now also need to handle CASE_EXPR and DEFAULT_EXPR.
4462 * java-tree.h (SWITCH_HAS_DEFAULT): New macro.
4463 * parse.y (wfl_operator, print_int_node): Make non-static.
4464 (java_complete_tree): CASE_EXPR and DEFAULT_EXPR are now processed
4465 as part of recursive scan of block.
4466 (java_expand_switch ): Removed - inlined into java_lang_expand_expr.
4467 (patch_switch_statement): Most tests move dinto java_complete_tree.
4469 * parse.y: Make various production be non-typed (void).
4470 * parse.y (parse_error): Merged into issue_warning_error_from_context.
4471 * parse.y (add_stmt_to_compound): Don't create/change extra node.
4472 (patch_method_invocation_stmt): Renamed to patch_method_invocation.
4474 * jcf-write.c (struct jcf_handler): New type.
4475 (struct jcf_switch_state): New type.
4476 (SWITCH_ALIGN_RELOC, BLOCK_START_RELOC): New relocation kinds.
4477 (alloc_handler, emit_unop, emit_reloc): New functions.
4478 (adjust_typed_op): Add extra parameter ("max type" offset).
4479 (emit_switch_reloc, emit_case-reloc): New function.
4480 (generate_bytecode_conditional): Handle REAL_TYPE comparisons.
4481 (generate_bytecode_insns): Support REAL_CST, switch statements,
4482 exception handling, method calls, object/array creation, and more.
4484 * class.c: Remove some unused variables.
4485 * constants.c (find_string_constant): New function.
4486 (count_constant_pool_bytes): Fix to correctly handle wide constants.
4487 * decl.c (complete_start_java_method): Don't _Jv_InitClass
4488 if flag_emit_class_files.
4490 1998-11-12 Tom Tromey <tromey@cygnus.com>
4492 * jcf-io.c (find_class): Added explanatory comment.
4494 * jcf-path.c (add_entry): Look for `.zip' at end of filename. Add
4495 trailing slash to `.zip' entries.
4497 * jvspec.c (lang_specific_driver): Correctly handle case where
4498 GC_NAME not defined.
4500 1998-11-11 Tom Tromey <tromey@cygnus.com>
4502 * jvspec.c (GC_NAME): New define.
4503 (lang_specific_driver): Use GC_NAME. Add GC_NAME to command line
4505 * Make-lang.in (jvspec.o): Define WITH_GC_<name>.
4507 Wed Nov 11 19:08:52 1998 Per Bothner <bothner@cygnus.com>
4509 * jcf-dump.c (TABLE_SWITCH): Fix typos.
4511 1998-11-11 Tom Tromey <tromey@cygnus.com>
4513 * jcf-dump.c (main): Correctly recognize `--'-style long options.
4515 Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4517 * class.c (is_compiled_class): Call safe_layout_class for class
4518 compiled from source.
4519 * conver.h (convert_to_integer, convert_to_real,
4520 convert_to_pointer): Added prototypes.
4521 * decl.c (init_decl_processing): Non longer push the decls of
4522 `methodtable', `constants', `Class', `Field', `dispatchTable'
4523 `jexception' and `Method'.
4524 * expr.c (build_invokeinterface): New function.
4525 (expand_invoke): static variable CLASS_IDENT now in
4526 build_invokeinterface. Use build_invokeinterface.
4527 (expand_java_field_op): Moved code to inline
4528 java.lang.PRIMTYPE.TYPE into a function.
4529 (build_primtype_type_ref): New function.
4530 * java-tree.def (INSTANCEOF_EXPR): New tree code.
4531 * java-tree.h (CLASS_METHOD_CHECKED_P, METHOD_DEPRECATED,
4532 FIELD_DEPRECATED, CLASS_DEPRECATED): New flag macros.
4533 (DECL_CONSTRUCTOR_P): Fixed typo in comment.
4534 (DECL_LOCAL_STATIC_VALUE): New macro.
4535 (build_invokeinterface, build_primtype_type_ref): New function
4537 (java_parse_abort_on_error): Macro rewritten.
4538 * jcf-parse.c (current_method): Add comment to declaration.
4539 (parse_zip_file_entries, process_zip_dir, void parse_source_file):
4540 Function prototypes fixed.
4541 (jcf_parse_source): push/pop parser context. save/restore global.
4542 (parse_source_file): Fixed leading comment. Now take a
4543 IDENTIFIER_NODE as an argument. Doesn't check methods, layout
4544 classes and pop the parser context anymore.
4545 (yyparse): Push parser context, save globals, parse the source
4546 file, restore globals and pop the parser context when processing a
4548 * jcf.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG define.
4549 * lex.c (java_parse_doc_section): New function.
4550 (java_lex): Call java_parse_doc_section when appropriate. Build an
4551 operator around INSTANCEOF_TK.
4552 * lex.h (java_lineterminator, java_sprint_unicode,
4553 java_unicode_2_utf8, java_lex_error, java_store_unicode):
4554 Prototypes rewritten.
4555 (java_parse_escape_sequence, java_letter_or_digit_p,
4556 java_parse_doc_section, java_parse_end_comment, java_get_unicode,
4557 java_read_unicode, java_store_unicode, java_read_char,
4558 java_allocate_new_line, java_unget_unicode, java_sneak_unicode):
4559 Added function prototypes.
4560 * parse.h (VERBOSE_SKELETON): Replaces SOURCE_FRONTEND_DEBUG
4562 (JNULLP_TYPE_P, CHECK_METHODS, CHECK_DEPRECATED, REGISTER_IMPORT):
4564 (struct parser_ctxt): New fields: deprecated,
4565 current_parsed_class_un, gclass_list.
4566 (fix_method_argument_names, issue_warning_error_from_context,
4567 resolve_package, lookup_package_type): New function prototypes.
4568 (resolve_expression_name): Fixed function prototype.
4569 (find_applicable_accessible_methods_list): Fixed indentation, added
4570 extra argument in prototype.
4571 (check_final_assignment, build_null_of_type, check_deprecation,
4572 check_method_redefinition, reset_method_name,
4573 java_check_regular_methods, java_check_abstract_methods,
4574 maybe_build_primttype_type_ref): New function prototype.
4575 * parse.y (conver.h): Include.
4576 (INSTANCEOF_TK): Tagged <operator>.
4577 (single_type_import_declaration): Use REGISTER_IMPORT macro.
4578 (relational_expression:): Build binop for instanceof.
4579 (java_push_parser_context): Remember ctxp->gclass_list across
4581 (java_pop_parser_context): Simply return if no context
4582 exists. Remember gclass_list across contexts.
4583 (issue_warning_error_from_context): New function.
4584 (parse_error_context): Don't setup ctxp->elc here. Call
4585 issue_warning_error_from_context instead.
4586 (parse_warning_context): Likewise.
4587 (maybe_create_class_interface_decl): Removed DECL_ARTIFICIAL
4588 setup. Link new class/interface to ctxp->gclass_list.
4589 (add_superinterfaces): Register interface as incomplete if not
4591 (create_class): Remember class unqualified name in
4592 ctxp->current_parsed_class_un. Check class deprecation.
4593 (register_fields): Check field deprecation. Remember static final
4594 field value in DECL_LOCAL_STATIC_VALUE. Changed comment in part
4596 (method_header): New local variable ORIG_ARG. Use unqualified
4597 current class name for check on constructor errors. Promote return
4598 type if of record type. Argument list fix moved in
4599 fix_method_argument_names, called here. Check method deprecation.
4600 (fix_method_argument_names): New function.
4601 (method_declarator): Promote record typed arguments.
4602 (safe_layout_class): Check class methods before layout.
4603 (java_complete_class): Compute field layout when patched.
4604 (do_resolve_class): Try to load class after having it renamed
4605 after the package name.
4606 (get_printable_method_name): Use DECL_CONTEXT.
4607 (reset_method_name): New function.
4608 (check_method_redefinition): Use reset_method_name.
4609 (java_check_regular_methods): New local variable
4610 SAVED_FOUND_WFL. Temporarily reinstall overriding/hiding method
4611 names for error report. Check for compile-time error when method
4612 found has default (package) access.
4613 (java_check_abstract_methods): Now takes an interface DECL node as
4614 an argument. Also reinstall real name on unchecked
4615 overriding/hiding methods for error report.
4616 (java_check_methods): Fixed leading comment. Get classes to verify
4617 from ctxp->gclass_list. Use CHECK_METHODS macro and set
4618 CLASS_METHOD_CHECKED_P on class verification.
4619 (lookup_java_method2): Get real method name if necessary.
4620 (find_in_imports): Don't check package class access here.
4621 (resolve_package, lookup_package_type): New functions.
4622 (java_layout_classes): Fixed leading comment. Take classes to be
4623 laid out from ctxp->gclass_list.
4624 (java_complete_expand_methods): Don't expand native and abstract
4626 (java_expand_classes): New function.
4627 (resolve_expression_name): Use additional argument ORIG. Retrieve
4628 values of static final field of primitive types.
4629 (resolve_field_access): Handles static final field of promotive
4631 (resolve_qualified_expression_name): Handle STRING_CST as
4632 primaries and package name resolution. Check deprecation on found
4633 decls. Set where_found and type_found on non static field resolved
4634 during qualification. Layout non primitive field decl types.
4635 (check_deprecation): New function.
4636 (maybe_access_field): Simplified.
4637 (patch_method_invocation_stmt): Local variable CLASS_TYPE
4638 removed. Reverse method's argument when primary is a type. Don't
4639 use CLASS_TYPE to report problems, use IDENTIFIER_WFL
4640 instead. Include abstract class in the list of class searchable
4641 for constructors. Use DECL_CONTEXT of found method for access
4642 checks. Check method deprecation.
4643 (patch_invoke): Pay extra care to NEW_CLASS_EXPR type call when
4644 converting arguments. Handle INVOKE_INTERFACE.
4645 (lookup_method_invoke): Search constructor using existing
4646 infrastructure (don't rely on lookup_java_constructor anymore).
4647 (find_applicable_accessible_methods_list): Extra argument flag
4648 LC. Now include constructor in the search.
4649 (qualify_ambiguous_name): Conditional expression are primaries.
4650 (not_initialized_as_it_should_p): static final are always
4652 (java_complete_tree): Pass extra NULL argument to
4653 resolve_expression_name. Stricter test to carry on patching
4654 assignments. New case for INSTANCEOF_EXPR.
4655 (complete_function_arguments): Inline PRIMTYPE.TYPE read access.
4656 (check_final_assignment, maybe_build_primttype_type_ref): New
4658 (patch_assignment): Detect resolved static finals and carry normal
4659 assignment error check on them. Inline PRIMTYPE.TYPE read access.
4660 (try_builtin_assignconv): Access constant 0 on all primitive
4662 (valid_builtin_assignconv_identity_widening_p): Accept identical
4663 types. Accept all promoted type on int type.
4664 (valid_ref_assignconv_cast_p): Accept a null pointer to be
4665 assigned to a reference.
4666 (valid_method_invocation_conversion_p): Accept to check null
4668 (build_binop): Merge declaration and initialization of local
4670 (patch_binop): New case for INSTANCEOF_EXPR. NE_EXPR to accept all
4671 numeric types. Improved validity test for qualify operators on
4673 (patch_unaryop): Broadened rejection test for PREDECREMENT_EXPR
4674 and PREINCREMENT_EXPR. Also detect resolved static finals of a
4675 primitive type and issue the appropriate error message.
4676 (resolve_type_during_patch): Mark class loaded when resolved.
4677 (patch_cast): Allow null to be cased to reference types.
4678 (build_null_of_type): New function.
4679 (patch_array_ref): Handle array on references correctly.
4680 (patch_return): Removed unused local variable MODIFY. Force
4681 boolean to be returned as integers. Allows null to be returned by
4682 a function returning a reference.
4683 * typeck.c (convert_to_integer, convert_to_real,
4684 convert_to_pointer): Prototypes moved to convert.h
4685 (lookup_argument_method): Use method real name, if necessary.
4687 1998-10-30 Tom Tromey <tromey@cygnus.com>
4689 * class.c (build_class_ref): Changed name of primitive classes to
4692 * class.c (make_class_data): Renamed fields: nmethods to
4693 method_count, method_count to dtable_method_count. Always set
4695 * decl.c (init_decl_processing): Likewise.
4697 Wed Oct 28 08:03:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4699 * class.c (layout_class): Don't mangle <finit>, produce
4700 __finit<class> instead. Don't verify artificial methods.
4701 * decl.c (finit_identifier_node): New declared global.
4702 (init_decl_processing): finit_identifier_node initialized.
4703 * java-tree.def (CONDITIONAL_EXPR): New Java tree code.
4704 * java-tree.h (finit_identifier_node): Declared as extern.
4705 (struct lang_decl): New field called_constructor.
4706 (DECL_CONSTRUCTOR_CALLS): Access macro to called_constructor.
4707 (CLASS_HAS_FINIT_P): New macro.
4708 (CALL_CONSTRUCTOR_P): Leading comment changed. Macro now checks
4709 explicit constructor invocation.
4710 (CALL_EXPLICIT_CONSTRUCTOR_P, CALL_THIS_CONSTRUCTOR_P,
4711 CALL_SUPER_CONSTRUCTOR_P): New macros.
4712 (write_classfile): Added prototype.
4713 * jcf-parse.c (jcf_parse_source): Parse and remember for
4714 generation if the file was seen on the command line.
4715 (parse_source_file): Don't write the class file here.
4716 (yyparse): Loop on files rewritten. Set current_jcf.
4717 (parse_zip_file_entries): Parse class file only if it was found.
4718 * lang.c (init_parse): Don't open command line provided filename
4720 (lang_parse): Don't set main_jcf anymore.
4721 * parse.h (ABSTRAC_CHECK): Capitalized arguments.
4722 (JCONSTRUCTOR_CHECK): New macro.
4723 (JBSC_TYPE_P): New macro.
4724 (IN_TRY_BLOCK_P, EXCEPTIONS_P): Fixed leading comment.
4725 (COMPLETE_CHECK_OP_2): New macro.
4726 (struct parse_ctxt): New field explicit_constructor_p.
4727 (check_class_interface_creation): Fixed prototype indentation.
4728 (patch_method_invocation_stmt): Prototype reflects added argument.
4729 (patch_invoke): Likewise.
4730 (complete_method_declaration, build_super_invocation,
4731 verify_constructor_circularity,
4732 build_this_super_qualified_invocation, get_printable_method_name,
4733 patch_conditional_expr, maybe_generate_finit, fix_constructors,
4734 verify_constructor_super, create_artificial_method,
4735 start_artificial_method_body, end_artificial_method_body,
4736 generate_field_initialization_code): New function prototypes.
4737 * parse.y: Fixed leading comment
4738 (constructor_header:, constructor_body:, block_end:): Rules tagged
4740 (type_declaration:): Call maybe_generate_finit.
4741 (method_declaration:): Action for method_body: placed in new
4742 function complete_method_declaration, called here.
4743 (constructor_declaration:): Defined actions. Removed leading
4745 (constructor_header:): New rule with action.
4746 (constructor_body:): Rule rewritten using block_begin: and
4747 block_end:. Defined actions.
4748 (constructor_declarator:, explicit_constructor_invocation:):
4750 (block:): Use new rules block_begin: block_end:.
4751 (block_begin:, block_end:): New rules and actions.
4752 (block_statements:): Fixed error message for explicit
4754 (method_invocation:): Call build_this_super_qualified_invocation
4755 if primary is `this' or `super' was seen.
4756 (conditional_expression:): Action defined.
4757 (extra_ctxp_pushed_p): New static global flag.
4758 (java_parser_context_save_global): Create parser context if
4759 necessary. Use extra_ctxp_pushed_p to remember it.
4760 (java_parser_context_restore_global): Pop extra parser context if
4762 (build_array_from_name): Array on primitive types are marked
4764 (register_fields): Restore new name in field initializer
4765 expression if type was altered. Non static fields initialized upon
4766 declaration marked initialized.
4767 (maybe_generate_finit): New function.
4768 (maybe_generate_clinit): Use create_artificial_method,
4769 start_artificial_method_body, end_artificial_method_body. Generate
4770 debug info for enclosed initialization statements.
4771 (method_header): Fixed leading comment. Check constructor
4772 flags. Detect constructor declarations and set DECL_CONSTRUCTOR_P
4774 (complete_method_declaration, constructor_circularity_msg,
4775 verify_constructor_circularity): New functions.
4776 (get_printable_method_name): New function.
4777 (check_method_redefinition): Don't rename <finit> methods. Fix
4778 declared constructor names. Error message for
4779 constructors modified.
4780 (java_check_regular_methods): Local variable seen_constructor
4781 renamed saw_constructor. Skip verification on constructors. Create
4782 default constructor with create_artificial_method.
4783 (java_check_methods): Removed unnecessary empty line.
4784 (create_artificial_method, start_artificial_method_body,
4785 end_artificial_method_body): New functions.
4786 (java_layout_classes): Changed leading comment. Reverse fields
4787 list if necessary. Always layout java.lang.Object if being
4789 (java_complete_expand_methods): Verify constructor circularity.
4790 (java_complete_expand_method): Call fix_constructor on
4791 constructors. Local variable no_ac_found removed. Restore
4792 bindings if method body expansion failed.
4793 (fix_constructors, verify_constructor_super,
4794 generate_field_initialization_code): New function.
4795 (java_expand_classes): Fixed leading comment. Write class file
4797 (resolve_expression_name): Check for illegal instance variable
4798 usage within the argument scope of an explicit constructor
4800 (resolve_qualified_expression_name): Pass extra from_super flag
4801 when invoking patch_method_invocation_stmt. New case for
4802 conditional expression when used as a primary. Check for error
4803 when acquiring super.
4804 (patch_method_invocation_stmt): Added extra argument super. New
4805 local variable is_static_flag. Set class_to_search according to
4806 the nature of the constructor invocation. Don't add `this'
4807 argument when expanding NEW_CLASS_EXPR. Check for illegal method
4808 invocation within the argument scope of explicit constructor
4809 invocation. Set is_static according to is_static_flag. Provide
4810 extra `super' argument to patch_invoke invocation.
4811 (patch_invoke): New argument from_super. Loop on arguments
4812 indentation fixed. Pass from_super to invocation_mode. New switch
4813 case INVOKE_SUPER. Fixed error message in switch default case.
4814 Don't use CALL_CONSTRUCTOR_P but rather a test on the tree node
4816 (invocation_mode): Return INVOKE_SUPER mode when appropriate.
4817 (lookup_method_invoke): Fixed prototypes in candidates list. Error
4818 message takes constructors into account.
4819 (find_applicable_accessible_methods_list): Fixed indentation.
4820 (qualify_ambiguous_name): Take explicit constructor invocation
4821 into account. Deal with a conditional expression as a primary to
4823 (java_complete_tree): Added local wfl_op3. New CONDITIONAL_EXPR
4824 case. Added extra argument to patch_method_invocation_stmt.
4825 Register calls made to explicit constructor `this'. Don't call
4826 save_expr in ARRAY_REF case when emitting class files. Check for
4827 illegal use of this when expanding explicit constructor invocation
4829 (complete_function_arguments): Set and reset parser context
4830 explicit_constructor_p field value when appropriate.
4831 (build_super_invocation, build_this_super_qualified_invocation):
4833 (patch_assignment): Fixed typo.
4834 (patch_unaryop): Check on final fields occurs only when a decl
4836 (patch_return): Take constructors into account.
4837 (patch_conditional_expr): New function.
4838 * typeck.c (build_java_signature): Removed unnecessary empty line.
4840 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
4842 * Makefile.in (jcf-dump, gcjh): Link in $(LIBS) too.
4844 1998-10-28 Tom Tromey <tromey@cygnus.com>
4846 * decl.c (init_decl_processing): Renamed fields.
4847 * class.c (make_class_data): Renamed bfsize, nfields, nsfields,
4848 interface_len, msize fields.
4850 * class.c (make_class_data): Removed subclass_head and
4851 subclass_next fields.
4852 * decl.c (init_decl_processing): Removed subclass_head and
4853 subclass_next fields.
4855 Wed Oct 28 00:46:15 1998 Jeffrey A Law (law@cygnus.com)
4857 * jcf-write.c (emit_load_or_store): Avoid implicit int arguments.
4858 * mangle.c (emit_unicode_mangled_name): Similarly.
4860 Mon Oct 26 12:17:23 1998 Nick Clifton <nickc@cygnus.com>
4862 * jcf-parse.c (get_constant): Place braces around code to compute
4863 'd' when REAL_ARITHMETIC is not defined.
4865 Sun Oct 25 14:58:05 1998 H.J. Lu (hjl@gnu.org)
4867 * Make-lang.in (jv-scan$(exeext)): Add stamp-objlist to
4870 1998-10-23 Tom Tromey <tromey@cygnus.com>
4872 * lang-specs.h: `.zip' files are input to jc1.
4874 Thu Oct 22 23:01:54 1998 Per Bothner <bothner@cygnus.com>
4876 * jvspecs.c: Add (but don't enable) support for combining multiple
4877 .class and .java input filenames to a single jc1 invocation.
4878 Add support for -C flag (copile to .class files).
4879 Translate -classpath and -CLASSPATH arguments.
4880 * lang-specs.h: Don't set %2 spec.
4882 1998-10-22 Tom Tromey <tromey@cygnus.com>
4884 * jcf-path.c (add_entry): Don't add trailing separator if entry is
4886 (add_path): Don't add trailing separator to non-empty path
4889 * lang.c (lang_decode_option): Check for -fclasspath and
4890 -fCLASSPATH before examining other `-f' options.
4892 * java-tree.h (finalize_identifier_node): Don't declare.
4893 * class.c (make_class_data): Don't push "final" field.
4894 * decl.c (init_decl_processing): Don't push "final" field.
4895 (finalize_identifier_node): Removed.
4896 (init_decl_processing): Don't set finalize_identifier_node.
4898 * config-lang.in (stagestuff): Added jcf-dump and jv-scan.
4900 Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
4902 * Make-lang.in (java): Depend on jcf-dump and jv-scan.
4903 (JV_SCAN_SOURCES): New macro.
4904 (JCF_DUMP_SOURCES): Likewise.
4905 (jcf-dump$(exeext)): New target.
4906 (jv-scan$(exeext)): New target.
4908 1998-10-22 Tom Tromey <tromey@cygnus.com>
4910 * Makefile.in (LEX): Removed.
4911 (LEXFLAGS): Likewise.
4912 (SET_BISON): New macro.
4914 ($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
4915 spurious diffs in parse.c.
4916 ($(PARSE_SCAN_C)): Likewise.
4917 (PARSE_DIR): New macro.
4919 (PARSE_SCAN_C): Likewise.
4920 (PARSE_RELDIR): New macro.
4922 * jcf-io.c (saw_java_source): Define here, not in jcf-parse.c.
4924 * jcf-io.c (find_class): Use saw_java_source to determine when to
4925 look for `.java' file.
4926 * jcf-parse.c (saw_java_source): New global.
4927 (yyparse): Set it if `.java' file seen.
4929 * Make-lang.in (JAVA_SRCS): Added jcf-path.c.
4930 (GCJH_SOURCES): Likewise.
4931 * Makefile.in (datadir): New macro.
4932 (libjava_zip): Likewise.
4933 (JAVA_OBJS): Added jcf-path.o.
4934 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
4935 (../gcjh$(exeext)): Likewise.
4936 (jcf-path.o): New target.
4937 * java-tree.h (fix_classpath): Removed decl.
4938 * jcf-parse.c (fix_classpath): Removed.
4939 (load_class): Don't call fix_classpath.
4940 * parse.y (read_import_dir): Don't call fix_classpath.
4941 * lex.h: Don't mention classpath.
4942 * lex.c (java_init_lex): Don't initialize classpath.
4943 * jcf-io.c (classpath): Removed global.
4944 (find_class): Use jcf_path iteration functions. Correctly search
4945 class path for .java file.
4946 (open_in_zip): New argument `is_system'.
4947 * jcf-dump.c (main): Call jcf_path_init. Recognize all new
4948 classpath-related options.
4949 * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH,
4951 (lang_init): Call jcf_path_init.
4952 * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH.
4953 * lang-specs.h: Handle -I. Minor cleanup to -M options.
4954 Correctly put braces around second string in each entry.
4955 * gjavah.c (main): Call jcf_path_init. Recognize all the new
4956 classpath-related options.
4957 (help): Updated for new options.
4958 * jcf.h: Declare functions from jcf-path.c. Don't mention
4960 * jcf-path.c: New file.
4962 * jcf-depend.c: Include jcf.h.
4964 * jcf-write.c (localvar_alloc): Returns `void'.
4965 (localvar_free): Removed unused variable.
4967 * lang.c (OBJECT_SUFFIX): Define if not already defined.
4968 (init_parse): Use OBJECT_SUFFIX, not ".o".
4970 Wed Oct 21 07:54:11 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4972 * class.c (emit_register_classes): Renamed from
4973 emit_register_class.
4974 * java-tree.h (emit_register_classes): Prototype renamed from
4975 emit_register_class.
4976 * jcf-parse.c (yyparse): Call emit_register_classes once before
4978 * parse.y (java_expand_classes): No longer register classes.
4980 Tue Oct 20 09:15:38 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
4982 * class.c (is_compiled_class): New local variable
4983 seen_in_zip. Identify classes found in currently compiled source
4985 * decl.c (complete_start_java_method): Fixed typo.
4986 * java-tree.h (CLASS_FROM_CURRENTLY_COMPILED_SOURCE_P,
4987 HAS_BEEN_ALREADY_PARSED_P, IS_A_COMMAND_LINE_FILENAME_P): New macros.
4988 (CLASS_P): Moved around.
4989 (java_parse_abort_on_error): Macro moved from jcf-parse.c
4990 * jcf-parse.c (java_parse_abort_on_error): Macro moved to
4992 (jcf_parse_source): Changed leading comment. Removed unnecessary
4993 fclose and CLASS_FROM_SOURCE_P marking.
4994 (parse_source_file): New local variables remember_for_generation
4995 and filename. Mark parsed file name identifier node. Removed block
4996 executed when parse_only was null. Set remember_for_generation.
4997 Use it as an argument to java_pop_parser_context.
4998 (yyparse): New local variables several_files, list, next node and
4999 current_file_list. Split ampersand separated file names into
5000 current_file_list. Iterate through the list and parse accordingly.
5001 * parse.h (java_pop_parser_context): New function prototype.
5002 * parse.y (ctxp_for_generation): New static global variable.
5003 (java_pop_parser_context): New argument generate. Link popped ctxp
5004 to ctxp_for_generation list accordingly.
5005 (java_complete_expand_methods): Fixed indentation.
5006 (java_expand_classes): New function.
5008 Sat Oct 17 11:25:21 1998 Per Bothner <bothner@cygnus.com>
5010 * Makefile.in: Link with libiberty.a instead of memmove.o.
5012 Fri Oct 16 10:59:01 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5014 * lex.c (setjmp.h): No longer included.
5015 * lex.h (setjmp.h): Included.
5016 * parse.h (SET_TYPE_FOR_RESOLUTION): New macro.
5017 (duplicate_declaration_error_p): Renamed from
5018 duplicate_declaration_error.
5019 (build_array_from_name): New function prototype.
5020 * parse.y (setjmp.h): No longer included.
5021 (variable_declarator_id): Define action.
5022 (build_array_from_name): New function.
5023 (duplicate_declaration_error_p): Renamed from
5024 duplicate_declaration_error. Fixed leading comment.
5025 (register_fields): Main `for' loop reorganized. Uses
5026 SET_TYPE_FOR_RESOLUTION and build_array_from_name.
5027 (method_declarator): Uses SET_TYPE_FOR_RESOLUTION and call
5028 build_array_from_name.
5029 (resolve_class): Set CLASS_LOADED_P on newly build array dimension
5031 (read_import_dir): Don't try to skip `.' and `..'.
5032 (declare_local_variables): Uses SET_TYPE_FOR_RESOLUTION and
5033 build_array_from_name. Main `for' loop reorganized.
5034 (resolve_qualified_expression_name): When building access to a
5035 field, use the type where the field was found, not its own type.
5036 (maybe_access_field): Use field DECL_CONTEXT if the type where the
5037 field was found is null.
5038 (qualify_ambiguous_name): Sweep through all successive array
5041 Wed Oct 14 18:21:29 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5043 * java-tree.h (pop_labeled_block, lang_printable_name,
5044 maybe_add_interface, set_super_info, get_access_flags_from_decl,
5045 interface_of_p, inherits_from_p, fix_classpath,
5046 complete_start_java_method, emit_handlers, init_outgoing_cpool,
5047 make_class_data, register_class, alloc_name_constant): New
5048 function prototypes.
5049 * lang.c (lang_decode_option): Set argc argument unused. Fixed
5050 indentation. Added cast to remove warning.
5051 (lang_printable_name): Set v argument unused.
5052 (lang_print_error): Added argument to lang_printable_name call.
5053 (java_dummy_print, print_lang_decl, print_lang_type,
5054 print_lang_identifier, lang_print_xnode): All argument marked
5056 * lex.c (java_unget_unicode): Removed unnecessary argument.
5057 (java_allocate_new_line): Unused local variable is gone.
5058 (java_read_char): Added parenthesis in expressions to remove
5059 warnings. Added final return statement.
5060 (java_read_unicode): Added parenthesis in expression to remove
5062 (java_parse_end_comment): Fixed java_unget_unicode invocation.
5063 (java_parse_escape_sequence): Likewise.
5064 (java_lex): Unused local variables are gone. Fixed
5065 java_unget_unicode invocation.
5066 * lex.h (set_float_handler): Prototype added when JC1_LITE not
5068 * parse.h (ERROR_CANT_CONVERT_TO_BOOLEAN): Fixed
5069 lang_printable_name invocation in macro.
5070 (ERROR_CANT_CONVERT_TO_NUMERIC, ERROR_CAST_NEEDED_TO_INTEGRAL):
5072 (duplicate_declaration_error): Suppressed unused argument in
5074 (identical_subpath_p): Function declaration is gone.
5075 (patch_invoke): Suppressed unused argument in prototype.
5076 (patch_cast, build_labeled_block, check_thrown_exceptions):
5078 * parse.y (setjmp.h): Included
5079 (toplev.h): Likewise.
5080 (field_declaration:): Suppressed unused local
5081 (label_decl:): Fixed build_labeled_block invocation.
5082 (java_pop_parser_context): Put extra parenthesis around assignment
5084 (yyerror): Suppressed unused local variables.
5085 (variable_redefinition_error): Fixed lang_printable_name
5087 (create_interface): Suppressed unused local variables.
5088 (create_class): Likewise.
5089 (duplicate_declaration_error): Suppressed unused argument. Fixed
5090 lang_printable_name invocation.
5091 (register_fields): Suppressed unused local variable. Fixed
5092 duplicate_declaration_error invocation.
5093 (method_header): Suppressed unused local variable.
5094 (method_declarator, parser_check_super): Likewise.
5095 (java_complete_class): Suppressed unused local variable. Fixed
5096 fatal error message.
5097 (complete_class_report_errors): Added default: in switch.
5098 (java_check_regular_methods): Fixed lang_printable_name
5100 (check_throws_clauses): Likewise.
5101 (java_check_abstract_methods): Suppressed unused local
5102 variable. Fixed lang_printable_name invocation.
5103 (read_import_entry): Added supplemental return statement.
5104 (read_import_dir): Suppressed unused local variables.
5105 (check_pkg_class_access, declare_local_variables): Likewise.
5106 (source_start_java_method): Suppressed unused extern variable
5108 (expand_start_java_method): Suppressed unused extern and local
5109 variable declarations.
5110 (java_complete_expand_methods): Likewise.
5111 (java_complete_expand_method): Suppressed unused local variables.
5112 (make_qualified_name): Likewise.
5113 (resolve_qualified_expression_name): Added default: in
5114 switch. Fixed lang_printable_name invocation.
5115 (class_instance_creation_expression): Added parenthesis around
5117 (patch_method_invocation_stmt): Fixed lang_printable_name and
5118 patch_invoke invocations.
5119 (check_for_static_method_reference): Fixed lang_printable_name
5121 (patch_invoke): Suppressed unused arguments and local variables.
5122 (lookup_method_invoke): Suppressed unused local variables.
5123 (qualify_ambiguous_name): Added default: in switch.
5124 (identical_subpath_p): Function removed.
5125 (patch_assignment): Suppressed unused local variables. Suppressed
5126 unnecessary if statement. Fixed lang_printable_name invocations.
5127 (try_builtin_assignconv): Fixed lang_printable_name invocations.
5128 (valid_ref_assignconv_cast_p): Parenthesis around
5129 expression. Suppressed unused local variables.
5130 (build_binop): Suppressed unused local variables. fixed
5131 lang_printable_name invocations.
5132 (string_constant_concatenation): Suppressed unused local
5134 (patch_unaryop): Fixed lang_printable_name invocation.
5135 (patch_cast): Suppressed unnecessary argument. Fixed
5136 lang_printable_name invocation.
5137 (patch_array_ref): Fixed lang_printable_name invocation.
5138 (patch_newarray, patch_return, patch_if_else_statement): Likewise.
5139 (build_labeled_block): Suppressed unused argument.
5140 (generate_labeled_block): Fixed build_labeled_block invocation.
5141 (build_loop_body): Suppressed unused local variables.
5142 (patch_loop_statement): Likewise.
5143 (patch_exit): Fixed lang_printable_name invocation.
5144 (patch_switch_statement): Likewise.
5145 (case_identity): First argument marked unused.
5146 (patch_try_statement): Fixed lang_printable_name invocations.
5147 (patch_synchronized_statement, patch_throw_statement): Likewise.
5148 (check_thrown_exceptions): Fixed check_thrown_exceptions and
5149 lang_printable_name invocations.
5150 (check_thrown_exceptions_do): Suppressed unused argument.
5152 1998-10-14 Tom Tromey <tromey@cygnus.com>
5154 * jcf-write.c (write_classfile): Add output class file as target.
5155 * lang-options.h: Added -MD, -MMD, -M, and -MM.
5156 * jcf.h: Added declarations for dependency-tracking functions.
5157 * lang-specs.h: Handle -M, -MM, MD, and -MMD.
5158 * lang.c (lang_decode_option): Recognize -MD and -MMD.
5159 (finish_parse): Call jcf_dependency_write.
5160 (dependency_tracking): New global.
5161 (DEPEND_SET_FILE): New define.
5162 (DEPEND_ENABLE): New define.
5163 (init_parse): Enable dependency tracking if required.
5165 * Makefile.in (JAVA_OBJS): Added jcf-depend.o.
5166 (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o.
5167 (../gcjh$(exeext)): Likewise.
5168 (jcf-depend.o): New target.
5169 * Make-lang.in (JAVA_SRCS): Added jcf-depend.c.
5170 (GCJH_SOURCES): Likewise.
5171 * jcf-io.c (open_class): Call jcf_dependency_add_file. Added
5173 (find_classfile): Added dep_name argument.
5174 (find_class): Compute name of dependency.
5175 (open_in_zip): Call jcf_dependency_add_file.
5176 * gjavah.c (output_file): No longer global.
5177 (usage): Don't mention "gjavah".
5179 (java_no_argument): Likewise.
5180 (version): Likewise.
5181 (main): Recognize and handle -M family of options.
5182 (print_mangled_classname): Return is void.
5183 (process_file): Handle case where output is suppressed.
5184 (HANDLE_END_FIELD): Likewise.
5185 (HANDLE_METHOD): Likewise.
5186 * jcf-depend.c: New file.
5188 Tue Oct 13 23:34:12 1998 Jeffrey A Law (law@cygnus.com)
5190 * java-tree.def: Add missing newline at EOF.
5192 1998-10-13 Tom Tromey <tromey@cygnus.com>
5194 * jcf-dump.c (process_class): Use FATAL_EXIT_CODE, not -1.
5195 (main): Likewise. Exit with SUCCESS_EXIT_CODE at end of
5197 Include <config.h> and "system.h".
5198 (disassemble_method): Undefine RET to avoid clash with
5201 Tue Oct 13 03:50:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5203 * decl.c (runtime_exception_type_node, error_exception_type_node):
5204 New global variables.
5205 (init_decl_processing): Initialized.
5206 * expr.c (java_lang_expand_expr): Set caught exception type to
5207 null if catch handler argument doesn't exit.
5208 * java-tree.def (SYNCHRONIZED_EXPR, THROW_EXPR): New Java specific
5210 * java-tree.h (runtime_exception_type_node,
5211 error_exception_type_node): Global variables declared.
5212 (DECL_FUNCTION_THROWS): New macro.
5213 (DECL_FUNCTION_BODY): Modified comment.
5214 (DECL_SPECIFIC_COUNT): Likewise.
5215 (struct lang_decl): New field throws_list.
5216 (IS_UNCHECKED_EXPRESSION_P): New macro.
5217 * lex.c (java_lex): Generate location information for THROW_TK.
5218 * parse.h (PUSH_EXCEPTIONS, POP_EXCEPTIONS, IN_TRY_BLOCK_P,
5219 EXCEPTIONS_P): New macros.
5220 (enum jdep_code): New value JDEP_EXCEPTION.
5221 (BUILD_MONITOR_ENTER, BUILD_MONITOR_EXIT,
5222 BUILD_ASSIGN_EXCEPTION_INFO, BUILD_THROW, SET_WFL_OPERATOR,
5223 PATCH_METHOD_RETURN_ERROR): New macros.
5224 (patch_method_invocation_stmt): Added new argument to prototype.
5225 (patch_synchronized_statement, patch_throw_statement,
5226 check_thrown_exceptions, check_thrown_exceptions_do,
5227 purge_unchecked_exceptions, check_throws_clauses): New function
5229 * parse.y Fixed typo in keyword section.
5230 (throw:): Rule tagged <node>.
5231 (THROW_TK): Keyword tagged <operator>.
5232 (method_header:): Last argument to call to method_header passed
5234 (throws:, class_type_list:, throw_statement:,
5235 synchronized_statement:, synchronized:): Defined actions.
5236 (method_header): New local variable current. Register exceptions
5238 (java_complete_tree): Complete and verify exceptions from throws
5240 (complete_class_report_errors): Error message on exceptions not
5242 (java_check_regular_methods): Fixed typo. Shortcut on private
5243 overriding methods. Changed error message on method
5244 redefinition. Check for throws clause compatibility.
5245 (check_throws_clauses): New function.
5246 (java_check_abstract_methods): Use DECL_NAME for wfl or current
5247 method. Changed error message on method redefinition.
5248 (currently_caught_type_list): New static variable.
5249 (java_complete_expand_methods): Purge unchecked exceptions from
5250 throws clause list. Call PUSH_EXCEPTIONS before walk and
5251 POP_EXCEPTIONS after.
5252 (resolve_qualified_expression_name): Pass new argument as NULL to
5253 patch_method_invocation_stmt.
5254 (patch_method_invocation_stmt): New argument ref_decl. Invoke
5255 PATCH_METHOD_RETURN_ERROR when returning with error. Reverse
5256 argument list when appropriate. Use new argument if non null to
5257 store selected method decl.
5258 (patch_invoke): Convert if necessary args of builtin types before
5259 forming CALL_EXPR. Argument list no longer reversed here.
5260 (invocation_mode): Treat final methods as static methods.
5261 (java_complete_tree): New cases for THROW_EXPR: and
5262 SYNCHRONIZED_EXPR:. Check thrown exceptions when completing
5264 (complete_function_arguments): No more RECORD_TYPE
5265 conversion. Function parameter nodes no longer saved.
5266 (valid_ref_assignconv_cast_p): Avoid handling null type.
5267 (patch_binop): Fixed null constant reference handling.
5268 (build_try_statement): Use BUILD_ASSIGN_EXCEPTION_INFO and
5270 (patch_try_statement): Fixed comments. Record caught types in
5271 list, push the list, expand try block and pop the list.
5272 (patch_synchronized_statement, patch_throw_statement,
5273 check_thrown_exceptions, check_thrown_exceptions_do,
5274 purge_unchecked_exceptions): New functions.
5275 * typeck.c (lookup_argument_method): Allow WFL in place of method
5276 DECL_NAME during method definition check
5278 1998-10-09 Tom Tromey <tromey@cygnus.com>
5280 * gjavah.c (decode_signature_piece): New function.
5281 (print_c_decl): Use it. Added `name_override' argument.
5282 (print_method_info): Use name_override argument to print_c_decl.
5283 (seen_fields): Removed.
5284 (print_field_info): Don't update seen_fields.
5285 (struct method_name): New structure.
5286 (method_name_list): New global.
5287 (print_method_info): Add new method to list of methods.
5288 (name_is_method_p): New function.
5289 (print_field_info): If field name has same name as method, then
5291 (process_file): Parse methods before fields.
5292 (field_pass): New global.
5293 (HANDLE_END_FIELD): Take field_pass into account.
5295 Wed Oct 7 12:10:48 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
5297 * Makefile.in (keyword.h): Add -L KR-C -F ', 0' flags to gperf.
5298 (keyword.h): Regenerate using gperf 2.7.1 (19981006 egcs).
5300 Sat Oct 3 13:29:46 1998 Anthony Green <green@cygnus.com>
5302 * jvspec.c: Fix bug in jvgenmain_spec patch.
5304 Fri Oct 2 17:22:52 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5306 * Makefile.in (lang.o:): Install dependency on java-tree.def.
5307 * decl.c (soft_exceptioninfo_call_node): New global variable.
5308 (init_decl_processing): Fixed indentation. soft_badarrayindex_node
5309 takes extra integer argument. soft_exceptioninfo_call_node
5311 * except.c (java_set_exception_lang_code): New function
5312 (method_init_exceptions): Called here.
5313 (prepare_eh_table_type): New function.
5314 (expand_end_java_handler): Called here.
5315 * expr.c (build_java_throw_out_of_bounds_exception): Now features
5316 one argument. Modified generation of call to
5317 soft_badarrayindex_node to use new argument.
5318 (build_java_arrayaccess): Pass faulty index value to
5319 build_java_throw_out_of_bounds_exception.
5320 (generate_name): New function.
5321 (java_lang_expand_expr): New local variables node, current,
5322 has_finally_p. Expand TRY_EXPR node.
5323 (process_jvm_instruction): Replace top of the stack with thrown
5324 object reference when entering exception handler.
5325 * java-tree.def (TRY_EXPR, CATCH_EXPR, FINALLY_EXPR): New Java
5326 specific tree codes.
5327 * java-tree.h (soft_exceptioninfo_call_node): Declaration of new
5329 (DECL_SPECIFIC_COUNT): New macro.
5330 (prepare_eh_table_type, java_set_exception_lang_code,
5331 generate_name): New function declarations.
5332 (match_java_method): Declaration deleted.
5333 (FINALLY_EXPR_LABEL, FINALLY_EXPR_BLOCK, CATCH_EXPR_GET_EXPR): New
5335 * lex.c (TRY_TK, CATCH_TK): Generate location information.
5336 * parse.h (redefinition_error, refine_accessible_methods_list,
5337 can_cast_to_p): Function declaration removed.
5338 (classitf_redefinition_error, variable_redefinition_error,
5339 parse_jdk1_1_error, find_applicable_accessible_methods_list,
5340 find_most_specific_methods_list, argument_types_convertible,
5341 enter_a_block, valid_builtin_assignconv_identity_widening_p,
5342 valid_cast_to_p, valid_method_invocation_conversion_p,
5343 try_reference_assignconv, add_stmt_to_compound,
5344 build_jump_to_finally, build_tree_list, patch_try_statement,
5345 java_get_catch_block): New function declarations.
5346 * parse.y (string_buffer_type): Global variable deleted.
5347 (group_of_labels, catches, catch_clause, catch_clause_parameter,
5348 finally): Rules tagged <node>.
5349 (TRY_TK, CATCH_TK): Token tagged <operator>.
5350 (class_body_declaration:, class_member_declaration:,
5351 formal_parameter:, explicit_constructor_invocation:,
5352 interface_member_declaration:, constant_declaration:,
5353 primary_no_new_array:, class_instance_creation_expression:,
5354 array_creation_expression:): Issue error on unsuported JDK1.1
5356 (try_statement:, catches:, finally:): Define actions.
5357 (catch_clause_parameter): New rule.
5358 (catch_clause:): Use new rule catch_clause_parameter.
5359 (parse_jdk1_1_error): New function.
5360 (redefinition_error): Renamed classitf_redefinition_error.
5361 (variable_redefinition_error): New function.
5362 (check_class_interface_creation): Call
5363 classitf_redefinition_error.
5364 (java_complete_tree): Added error message on JDEP_TYPE: case.
5365 (complete_class_report_errors): Fixed indentation.
5366 (declare_local_variables): Call variable_redefinition_error.
5367 (source_end_java_method): Call java_set_exception_lang_code and
5368 emit_handlers where appropriate.
5369 (java_method_add_stmt): Call add_stmt_to_block.
5370 (add_stmt_to_block): New function.
5371 (lookup_method_invoke): Fixed outside comment. new local variable
5372 candicates. Call find_applicable_accessible_methods_list and
5373 find_most_specific_methods_list when searching for a
5374 method. Modified error report to list possible candidates when
5376 (find_applicable_accessible_methods_list,
5377 find_most_specific_methods_list, argument_types_convertible): New
5379 (refine_accessible_methods_list): Function deleted.
5380 (java_complete_tree): Handle TRY_EXPR. ARRAY_REF handling: save
5381 expr (if applicable) before calling patch_array_ref.
5382 (build_expr_block): Fixed BLOCK_EXPR_BODY assignment.
5383 (enter_block): Fixed comment.
5384 (enter_a_block): New function.
5385 (patch_assignment): Reorganized. Call try_reference_assignconv for
5386 references. Call valid_cast_to_p instead of can_cast_to_p.
5387 (try_reference_assignconv,
5388 valid_builtin_assignconv_identity_widening_p): New functions.
5389 (valid_ref_assignconv_cast_p): Fixed inverted test on CLASS_FINAL.
5390 (valid_cast_to_p, valid_method_invocation_conversion_p): New
5392 (build_string_concatenation): Don't resolve StringBuffer.
5393 (patch_cast): Fixed inverted arguments.
5394 (patch_array_ref): Code to save array expr deleted. Call
5395 valid_cast_to_p instead of can_cast_to_p.
5396 (generate_labeled_block): Call generate_name.
5397 (build_jump_to_finally, build_try_statement, java_get_catch_block,
5398 patch_try_statement): New functions.
5399 * typeck.c (match_java_method): Function deleted.
5401 Fri Oct 2 13:48:36 1998 Anthony Green <green@cygnus.com>
5403 * jvspec.c: jvgenmain_spec uses different temporary file names.
5405 Fri Oct 2 12:50:19 1998 Anthony Green <green@cygnus.com>
5407 * jvspec.c (lang_specific_driver): Fail if user specifies
5408 --main= when not linking.
5410 Mon Sep 28 13:48:33 1998 Tom Tromey <tromey@cygnus.com>
5412 * class.c (make_class_data): Push value for `thread' field.
5413 * decl.c (init_decl_processing): Added `thread' field to class.
5415 * class.c (add_field): Always make static fields externally
5418 Sat Sep 26 08:22:47 1998 Anthony Green <green@cygnus.com>
5420 * expr.c (build_java_athrow,
5421 build_java_throw_out_of_bounds_exception, expand_invoke,
5422 build_newarray, expand_java_multianewarray, build_java_monitor):
5423 Update comments to reflect _Jv_* function names.
5425 Fri Sep 25 16:03:02 1998 Per Bothner <bothner@cygnus.com>
5427 * decl.c (complete_start_java_method): DECL_RESULT is always promoted.
5428 * decl.c (start_java_method): Handle PROMOTE_PROTOTYPES target macro.
5429 * parse.y (expand_start_java_method): Likewise.
5431 Thu Sep 24 12:20:35 1998 Per Bothner <bothner@cygnus.com>
5433 * expr.c (pop_arguments): Handle PROMOTE_PROTOTYPES target macro.
5435 * class.c (push_class): IDENTIFIER_SIGNATURE_TYPE is now POINTER_TYPE.
5436 (add_field): No longer need to convert from RECORD_TYPE to pointer,
5437 * expr.c: Remove no-longer-needed calls to promote_type.
5438 * decl.c (give_name_to_locals): Liekwise.
5439 * jcf-parse.c (get_class_constant): Compensate for new signatures.
5440 * parse.y: Add/remove promote_type calls as appropriate.
5441 * typeck.c (parse_signature_type): Returns POINTER_TYPE for objects.
5442 (parse_signature_string): Likewise.
5443 (build_java_array_type): Fix for now signature convenions.
5445 * lex.c (java_lex): Fix (from Alex) for JC1_LITE problem.
5447 Wed Sep 23 14:49:35 1998 Tom Tromey <tromey@cygnus.com>
5449 * class.c (init_class_processing): libjava function renamed to
5452 Tue Sep 22 12:00:02 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5454 * expr.c (java_lang_expand_expr): New case for SWITCH_EXPR.
5455 * java-tree.def: Fixed DEFTREECODE third argument.
5456 (UNARY_PLUS_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, THIS_EXPR,
5457 CASE_EXPR, DEFAULT_EXPR): New tree codes for Java.
5458 * java-tree.h: (IS_CRAFTED_STRING_BUFFER_P): New macro.
5459 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
5460 JAVA_THIS_EXPR): Now replaced by tree code definitions.
5461 (CALL_CONSTRUCTOR_P): Now uses NEW_CLASS_EXPR.
5462 * lang.c (java_tree_code_type, java_tree_code_length,
5463 java_tree_code_name): New arrays.
5464 (lang_init): Append Java tree node definitions to Gcc ones.
5465 * lex.c (expression_obstack): Declared as extern when JC1_LITE
5467 (java_init_lex): Initialize wfl_append, wfl_string_buffer,
5469 (java_lex): Allow declaration of empty string constants. Retain
5470 location information on CASE_TK and DEFAULT_TK.
5471 * parse.h (JFLOAT_TYPE_P, JINTEGRAL_TYPE_P, JNUMERIC_TYPE_P,
5472 JPRIMITIVE_TYPE_P, JSTRING_TYPE_P, JSTRING_P, JREFERENCE_TYPE_P):
5473 Modified to be more robust.
5474 (BUILD_APPEND, BUILD_STRING_BUFFER): New macros.
5475 (build_new_invocation, try_builtin_assignconv,
5476 patch_switch_statement, string_constant_concatenation,
5477 build_string_concatenation, patch_string_cst, patch_string,
5478 java_expand_switch): New function declarations.
5479 * parse.y: Rules related to switch and EH tagged <node>.
5480 (label_id): Set to NULL_TREE
5481 (wfl_string_buffer, wfl_append, wfl_to_string): New static global
5483 (this_or_super:): Fixed indentation.
5484 (statement:, statement_nsi:, statement_without_trailing_substatement:,
5485 statement_expression:): Removed call to RULE on all sub-rules.
5486 (switch_expression:, switch_labels:): New rules.
5487 (switch_statement:, switch_block:, switch_block_statement_groups:,
5488 switch_block_statement_group:, switch_labels:, switch_label:):
5490 (throw_statement:, synchronized_statement:, try_statement:):
5491 Defined temporary actions.
5492 (class_instance_creation_expression:): Call
5493 build_new_invocation. Fixed indentation.
5494 (field_access): Fixed indentation.
5495 (method_invocation): Likewise.
5496 (make_qualified_primary): Use THIS_EXPR.
5497 (resolve_qualified_expression_name): Use NEW_CLASS_EXPR. When
5498 resolving from SUPER, set *type_found.
5499 (qualify_ambiguous_name): Use NEW_CLASS_EXPR.
5500 (java_complete_tree): Removed unused local variable `location'. Case
5501 for SWITCH_EXPR, sharing code with LOOP_EXPR. Use NEW_ARRAY_EXPR,
5502 NEW_CLASS_EXPR, UNARY_PLUS_EXPR and THIS_EXPR. New string handling
5503 on MODIFY_EXPR: and all binary operator tree code cases. Removed
5504 STRING_CST: case. default: checks for patchable strings.
5505 (complete_function_arguments): Transform string constant or
5506 crafted StringBuffer if necessary.
5507 (build_method_invocation): Fixed comments.
5508 (build_new_invocation): New function.
5509 (patch_assignment): Call try_builtin_assignconv to figure a valid
5510 assignment conversion between builtin types.
5511 (try_builtin_assignconv): New function.
5512 (build_binop): Use URSHIFT_EXPR directly to call build.
5513 (operator_string): Use UNARY_PLUS_EXPR.
5514 (patch_binop): Use UNARY_PLUS_EXPR. Handle string concatenation
5516 (do_merge_string_cste, merge_string_cste,
5517 string_constant_concatenation, build_string_concatenation,
5518 patch_string, patch_string_cst): New function.
5519 (build_unary_op): Use UNARY_PLUS_EXPR and CONVERT_EXPR.
5520 (patch_unaryop): Likewise. New test of valid ++/-- operands.
5521 (build_newarray_node): Use NEW_ARRAY_EXPR.
5522 (build_this): Use THIS_EXPR.
5523 (build_return): Enable debug information on return statement.
5524 (build_if_else_statement): Likewise.
5525 (complete_labeled_statement): Fixed related comment.
5526 (build_loop_body): Fixed comment.
5527 (build_bc_statement): Enable debug information on break/continue
5529 (patch_bc_statement): Fixed typos. Handle SWITCH statement
5531 (patch_switch_statement, case_identity, java_expand_switch): New
5534 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
5536 * buffer.h (BUFFER_INIT): New macro.
5537 * jcf-write.c (struct jcf_partial): New type. Put global stuff here.
5538 Pass (struct jcf_partial *state) to most functions.
5539 (jcf_block, jcf_relocation): New types.
5540 Support labels, branches, conditionals, loops.
5542 Mon Sep 21 15:08:48 1998 Tom Tromey <tromey@cygnus.com>
5544 * decl.c (INT_TYPE_SIZE): Define as BITS_PER_WORD if not defined.
5546 Mon Sep 21 13:21:35 1998 Per Bothner <bothner@cygnus.com>
5548 * decl.c (integer_type_node): Make it have INT_TYPE_SIZE.
5549 * verify.c (verify_jvm_instructions): Use int_type_not (32 bits),
5550 not integer_type_node (INT_TYPE_SIZ bits).
5552 * parse.y (patch_if_else_statement): Accept promoted_boolean_type_node.
5554 * jcf-reader.c (get_attribute): New HANDLE_EXCEPTION_TABLE hook.
5555 * jcf-dump.c (print_exception_table): New function.
5556 (disassemble_method): Better handling of wide instructions.
5557 Make more robust for bad input.
5559 Wed Sep 30 20:53:51 1998 Jeffrey A Law (law@cygnus.com)
5561 * jcf-write.c (OP2, OP4): Use "_i", not "_I" to avoid problems on
5564 Thu Sep 17 19:45:01 1998 Jeffrey A Law (law@cygnus.com)
5566 * Makefile.in (jcf-dump, jvgenmain): Link in memmove.o too.
5568 Thu Sep 17 16:21:52 1998 Tom Tromey <tromey@cygnus.com>
5570 * Makefile.in ($(PARSE_H)): Removed target.
5572 Thu Sep 17 01:57:07 1998 Jeffrey A Law (law@cygnus.com)
5574 * Makefile.in (JAVA_OBJS): Add memmove.o
5575 (memmove.o): New target & rules.
5577 Tue Sep 15 23:21:55 1998 Tom Tromey <tromey@cygnus.com>
5579 * expr.c (expand_invoke): Don't generate a call to the class init
5582 Mon Sep 14 10:14:47 1998 Jeffrey A Law (law@cygnus.com)
5584 * Makefile.in: Add many missing dependencies.
5585 * buffer.c, class.c, constants.c, decl.c: Use system.h and toplev.h
5587 * except.c, expr.c, jcf-io.c jcf-parse.c, jcf-write.c: Likewise.
5588 * jvgenmain.c lang.c mangle.c typeck.c verify.c: Likewise.
5590 Fri Sep 11 14:05:21 1998 Per Bothner <bothner@cygnus.com>
5592 * decl.c (complete_start_java_method): If method is static (and
5593 not private) call _Jv_InitClass.
5594 * expr.c (expand_invoke): Don't call build_class_init.
5596 * jvspec.c (jvgenmain_spec): Fix spec for generated .o file.
5598 Thu Sep 10 10:33:31 1998 Jeffrey A Law (law@cygnus.com)
5600 * Make-lang.in (GCJ): Define before using.
5602 Wed Sep 9 21:23:10 1998 Jeffrey A Law (law@cygnus.com)
5604 * gjavah.c (java_no_argument): Renamed from no_argument to avoid
5605 losing due to namespace pollution in GNU getopt.h
5607 Wed Sep 9 13:33:39 1998 Tom Tromey <tromey@cygnus.com>
5609 * Make-lang.in (java.all.build): Don't mention jvgenmain or gcjh.
5610 (java.all.cross): Likewise.
5611 (java.rest.encap): Likewise.
5613 Tue Sep 8 10:34:05 1998 Jeffrey A Law (law@cygnus.com)
5615 * gjavah.c (print_class_decls): Fix thinko in arglist
5616 * jcv-io.c (find_classfile): Similarly.
5618 Mon Sep 7 13:59:49 1998 Jeffrey A Law (law@cygnus.com)
5620 * Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
5622 Sat Sep 5 16:08:01 1998 Tom Tromey <tromey@cygnus.com>
5624 * Make-lang.in (java.maintainer-clean): Don't remove parse.h.
5625 (java.mostlyclean): Remove parse.c and parse-scan.c, not parse.h.
5626 * Makefile.in (PARSE_C): New macro.
5627 (PARSE_H): Likewise.
5628 (PARSE_SCAN_C): Likewise.
5629 ($(PARSE_C)): Target renamed from parse.c.
5630 ($(PARSE_SCAN_C)): Target renamed from parse-scan.c.
5631 (clean): Remove parse-scan.c as well.
5632 (parse.o): Depend on $(PARSE_C).
5634 Sat Sep 5 08:48:40 1998 Anthony Green <green@cygnus.com>
5636 * README, license.terms: Removed.
5638 * Make-lang.in, Makefile.in, class.c, config-lang.in, constants.c,
5639 decl.c, except.c, expr.c, gjavah.c, java-except.h, java-tree.h,
5640 javaop.def, javaop.h, jcf-dump.c, jcf-io.c, jcf-parse.c,
5641 jcf-reader.c, jcf-write.c, jcf.h, jvgenmain.c, jvspec.c,
5642 keyword.gperf, keyword.h, lang-options.h, lang-specs.h, lang.c,
5643 lex.c, lex.h, mangle.c, parse-scan.y, parse.h, parse.y, typeck.c,
5644 verify.c, zextract.c, zipfile.h: Fixed copyright assignment,
5645 and Java trademark attribution.
5647 Fri Sep 4 10:42:05 1998 Tom Tromey <tromey@cygnus.com>
5649 * Makefile.in: Use gcjh, not gjavah.
5650 * config-lang.in (stagestuff): Use gcjh, not gjavah.
5651 * Make-lang.in: Changed gjavah to gcjh everywhere.
5653 Thu Sep 3 18:04:09 1998 Per Bothner <bothner@cygnus.com>
5655 * gjavah.c: Support new -prepend -add -append flags.
5656 (print_method_info): Method is not virtual if class is final.
5658 Thu Sep 3 12:03:53 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5660 * jv-scan.c: Fixed copyright assignment.
5661 * keyword.gperf: Likewise.
5662 * keyword.h: Likewise.
5663 * lex.c: Fixed copyright assignment.
5664 (java_lex): Push unicode back when parsing '<'.
5665 * lex.h: Fixed copyright assignment.
5666 * parse-scan.y: Likewise.
5667 * parse.h: Fixed copyright assignment.
5668 (build_debugable_stmt, complete_for_loop): New function prototypes.
5669 * parse.y: Fixed copyright assignment.
5670 (for_statement:): Call complete_for_loop. Set EXIT_EXPR to be
5671 size_zero_node when completing a loop with no exit condition.
5672 (for_statement_nsi:): Define action.
5673 (for_init:, for_update:): Return size_zero_node when empty.
5674 (declare_local_variables): Call build_debugable_stmt.
5675 (build_debugable_stmt): New function.
5676 (build_loop_body): Build debugable statement around loop
5678 (complete_loop_body): Take into account the debugable statement
5679 around the EXIT_EXPR.
5680 (complete_loop_body): New function.
5681 (patch_exit_expr): Fixed condition inversion.
5683 Wed Sep 2 11:53:58 1998 Tom Tromey <tromey@cygnus.com>
5685 * Make-lang.in (jvspec.o): Use GCC_THREAD_FILE to compute correct
5686 name of thread define.
5687 * jvspec.c (THREAD_NAME): New macro.
5689 (THREADLIB): Likewise.
5690 (lang_specific_driver): Recognize attempt to link with thread
5691 library or gc library. Recognize -ljava on command line so it
5692 isn't linked against more than once.
5694 Wed Sep 2 11:28:35 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5696 * parse-scan.y (report_main_declaration): Name of the class
5697 containing `main' can be a qualified name.
5699 Mon Aug 31 13:25:58 1998 Tom Tromey <tromey@cygnus.com>
5701 * config-lang.in: Changed gjavac to gjc everywhere.
5702 * Make-lang.in: Changed gjavac to gjc everywhere.
5704 Thu Aug 27 02:28:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5706 * Make-lang.in (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): New variable.
5707 (java.install-common:): Loop over JAVA_TARGET_INDEPENDENT_BIN_TOOLS
5708 and install the files.
5709 * Makefile.in (JAVA_OBJS_LITE): New variable.
5710 (compiler:): Now include jv-scan as a dependency.
5711 (../jv-scan$(exeext), parse-scan.c): New targets.
5712 (../jcf-dump$(exeext)): Was jcf-dump$(exeext) before.
5713 * config-lang.in (compilers): Removed gcj, gjavah from the list.
5714 * jcf-parse.c (parse_source_file): Call java_layout_classes and
5715 check for errors even if parse_only.
5716 * lex.c (java_init_lex): Reorganized and skip parts if JC1_LITE is
5718 (yylex): New function. Uses java_lex body.
5719 (java_lex): Removed commented out statement. Remove local variable
5720 literal. Use SET_LVAL_NODE_TYPE and SET_LVAL_NODE where
5721 appropriate. Use macros FLOAT_TYPE_NODE, DOUBLE_TYPE_NODE,
5722 DCONST0, SET_FLOAT_HANDLER, SET_REAL_VALUE_ATOF,
5723 SET_LVAL_NODE_TYPE and GET_TYPE_PRECISION. Don't create STRING_CST
5724 if JC1_LITE is defined. Use BUILD_ID_WFL to build identifiers. Use
5725 SET_MODIFIER_CTX, SET_LVAL_NODE, BUILD_ID_WFL and GET_IDENTIFIER
5727 (java_lex_error): Empty if JC1_LITE is defined.
5728 (java_get_line_col): Return 0 if JC1_LITE is defined.
5729 * lex.h (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR,
5730 SET_MODIFIER_CTX): Moved into the section containing the macros
5731 conditionally defined by JC1_LITE.
5732 (BUILD_OPERATOR,BUILD_OPERATOR2): Just return the TOKEN
5733 argument if JC1_LITE is defined.
5734 (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, REAL_VALUE_ATOF,
5735 REAL_VALUE_ISINF, REAL_VALUE_ISNAN): Preset to values if JC1_LITE
5737 (DCONST0, SET_FLOAT_HANDLER, GET_IDENTIFIER, SET_REAL_VALUE_ATOF,
5738 FLOAT_TYPE, DOUBLE_TYPE, SET_MODIFIER_CTX, GET_TYPE_PRECISION,
5739 SET_LVAL_NODE, SET_LVAL_NODE_TYPE, BUILD_ID_WFL): New macros, set
5740 to different values according to JC1_LITE.
5741 * parse.h (int_fits_type_p, stabilize_reference): Prototype not
5742 declared if JC1_LITE set.
5743 (jdep_code, typedef struct _jdep, typedef struct _jdeplist): Not
5744 defined if JC1_LITE not set.
5745 (struct parser_ctx): Reorganized and skip the jc1 front end part
5747 (java_layout_classes): New function definition.
5748 (java_push_parser_context, java_init_lex, yyparse, yylex,
5749 yyerror): Prototype always declared. All other static function
5750 prototypes declared only if JC1_LITE is not set.
5751 * parse.y (yyparse, yylex, yyerror): No longer declared here. Now
5752 declared in parse.h.
5753 (java_layout_classes): New function.
5754 (java_complete_expand_methods): No longer layout the class here.
5755 * parse-scan.y: New file.
5756 * jv-scan.c: New file.
5758 Tue Aug 25 10:17:54 1998 Tom Tromey <tromey@cygnus.com>
5760 * gjavah.c (main): Handle -friend option.
5761 (friend_specs): New global.
5762 (generate_access): Handle friend_specs.
5763 (process_file): Likewise.
5764 (MAX_FRIENDS): New macro.
5765 (friend_count): New global.
5766 (print_cxx_classname): Added `prefix' argument. Ignore arrays.
5767 Changed all callers.
5769 Mon Aug 24 20:19:27 1998 Per Bothner <bothner@cygnus.com>
5771 * jcf-dump.c (process_class): Move JCF_FINISH use to main,
5772 (main): Handle processing all the entries of a named .zip archive.
5773 * jcf-io.c (jcf_trim_old_input): New function.
5774 * jcf.h (GET_u2_le,GET_u4_le,JCF_readu2_le,JCF_readu4_le): New macros.
5776 Mon Aug 24 07:35:13 1998 Per Bothner <bothner@cygnus.com>
5778 * lang.c (flag_assume_compiled): Make default be on.
5780 Fri Aug 21 17:29:04 1998 Per Bothner <bothner@cygnus.com>
5782 * jcf-dump.c: Add bunches of flags to control output more.
5783 (process_class): New function; support printing more than one class.
5784 (main): Support new --print-main and --javap flags.
5785 * jcf-reader.c (IGNORE_ATTRIBUTE): New hook.
5786 * jcf.h (CPOOL_INDEX_IN_RANGE): New macro.
5788 Thu Aug 20 14:24:47 1998 Per Bothner <bothner@cygnus.com>
5790 Change mangling of dispatch table to match C++ vtable (w/thunks).
5791 * class.c (build_dtable_decl), java-tree.h: New function.
5792 (make_class_data): Call it.
5793 * decl.c (init_decl_processing): Likewise.
5795 Wed Aug 19 17:57:07 1998 Warren Levy <warrenl@cygnus.com>
5797 * decl.c (init_decl_processing): Use _Jv_NewObjectArray, not
5798 soft_anewarray; adjust args passed.
5799 * expr.c (build_anewarray): Adjust args for soft_anewarray_node to
5800 match _Jv_NewObjectArray.
5802 Wed Aug 19 09:33:23 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5804 * decl.c (push_labeled_block, pop_labeled_block): New functions.
5805 * expr.c (loopup_label): Call create_label_decl.
5806 (create_label_decl): New function.
5807 (java_lang_expand_expr): Call expand_start_bindings with argument
5809 * java-tree.h Added space after PROTO in function declarations
5811 (IS_FOR_LOOP_P, IS_BREAK_STMT_P): New macros.
5812 (create_label_decl, push_labeled_block): New function
5814 * lex.c (label_id): Initialize.
5815 (SUPER_TK, THIS_TK, RETURN_TK): Merged common actions in final
5817 * parse.h Added space after PROTO in function declarations when
5819 (LOOP_EXPR_BODY_MAIN_BLOCK, LOOP_EXPR_BODY_UPDATE_BLOCK,
5820 LOOP_EXPR_BODY_CONDITION_EXPR, LOOP_EXPR_BODY_LABELED_BODY,
5821 LOOP_EXPR_BODY_BODY_EXPR, LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P,
5822 PUSH_LABELED_BLOCK, POP_LABELED_BLOCK, PUSH_LOOP, POP_LOOP): New
5824 (struct parser_ctxt): New fields current_loop,
5825 current_labeled_block.
5826 (build_if_else_statement, patch_if_else_statement,
5827 add_stmt_to_compound, patch_exit_expr, build_labeled_block,
5828 generate_labeled_block, complete_labeled_statement,
5829 build_bc_statement, patch_bc_statement, patch_loop_statement,
5830 build_new_loop, build_loop_body, complete_loop_body): New function
5832 * parse.y (java_warning_count): New global variable.
5833 (label_id): New static variable.
5834 (BREAK_TK, CONTINUE_TK): Token tagged <operator>.
5835 (block:): Return size_zero_node when block is empty.
5836 (empty_statement:): Return size_zero_node.
5837 (statement:): Implement supplemental action when for_statement: is
5839 (label_decl:): New rule.
5840 (labeled_statement:): Rewritten using label_decl. Actions
5842 (labeled_statement_nsi:): Likewise.
5843 (if_then_statement): Actions implemented.
5844 (while_expression): New rule.
5845 (while_statement:): Rewritten using while_expression. Actions
5847 (while_statement_nsi:): Likewise.
5848 (do_statement_begin:): New rule.
5849 (do_statement:): Rewritten using do_statement_begin. Actions
5851 (for_statement:): Rewritten using for_begin. Actions implemented.
5852 (for_statement_nsi:): Likewise.
5853 (for_header:, for_begin:): New rules.
5854 (for_init:): Actions implemented.
5855 (statement_expression_list:, break_statement:,
5856 continue_statement:): Likewise.
5857 (yyerror): Count number of issued warning(s).
5858 (java_report_errors): Report error(s) and/or warning(s).
5859 (java_complete_class): Use build_java_argument_signature to
5860 recompute completed method signature.
5861 (java_check_regular_methods): New locals method_wfl and aflags.
5862 Use method_wfl instead of lookup_cl during error reports. Fixed
5863 indentation and modified some error messages. Use
5864 lang_printable_name in method instead of the DECL_NAME. New code
5865 to issue warnings on methods not overriding corresponding methods
5866 private to a different package.
5867 (java_method_add_stmt): Call add_stmt_to_compound.
5868 (add_stmt_to_compound): New function.
5869 (java_complete_tree): Handle LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR,
5870 LOOP_EXPR, EXIT_EXPR and COND_EXPR.
5871 (build_if_else_statement, patch_if_else_statement,
5872 build_labeled_block, generate_labeled_block,
5873 complete_labeled_statement, build_new_loop, build_loop_body,
5874 complete_loop_body, patch_loop_statement, build_bc_statement,
5875 patch_bc_statement, patch_exit_expr): New functions.
5876 * typeck.c (build_java_signature): Build argument signature before
5877 enclosing it in between parenthesis.
5879 Mon Aug 17 17:44:24 1998 Warren Levy <warrenl@cygnus.com>
5881 * Make-lang.in (JAVA_SRCS): Created for dependencies * Makefile.in
5882 (JAVA_OBJS): Added reminder comment
5884 Thu Aug 13 10:01:45 1998 Nick Clifton <nickc@cygnus.com>
5886 * gjavah.c (D_NAN_MASK): Append LL to the constant to force it to
5887 be interpreted as a long long.
5889 Thu Aug 13 14:34:07 1998 Warren Levy <warrenl@cygnus.com>
5891 * decl.c (init_decl_processing): Use _Jv_InitClass, not
5892 soft_initialise_class. Use _Jv_NewMultiArray, not
5893 soft_multianewarray. Use _Jv_ThrowBadArrayIndex, not
5894 soft_badarrayindex. Use _Jv_CheckCast, not soft_checkcast. Use
5895 _Jv_CheckArrayStore, not soft_checkarraystore. Use
5896 _Jv_LookupInterfaceMethod, not soft_lookupinterfacemethod.
5898 Wed Aug 12 14:23:13 1998 Per Bothner <bothner@cygnus.com>
5900 * decl.c, java-tree.h (this_identifier_node, super_identifier_node,
5901 length_identifier_node): New global tree node constants.
5902 * parse.y (kw_super, kw_this, kw_length): Removed globals.
5903 Replace uses by super_identifier_node etc.
5904 * lex.c (kw_super, kw_this, kw_length): Don't initialize.
5906 * parse.y (resolve_field_access): Don't special-case ".length" if
5907 flag_emit_class_files.
5908 (patch_array_ref): Leave as ARRAY_REF if flag_emit_class_files.
5909 * jcf-write.c (generate_bytecode_insns): Handle ARRAY_REF opcode
5912 Tue Aug 11 11:31:55 1998 Per Bothner <bothner@cygnus.com>
5914 * decl.c (init_decl_processing): Remove unused method_type_node fields.
5915 * class.c (make_method_value): Remove init for removed fields.
5917 * class.c (layout_class): Use build_java_argument_signature.
5918 * java-tree.h (TYPE_ARGUMENT_SIGNATURE): New macro.
5920 * typeck.c (push_java_argument_signature): Removed. Merged into ...
5921 (build_java_argument_signature): Use TYPE_ARGUMENT_SIGNATURE cache.
5922 (build_java_signature): Don't use push_java_argument_signature.
5924 * typeck.c (lookup_argument_method): New function.
5925 * parse.y (java_check_regular_methods): Use lookup_argument_method
5926 instead of lookup_java_method2 followed by lookup_java_method.
5928 * parse.y (check_method_redefinition): Minor optimization.
5930 * jcf-write.c (generate_bytecode_insns): Handle RETURN_EXPR,
5931 MINUS_EXPR, MULT_EXPR, TRUNC_DIV_EXPR, and RDIV_EXPR.
5933 Mon Aug 10 09:57:15 1998 Tom Tromey <tromey@cygnus.com>
5935 * Make-lang.in (jc1$(exeext)): Don't depend on c-common.o or
5938 * gjavah.c (java_float_finite): Use K&R-style definition.
5939 (java_double_finite): Likewise.
5940 (generate_access): Now returns void. Changed all callers.
5941 (last_access_generated): Removed.
5942 (process_file): Only make a single pass over the .class file.
5944 Wed Jul 29 17:50:23 1998 Per Bothner <bothner@cygnus.com>
5946 * class.c (get_dispatch_table): Add extra dummy vtable entry,
5947 for compatibility for G++ (with -fvtable-thunks).
5948 * expr.c (build_invokevirtual): Add one for extra dummy vtable entry.
5950 * gjavah.c (process_file): Use public inheritance for super-class.
5952 Wed Jul 29 13:19:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
5954 * lex.c (java_init_lex): Initialize ctxp->package.
5955 * parse.h (struct parser_ctxt): package and package_len replaced
5956 by tree package, an identifier node. Field method_decl_list is
5957 gone. Fixed comments.
5958 (lookup_field_wrapper, merge_qualified_name, not_accessible,
5959 class_in_current_package): New function prototypes.
5960 * parse.y (array_type:): Set class loaded flag on primitive type
5962 (package_declaration:): Assign ctxp->package to the
5964 (method_invocation:): Handle invocation of method qualified by
5966 (single_type_import_declaration:): Removed ambiguity check.
5967 (java_pop_parser_context): New local variable `next'. Reset and
5968 set IMPORT_CLASSFILE_NAME flags on current and previous import
5970 (java_accstring_lookup): Use new local macro COPY_RETURN.
5971 (lookup_field_wrapper): New function.
5972 (parser_qualified_classname): Use merge_qualified_name.
5973 (parser_check_super_interface): Broaden error message.
5974 (do_resolve_class): Check for qualified class name in the current
5975 compilation unit if appropriate.
5976 (process_imports): Check for already defined classes.
5977 (check_pkg_class_access): Got rid of call to
5978 get_access_flags_from_decl.
5979 (java_complete_expand_methods): Call safe_layout_class based on
5980 the current class size.
5981 (make_qualified_primary): Build a WFL qualification on primary if
5983 (merge_qualified_name): New function.
5984 (make_qualified_name): Use merge_qualified_name.
5985 (resolve_expression_name): Use safe_lookup_field.
5986 (resolve_field_access): Got rid of call to get_access_flags_from_decl.
5987 (resolve_qualified_expression_name): Likewise. Check on resolved
5988 element accessibility.
5989 (not_accessible_p, class_in_current_package): New functions.
5990 (maybe_access_field): Got rid of call to get_access_flags_from_decl.
5991 (patch_method_invocation_stmt): Merged common pieces. Check
5992 accessibility of invoked method.
5993 (check_for_static_method_reference): Add returned type in error
5995 (invocation_mode): Get rid of bogus check on PRIVATE methods.
5996 (refine_accessible_methods_list): Merged two conditions in test.
5997 (java_complete_class): Sanity check on stabilize_ref gone.
5998 * zextract.c (read_zip_archive): Cast lseek second argument to long.
6000 Tue Jul 28 21:39:22 1998 Per Bothner <bothner@cygnus.com>
6002 * class.c (hashUtf8String): Fix - use new JavaSoft specification.
6004 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
6006 * gjavah.c (F_NAN): Removed.
6007 (F_NAN_MASK): New macro.
6008 (F_POSITIVE_INFINITY): Removed.
6009 (F_NEGATIVE_INFINITY): Likewise.
6010 (java_float_finite): Rewrote.
6011 (D_NAN_MASK): Renamed.
6012 (java_double_finite): Rewrote.
6013 (D_POSITIVE_INFINITY): Removed.
6014 (D_NEGATIVE_INFINITY): Likewise.
6016 * jcf-dump.c (print_constant): [CONSTANT_Double, CONSTANT_Float]
6017 If verbose, print underlying representation of value in hex.
6019 Fri Jul 24 14:14:32 1998 Per Bothner <bothner@cygnus.com>
6021 * buffer.h, buffer.c: New files.
6022 * Makefile.in (JAVA_OBJS): Add buffer.o.
6024 Support locals variables and writing their debug entries to .class.
6025 * jcf-write.c: Simplify some by user new buffer type.
6026 (vode_buffer_grow): Removed.
6027 (struct localvar_info): New type.
6028 (localsvars, localvartable): New buffers.
6029 (localvar_alloc, localvar_free): New functions.
6030 (generate_bytecode_insns): Handle local variables.
6031 (generate_classfile): Write LocalVariableTable attribute.
6033 Fri Jul 24 13:46:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6035 * jcf-io.c (open_in_zip): Check the zipfile magic number.
6036 * zipfile.h (ZIPMAGIC): New macro.
6038 Fri Jul 24 10:43:25 1998 Tom Tromey <tromey@cygnus.com>
6040 * Makefile.in (gjavah.o): Updated dependencies.
6041 (jcf-dump.o): Likewise.
6042 (all.indirect): Use ../gjavah.
6043 (../gjavah$(exeext)): Likewise.
6044 (clean): Don't remove gjavah.
6045 (clean): Remove parse.c, not java/parse.c.
6046 * Make-lang.in (java): Added gjavah.
6047 (gjavah$(exeext)): New target.
6048 (GJAVAH_SOURCES): New macro.
6049 (java.all.build): Added gjavah.
6050 (java.all.cross): Likewise.
6051 (java.rest.encap): Likewise.
6052 * config-lang.in (compilers, stagestuff): Added gjavah.
6054 Thu Jul 23 18:33:56 1998 Tom Tromey <tromey@cygnus.com>
6056 * gjavah.c (java_float_finite): New function.
6057 (java_double_finite): Likewise.
6058 (F_POSITIVE_INFINITY): New macro.
6059 (F_NEGATIVE_INFINITY): Likewise.
6061 (D_POSITIVE_INFINITY): Likewise.
6062 (D_NEGATIVE_INFINITY): Likewise.
6064 (print_field_info): Use java_float_finite and java_double_finite.
6066 Thu Jul 23 15:28:24 1998 Per Bothner <bothner@cygnus.com>
6068 * parse.y (method_header): Name "this" implicit argument.
6070 Wed Jul 22 15:47:30 1998 Per Bothner <bothner@cygnus.com>
6072 * jcf-write.c: Write out LineNumberTable attribute in .class file.
6073 (linenumber_buffer, linenumber_ptr, linenumber_limit): New statics.
6074 (put_linenumber): New function.
6075 (generate_bytecode_insns, generate_classfile): Write line numbers.
6077 Wed Jul 22 14:39:00 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6079 * java-tree.h (CALL_EXPR_FROM_PRIMARY_P): Changed in PRIMARY_P.
6080 (lookup_name, build_known_method_ref, build_class_init,
6081 build_invokevirtual, invoke_build_dtable, match_java_method,
6082 build_field_ref, pushdecl_force_head, build_java_binop,
6083 binary_numeric_promotion, build_decl_no_layout,
6084 build_java_arrayaccess, build_newarray, build_anewarray,
6085 build_java_array_length_access, build_java_arraynull_check): New
6086 extern function prototypes.
6087 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
6088 JAVA_THIS_EXPR, CALL_CONSTRUCTOR_P): Macro definition moved in
6090 * jcf-parse.c (init_outgoing_cpool): Set current_constant_pool_data_ref
6092 * jcf.h (jcf_out_of_synch): New extern function prototype.
6093 * parse.h: Static/global function implemented in parse.y
6094 prototyped and declarations moved at the end of the file.
6095 (DECL_P): Check that the argument isn't null.
6096 (JAVA_UNARY_PLUS_EXPR, JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR,
6097 JAVA_THIS_EXPR): No longer defined here. See java-tree.h
6098 (QUAL_DECL_TYPE): New macro.
6099 (PARAMS): Macro definition removed.
6100 * parse.y: (yyparse, yyerror): Use PROTO instead of PARAMS.
6101 (return_statement:): Call build_return.
6102 (field_access:): Call make_qualified_primary in sub rule.
6103 (method_invocation:): Build method invocation and call
6104 make_qualified_primary when processing primaries.
6105 (java_complete_class): Set IDENTIFIER_SIGNATURE_TYPE by calling
6106 get_type_from_signature.
6107 (java_check_regular_method): Extra integer 0 argument when calling
6108 lookup_java_method2.
6109 (lookup_java_interface_method2): Extra method DECL argument when
6110 calling lookup_java_interface_method2.
6111 (java_method_add_stmt): Set TREE_SIDE_EFFECTS on newly created
6113 (java_complete_expand_method): Layout current class iff not
6114 already done. Don't process interface's methods.
6115 (java_complete_expand_method): Use super class only if it
6116 exists. Use current class otherwise.
6117 (make_qualified_primary): New function.
6118 (resolve_expression_name): Process qualified expression or
6119 expression from primary the same way.
6120 (resolve_expression_name): Two last arguments to
6121 resolve_field_access are now NULL_TREEs.
6122 (resolve_field_access): New variable is_static. Local field must
6123 be DECLs. is_static computed on field DECLs only. Append code in
6124 where_found to the field access if necessary. Use QUAL_DECL_TYPE
6125 to initialize field_type.
6126 (resolve_qualified_expression_name): New local variable,
6127 previous_call_static and is_static. Handle primaries with function
6128 calls, casts, array references and `this'. `super' now handled as
6129 `(super_class)this'. Use is_static to clarify boolean expressions.
6130 Added code to handle case where a proper handle is required to
6131 access a field. Use QUAL_DECL_TYPE where applicable.
6132 (maybe_access_field): New function.
6133 (patch_method_invocation_stmt): New arguments primary, where,
6134 is_static. Branch of the test on CALL_EXPR_FROM_PRIMARY_P
6135 deleted. Use `where' as a type to search from if specified. Check
6136 for static method reference where forbidden. Append primary or
6137 current_this to the argument list if not calling constructor nor
6139 (check_for_static_method_reference): New function.
6140 (patch_invoke): Layout the class on which new is done if
6142 (lookup_method_invoke): Changed format to report errors on
6144 (qualify_ambiguous_name): New local variable this_found. Now
6145 handle things from primaries. Method call are considered
6147 (identical_subpath_p): NULL_TREE arguments to breakdown_qualified
6149 (not_initialized_as_it_should_p): Comply with the new DECL_P.
6150 (java_complete_tree): New case fo RETURN_EXPR. Process function
6151 call arguments in separate function.
6152 (complete_function_arguments): New function.
6153 (build_method_invocation): Don't use CALL_EXPR_FROM_PRIMARY_P
6155 (patch_assignment): Take the return function slot into account as
6156 a RHS. Distinguish assignment from a return.
6157 (valid_ref_assignconv_cast_p): Use build_java_argument_signature
6158 when checking methods in interfaces.
6159 (resolve_type_during_patch): NULL argument to unresolve_type_p
6160 instead of NULL_TREE.
6161 (patch_newarray): Fixed typo in comment.
6162 (buid_this): Build a WFL with `kw_this' instead of a FIELD_DECL.
6163 (build_return, patch_return): New functions.
6164 * typeck.c (lookup_java_constructor): Fixed typo in comment.
6166 Tue Jul 21 12:10:04 1998 Per Bothner <bothner@cygnus.com>
6168 * constants.c (find_name_and_type_constant, find_fieldref_index,
6169 find_methodref_index): New methods.
6170 * expr.c (build_invoke_non_interface): If flag_emit_class_files,
6171 just return given method. Also, rename to build_known_method_ref.
6172 (expand_invoke): Rename call to build_invoke_non_interface.
6173 * java-tree.h, parse.h: Update prototype.
6174 * parse.y, decl.c, jcf-parse.c: Suppress calls to back-end functions
6175 (such as expand_expr_stmt) if flag_emit_class_files.
6176 * jcf-write.c (RESERVE, OP1, OP2, OP4, NOTE_PUSH, NOTE_POP,
6177 STACK_TARGET, IGNORE_TARGET): New macros.
6178 (code_buffer, code_ptr, code_limit, code_S, code_SP_max): New globals.
6179 (generate_bytecode_insn): New function to generate method's bytecode.
6180 (generate_classfile): Node generate Code attribute for a method.
6181 (code_buffer_grow, push_constant1, push_constant2, push_int_const,
6182 push_long_const, field_op, adjust_typed_op, maybe_wide):
6183 New functions used by generate_bytecode_insn.
6185 * typeck.c (signature_include_return): Remove variable.
6186 (push_java_argument_signature, build_java_argument_signature): New.
6187 (build_java_signature): Use push_java_argument_signature.
6188 * parse.y: Use build_java_argument_signature instead of fiddling
6189 with signature_include_return.
6191 Fri Jul 17 09:48:51 1998 Tom Tromey <tromey@cygnus.com>
6193 * gjavah.c (print_c_decl): Always generate JArray<>* for array
6196 * Makefile.in (all.indirect): Added gjavah$(exeext).
6197 (gjavah$(exeext)): Added $(exeext).
6200 Thu Jul 16 15:29:20 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6202 * class.c (layout_class): Call to java_layout_parsed_class replace
6203 by safe_layout_class.
6204 * expr.c (build_java_array_length_access): Removed static storage
6205 class in the function definition.
6206 (build_java_arraynull_check): Likewise.
6207 Also fixed typos in two comments.
6208 * lex.c (java_init_lex): Initialize static global kw_length.
6209 (java_lex): Use BUILD_OPERATOR on RETURN_TK.
6210 * lex.h (JAVA_FLOAT_RANGE_ERROR): Add extra argument to
6212 (JAVA_INTEGRAL_RANGE_ERROR): Likewise.
6213 * parse.h (resolve_no_layout): New static function declaration.
6214 (get_identifier_in_static): Declaration removed.
6215 (java_layout_parsed_class): Function name declaration changed to
6217 (build_newarray_node, patch_newarray, resolve_type_during_patch,
6218 not_initialized_as_it_should_p, build_this): New static function
6220 (pushdecl_force_head, build_java_binop, int_fits_type_p,
6221 binary_numeric_promotion, stabilize_reference,
6222 build_decl_no_layout, build_java_arrayaccess): Extern function
6223 declarations moved into their own section.
6224 (build_newarray, build_anewarray, build_java_array_length_access,
6225 build_java_arraynull_check): New extern function declarations.
6226 (UNARY_PLUS_EXPR): Macro renamed into JAVA_UNARY_PLUS_EXPR.
6227 (JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR, JAVA_THIS_EXPR): New
6229 (CALL_CONSTRUCTOR_P): New macro.
6230 * parse.y (kw_length): New static global tree node.
6231 (return_statement): Tagged <node>.
6232 (RETURN_TK): Tagged <operator>.
6233 (variable_declarator_id:): Build variable declaration with an
6234 empty initialization value if a syntax error was found in the
6235 initialization part of the variable declaration.
6236 (statement_without_trailing_substatement:): return_statement: now
6237 uses the default rule.
6238 (return_statement:): Temporarily fixed to return NULL_TREE.
6239 (primary_no_new_array:): Call build_this when THIS_TK was parsed.
6240 (class_instance_creation_expression:): Class creation rules now
6241 call build_method_invocation upon reduction.
6242 (array_creation_expression:): Rules call build_newarray_node upon
6244 (dim_exprs:): Build a list of dimension expressions.
6245 (dim_expr:): Store location of the OSB_TK in the dimension
6247 (method_invocation:): Added a new error rule.
6248 (build_unresolved_array_type): WFL argument may also be an array
6249 on a primitive type. Name of the argument changed to reflect this.
6250 (method_declarator): Insert argument type at the beginning of the
6251 argument type list and later reverse the list.
6252 (unresolved_type_p): Argument 'returned' may be optionally
6254 (java_layout_class_from_source): Function renamed
6256 (resolve_and_layout): Now call resolve_no_layout and
6258 (resolve_no_layout): New function.
6259 (purify_type_name): New function.
6260 (complete_class_report_errors): Call purify_type_name during error
6261 report on a type not found.
6262 (process_imports): error_found local variable doesn't need to be
6263 initialized to zero.
6264 (declare_local_variables): New local type_wfl. Fixed typo in error
6265 message. type_wfl assigned to unresolved type and used to register
6266 incomplete type. Build a WFL around the variable initialization
6267 statement so that debug info can be generated on it.
6268 (source_start_java_method): Reverse argument list after they've
6270 (current_this): New static global variable.
6271 (java_complete_expand_methods): Set current_this when appropriate.
6272 (resolve_expression_name): Build correct static and non static
6273 field access bearing a simple name.
6274 (resolve_field_access): Resolve the length field of arrays. Handle
6276 (patch_method_invocation_stmt): Set the type of the method
6277 invocation to error_mark_node. This value is later overridden by a
6278 valid type, if any. Don't handle qualified constructor invocation
6279 as qualified method invocation. Call lookup_method_invoke with its
6280 new flag. It's no longer necessary to access the selected method
6281 as the value of a tree list. Handle constructor invocation.
6282 (patch_invoke): Reverse argument list when invoking non interface
6283 methods. Insert call to new as the first argument of the
6285 (invocation_mode): Return a INVOKE_STATIC is the invoked method is
6286 defined within a final class. Return INVOKE_STATIC if the invoked
6287 method is a constructor.
6288 (lookup_method_invoke): New lc argument is a flag to indicate a
6289 constructor lookup. Now handle constructor lookup. Choose the most
6290 specific method in case several were matching the invocation
6291 requirements. Return a method decl instead of a tree list featuring
6292 one single method decl element.
6293 (refine_accessible_methods_list): New lc flag argument to
6294 indicate that a constructor is being looked up.
6295 (not_initialized_as_it_should_p): New function.
6296 (java_complete_tree): Now process fake tree codes
6297 JAVA_NEW_ARRAY_EXPR, JAVA_NEW_CLASS_EXPR and JAVA_THIS_EXPR. Call
6298 save_expr on resolved function call arguments. Case on
6299 UNARY_PLUS_EXPR changed into a case on JAVA_UNARY_PLUS_EXPR.
6300 (patch_assignment): LHS can be a field access expression. When
6301 dealing with reference, lhs_type is the promoted type of the
6302 rhs_type, not the RHS. Use not_initialized_as_it_should_p where
6304 (operator_string): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
6305 (patch_binop): Use not_initialized_as_it_should_p where
6307 (build_unaryop): JAVA_UNARY_PLUS_EXPR replaces UNARY_PLUS_EXPR.
6308 (patch_unaryop): Likewise. And use not_initialized_as_it_should_p
6310 (resolve_type_during_patch): New function.
6311 (patch_cast): Call resolve_type_during_patch to resolve type and
6312 report error accordingly.
6313 (patch_array_ref): Use not_initialized_as_it_should_p where
6314 applicable. Array base expression is saved before being
6315 used. Promote the type of an array elements if it contains non
6317 (build_newarray_node, patch_newarray, build_this): New functions.
6319 Thu Jul 16 10:46:47 1998 Tom Tromey <tromey@cygnus.com>
6321 * gjavah.c (print_c_decl): UTF8_GET increments pointer; don't
6322 increment it in `for' statement.
6323 (print_field_info): If number is inf or nan, don't print it.
6324 (print_method_info): If method name is `delete', just ignore it.
6325 (print_c_decl): Special-case jstringArray.
6327 * gjavah.c (help): New function.
6328 (no_argument): New function.
6329 (usage): Changed text.
6330 (main): Rewrote argument handling. Now handles -v, --help,
6332 (version): New function.
6333 (found_error): New global.
6334 (main): Return found_error.
6335 (generate_access): Set found_error.
6336 (print_c_decl): Likewise.
6338 Wed Jul 15 10:36:27 1998 Tom Tromey <tromey@cygnus.com>
6340 * gjavah.c (print_c_decl): Don't print "," when examining field.
6341 Skip type name when looking at "[L" types.
6342 (process_file): Now static.
6343 (generate_access): Now returns int.
6344 (last_access_generated): New global.
6345 (process_file): Clear last_access_generated; make multiple passes
6347 (print_field_info): Just return if generate_access returns true.
6348 (print_method_info): Likewise. Also, allow <init> functions to
6350 (print_c_decl): Added is_init argument. Print constructors
6352 (print_cxx_classname): Use UTF8_GET to extract characters from
6354 (print_base_classname): New function.
6355 (print_class_decls): New function.
6356 (process_file): Use it.
6357 (utf8_cmp): New function.
6359 Mon Jul 13 14:21:47 1998 Nick Clifton <nickc@cygnus.com>
6361 * lang-options.h: Format changed to match changes in gcc/toplev.c
6362 to implement a --help option.
6364 1998-07-10 Brendan Kehoe <brendan@cygnus.com>
6366 * decl.c (init_decl_processing): Revert change to dtable_type.
6368 Thu Jul 9 18:22:12 1998 Per Bothner <bothner@cygnus.com>
6370 * java-tree.h (CLASS_P): Changed DECL_LANG_FLAG_7 -> TYPE_LANG_FLAG_4.
6372 1998-07-08 Brendan Kehoe <brendan@cygnus.com>
6374 * decl.c (init_decl_processing): Set CLASS_LOADED_P on dtable_type.
6376 * lang.c (lang_init): Default flag_exceptions to 1, without
6377 checking to see if it's 2 first.
6379 Wed Jul 8 03:01:32 1998 Jeffrey A Law (law@cygnus.com)
6381 * constants.c: Include "system.h".
6383 * lang.c (flag_new_exceptions): Get via extern now.
6384 (lang_init_options): New functions. Turn on flag_new_exceptions.
6386 Tue Jul 7 12:56:48 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6388 * lex.c (java_lex): Return 0 when we see an invalid character in
6391 * lex.c (java_read_char): Specify extra argument when calling
6393 (java_read_unicode, java_parse_end_comment,
6394 java_parse_escape_sequence): Likewise,
6395 (java_lex): Specify extra argument when calling
6396 java_lex_error. Test that IDs are beginning with a legal character
6397 for IDs. Handle invalid characters with an error message and a
6398 call to java_lex_error.
6399 (java_lex_error): Adjust column position by new argument
6400 `forward'. Issue an error even if in the middle of reporting an
6403 1998-07-07 Brendan Kehoe <brendan@cygnus.com>
6405 * jcf-io.c (find_class): Zero out BUFFER before we use it, since
6406 we don't explicitly put a null pointer when we're copying it.
6408 Tue Jul 7 09:38:38 1998 Tom Tromey <tromey@cygnus.com>
6410 * gjavah.c (print_cxx_classname): New function.
6411 (super_class_name): Likewise.
6412 (print_super_fields): Removed.
6413 (in_super): Removed.
6414 (print_field_info): Never generate #defines.
6415 (print_c_decl): Changed generated types to match JNI. No longer
6416 print class name before method name.
6417 (print_method_info): Print "static" before static methods.
6418 Print "virtual" before non-final methods.
6419 (usage): Use exit(1), not exit(-1).
6421 (print_field_info): Use %.17g to print a double.
6422 (last_access): New globals.
6423 (process_file): Initialize last_access.
6424 (usage): Now static.
6425 (ACC_VISIBILITY): New define.
6426 (generate_access): New function.
6427 (print_field_info): Call it.
6428 (print_method_info): Likewise. Also, generate information for all
6429 methods, not just native methods. Return void.
6430 (print_c_decl): Return void.
6431 (print_field_info): Return void.
6433 Thu Jul 2 16:53:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6435 * Makefile.in (JAVABISONFLAGS): Specific flag for bison when
6436 processing the jc1 grammar file. Prefix bison functions and
6437 variables with java_.
6438 (parse.c): Dependencies on parse.h and lex.h
6439 * expr.c (build_java_arrayaccess): Function now global.
6440 * java-tree.h: Comment reorganized to carry on previous
6441 classification effort.
6442 (RESOLVE_EXPRESSION_NAME_P, RESOLVE_PACKAGE_NAME_P,
6443 RESOLVE_TYPE_NAME_P): New flags on WFLs.
6444 * jcf-parse.c (parse_source_file): java_parse_source_file renamed
6445 java_parse (new prefix java_ generated by bison).
6446 (java_layout_parsed_class, java_register_parsed_class): Function
6448 (yyparse): Removed unnecessary call to init_outgoing_cpool.
6449 * lex.c (static tree wfl_op): Variable deleted.
6450 (java_init_lex): Initialize kw_super and kw_this. Initialize more
6451 ctxp fields to NULL_TREE.
6452 (java_lex): No longer create WFL for operators. Filename caching
6453 mechanism deleted. Call BUILD_OPERATOR for `.', '(', '['. Strings
6454 created as STRING_CST and later expanded. Removed extra argument
6455 to BUILD_OPERATOR and BUILD_OPERATOR2. Build operators for THIS
6457 (build_wfl_node): Removed code in comments.
6458 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): No longer build a WFL but
6459 store token and location data in the current bison token.
6460 * parse.h: Removed pre-processor based symbol prefixes hack. Moved
6461 static/extern function declaration at the beginning of the file.
6462 (struct qualification): Data structure definition deleted.
6463 (RESOLVE_CHAIN_REMAINDER): Macro definition deleted.
6464 (qualify_ambiguous_name): Function declaration modified. Function
6465 now returns nothing.
6466 (build_array_ref, patch_array_ref, make_qualified_name,
6467 resolve_qualified_expression_name, maybe_generate_clinit,
6468 resolve_field_access): New static function declarations.
6469 (build_java_arrayaccess): New extern function declaration.
6470 (enum { RESOLVE_EXPRESION_NAME...}): Enum deleted.
6471 (CALL_EXPR_PRIMARY): Macro deleted.
6472 (EXPR_WFL_QUALIFICATION, QUAL_WFL, QUAL_RESOLUTION): New macros.
6473 (struct parser_ctxt): Field initialized_final
6474 removed. non_static_initialized, static_initialized: New fields.
6475 * parse.y (static tree kw_super, static tree kw_this): New global
6477 (%union): tree wfl field of operator member replaced by int
6478 location. WFLs are non longer created for operators.
6479 (OSB_TK, DOT_TK, THIS_TK, SUPER_TK): Tagged <operator>.
6480 (qualified_name:): Now calls make_qualified_name to build the
6482 (type_declaration:): Consider generating <clinit> when class
6484 (variable_declarator:): Directly build an assignment node when the
6485 variable is initialized when declared.
6486 (this_or_super:): Build a WFL and set current location when THIS
6487 or SUPER are parsed.
6488 (expression_statement:): Wrap statement around a WFL.
6489 (primary_no_new_array:): Fixed typo. Changed value returned by
6490 THIS_TK because of its new type (temporary).
6491 (dim_exprs:): Temporary fix because of OSB_TK's new type.
6492 (field_access:): Build qualified name with SUPER.
6493 (method_invocation:): Fixed returned value because of SUPER's new
6495 (array_access:): Use OSB_TK location information.
6496 (post_increment_expression:, post_decrement_expression:,
6497 unary_expression:, pre_increment_expression:,
6498 pre_decrement_expression:, unary_expression_not_plus_minus:,
6499 cast_expression:, multiplicative_expression:,
6500 additive_expression:, shift_expression:, relational_expression:,
6501 equality_expression:, and_expression:, exclusive_or_expression:,
6502 inclusive_or_expression:, conditional_and_expression:,
6503 conditional_or_expression:, assignment:): Use new location/token
6504 information available on operators.
6505 (create_class): Set super_decl_type to NULL_TREE when processing
6507 (register_fields): Field initialization is now a MODIFY_EXPR
6508 node. Chain initialization code to the matching lists (according
6509 the the field declaration modifiers).
6510 (maybe_generate_clinit): New function.
6511 (method_header): Don't set method's DECL_NAME to a WFL when adding
6512 methods to java.lang.Object.
6513 (resolve_and_layout): Now can return NULL_TREE if the type
6514 resolution fails. Otherwise, return the class DECL instead of its
6516 (check_method_redefinition): Don't patch method DECL_NAME if it
6517 belongs to java.lang.Object.
6518 (process_imports): Simply assign error_found to the value returned
6519 by check_pkg_class_access.
6520 (declare_local_variables): Don't use their init statements (if
6521 any) when parsing error were previously found. Reuse MODIFY_EXPR
6522 build during parsing as an init statement.
6523 (java_method_add_stmt): Now return the current method body.
6524 (java_layout_parsed_class, java_register_parsed_class): Functions
6526 (java_complete_expand_methods): Initialize the constant pool on a
6527 per class basis. Layout the classes before expanding their method
6528 bodies. Don't try expand artificial constructor code if error were
6529 found. Make the classes data and register them if no error were
6531 (java_complete_expand_method): Retrieve an artificial constructor
6532 argument list before entering its body. Assign the top block to
6533 the artificial constructor function body and set types of declared
6534 blocks and compound statements to void. Walk method body if not an
6535 artificial constructor.
6536 (make_qualified_name, cut_identifier_in_qualified): New functions.
6537 (resolve_expression_name): Fixed comments. Save/restore the
6538 current class CLASS_LOADED_P flag value. Build non qualified
6539 static field access and handle qualified expression names.
6540 (resolve_field_access, resolve_qualified_expression_name): New
6542 (patch_method_invocation_stmt): Use the new expression resolution
6543 scheme, calling resolve_field_access when the function call is
6544 resolved as an expression.
6545 (qualify_ambiguous_name): Function rewritten to work on qualified
6546 expression produced by make_qualified_name.
6547 (java_complete_tree): Promote type when function's argument are
6548 RECORD_TYPEs. While processing the MODIFY_EXPR case: don't patch
6549 the assignment to discover further errors if RHS is a expression
6550 name that fails to evaluate. Declare LHS initialized even though
6551 the assignment failed. Don't use the location variable and removed
6552 extra argument in patch function calls. Now handle the ARRAY_REF
6553 case and build internal string representation when STRING_CSTs are
6555 (build_method_invocation): Don't wrap function call around a WFL.
6556 (build_assignment): Likewise. Use the operator location
6558 (patch_assignment): Handle array access LHSs. Handle error
6559 provenance, resulting in a better error report.
6560 (build_binop): Use op_location from operator as binop location
6562 (build_unaryop, build_incdec, build_cast): Likewise.
6563 (patch_binop): Extract location information from the node. Fixed
6564 typo in error message.
6565 (patch_unary_op): Extract location information from the node.
6566 (build_array_ref, patch_array_ref): New functions.
6568 Wed Jul 1 13:11:36 1998 Tom Tromey <tromey@cygnus.com>
6570 * expr.c (expand_java_INSTANCEOF): Changed calling convention to
6571 match _Jv_IsInstanceOf.
6572 * decl.c (init_decl_processing): Use _Jv_NewArray, not
6573 soft_newarray. Use _Jv_IsInstanceOf, not soft_instanceof.
6575 Tue Jun 30 14:12:54 1998 Tom Tromey <tromey@cygnus.com>
6577 * decl.c (init_decl_processing): Functions are now named
6578 _Jv_MonitorEnter and _Jv_MonitorExit, and return jint.
6580 Mon Jun 29 14:47:10 1998 Per Bothner <bothner@cygnus.com>
6582 * java-tree.h (load_class): Add prototype.
6583 * class.c (is_compiled_class): Add missing arg to load_class.
6584 * expr.c (expand_java_NEW): Call load_class.
6585 * parse.y (process_import): Removed bogus use of void return value.
6587 Thu Jun 25 11:50:48 1998 Per Bothner <bothner@cygnus.com>
6589 * decl.c, java-tree.h (soft_athrow_node): Renamed to soft_node.
6590 Function name is "_Jv_Throw" instead of "soft_athrow".
6591 * decl.c, java-tree.h (soft_new_node): Renamed to alloc_object_node.
6592 Function name is "_Jv_AllocObject" instead of "soft_new".
6593 Takes an extra parameter (object size).
6594 * expr.c: Update calls.
6596 Wed Jun 24 13:59:02 1998 Per Bothner <bothner@cygnus.com>
6598 * lex.c (java_get_line_col): Handle end-of-file.
6599 * except.c (expand_end_java_handler): Handle null type (i.e. finally).
6601 Wed Jun 24 09:22:34 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
6603 * lang.c (lang_init): Make -fexceptions the default.
6604 * except.c (maybe_start_try, maybe_end_try): Don't do anything if
6605 exception handling is not turned on.
6607 Tue Jun 23 10:17:09 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
6609 * lang.c (flag_new_exceptions): Make this this default.
6610 * decl.c (end_java_method): Call emit_handlers.
6611 * except.c (method_init_exceptions): Set language code and version.
6612 (expand_start_java_handler): Enable exception, and call
6613 expand_eh_region_start.
6614 (expand_end_java_handler): Enable exception, and set up catch blocks.
6615 (emit_handlers): New routine to generate the saved handlers.
6616 * java-except.h (emit_handlers): Add prototype.
6618 Fri Jun 12 11:31:24 1998 Per Bothner <bothner@cygnus.com>
6620 We used to have three different representations of the constant pool:
6621 the CPool structure, the tree_constant_pool, and the constructures
6622 used to build the Class object (which may need class and string
6623 constants) in compiled code. None were appropriate for compiling
6624 to .class files, so I did a major overhaul.
6626 First, the tree_constant_pool array was removed. Things were
6627 modified to the CPool structure in the JCF could be used.
6628 Second, a "capacity" field was added to the CPool, and functions
6629 written to search for a matching constant, adding one if not found.
6630 The code that generated the Class object was changed to use a CPool.
6631 The actual TREE_LISTs used to build the CONSTRUCTORs used for
6632 the static Class object are now only in build_constants_constructor.
6633 Finally, I wrote code which can generate a .class file (including its
6634 constant pool) from the RECORD_TYPE of a class. This is a big step
6635 on the way to compiling Java source into .class files.
6637 * jcf-write.c: New file. Writes out a RECORD_TYPE as a .class file.
6638 * Makefile.in (JAVA_OBJS): Added jcf-write.o.
6640 * java-tree.h (CPOOL_UTF, CONSTANT_ResolvedFlag,
6641 CONSTANT_ResolvedString, CONSTANT_ResolvedClass): New macros.
6642 (NAME_AND_TYPE_NAME, NAME_AND_TYPE_SIGNATURE, COMPONENT_REF_NAME,
6643 COMPONENT_REF_NAME_AND_TYPE, COMPONENT_REF_SIGNATURE): Redefined.
6644 (COMPONENT_REF_CLASS): Replaced by COMPONENT_REF_CLASS_INDEX.
6645 (lang_type): Removed constant_pool field.
6646 * jcf.h (CPool): Renamed size to count. Added field capacity.
6647 (CPOO_COUNT, CPOOL_UINT, CPOOL_USHORT1, CPOOL_USHORT2,
6648 CPOOL_FINISH, CPOOL_INIT, CPOOL_REINIT): New macros.
6649 Rewrite some of the old JCF_XXX in terms of CPOOL_XXX macros.
6651 * constants.c (current_constant_pool_tags, current_constant_pool_data,
6652 current_constant_pool_length), java-tree.h: Replaced by outgoing_cpool.
6653 * constants.c (build_constants_constructor): Use new outgoing_cpool.
6654 (set_constant_entry, find_constant1, find_constant2,
6655 find_class_constant, count_constant_pool_bytes, write_constant_pool,
6656 find_utf8_constant, find_class_or_string_constant): New functions.
6658 * jcf-parse.c (load_class): Don't save/restore tree-constant_pool.
6659 (get_constant): Use current_jcf.cpool instead of tree_constant_pool.
6660 (give_name_to_class, get_class_constant): Likewise.
6661 * jcf-parse.c, java-tree.h (tree_constant_pool): Removed.
6662 (get_name_and_type_constant, get_ref_constant): Removed.
6663 * parse.h (parser_ctxt): Remove field tree_constant_pool.
6664 * parse.y: Don't save/restore tree_constant_pool.
6665 * verify.c (verify_jvm_instructions): Update for new approach.
6666 * expr.c (expand_invoke, expand_java_field_op): Likewise.
6668 * lang-options.h: Added -femit-class-file, -femit-class-files.
6669 * lang.c (flag_emit_class_files), java-tree.h: New flag.
6670 (lang_f_options): Added "emit-class-file(s)".
6672 * expr.c (build_java_arrayaccess): Generate more efficient array
6673 bounds checking, by using unsigned compare.
6675 * expr.c (expand_invoke): Re-arrange error checks to make more robust.
6677 Wed Jun 10 17:34:42 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6679 * parse.h: New comment on the handling of unresolved type
6680 identifiers. JDEPs are now part of the jdep_code enum.
6681 (typedef struct jdep): Now use enum jdep_code or int, depending on
6682 availability. Both are narrowed down to an 8 bits bitfield.
6683 (CALL_EXPR_PRIMARY): Fixed comment.
6685 Wed Jun 10 10:54:39 1998 Tom Tromey <tromey@cygnus.com>
6687 * Make-lang.in (java): Added gjavac and jvgenmain.
6688 (java.start.encap): Depend on gjavac.
6689 (java.rest.encap): Depend on jvgenmain.
6691 * Make-lang.in (JAVA_INSTALL_NAME): Name is gjavac, not c++.
6692 (JAVA_CROSS_NAME): Likewise.
6693 (java.all.build): Depend on jvgenmain and gjavac.
6694 (java.all.cross): Depend on jvgenmain and gjavac-cross.
6695 (jvgenmain$(exeext)): New target.
6696 (java.install-common): Wrote.
6697 * config-lang.in (compilers, stagestuff): Added gjavac and
6700 Wed Jun 10 12:19:04 1998 Dave Brolley <brolley@cygnus.com>
6702 * lang.c (lang_decode_option): New argc/argv interface.
6704 Tue Jun 9 18:12:46 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6706 * ChangeLog: Fixed entries not compliant with the Gnu Coding Standard.
6707 * decl.c (build_decl_no_layout): New function.
6708 * expr.c (java_lang_expand_expr): Layout declarations found in
6709 blocks before they're pushed.
6710 * jcf-parse.c (load_class): Save current line when parsing class
6712 (parse_source_file): Register class before expanding their
6714 * lang.c (put_decl_node): Produce `null' when `void *' is
6716 * lex.c (static tree wfl_op): New static global, for error report
6718 (java_init_lex): wfl_operator and wfl_op initialized
6719 here. Filename caching added for wfl_op. Return wfl_op when `(' is
6721 * parse.h (build_unaryop, build_incdec, patch_unaryop, build_cast,
6722 patch_cast, valid_ref_assignconv_cast_p, can_cast_to_p,
6723 build_unresolved_array_type): New static function definitions.
6724 (build_decl_no_layout): New extern function declared.
6725 (OBSOLETE_MODIFIER_WARNING): Report error only if the WFL of the
6726 faulty modifier exists.
6727 (TYPE_INTERFACE_P, TYPE_CLASS_P): New macros.
6728 (ERROR_CAST_NEEDED_TO_INTEGRAL): Error message tuned.
6729 (UNARY_PLUS_EXPR): New fake operator.
6730 (struct parser_ctxt): New field osb_number.
6731 * parse.y (static tree wfl_operator): New static WFL for operator
6732 bound error messages.
6733 (DECR_TK, INCR_TK): Moved.
6734 (OP_TK): Tagged <operator>.
6735 (array_type:): Now call build_unresolved_array_type.
6736 (dim_expr:): Count the number of '[' seen.
6737 (post_increment_expression, post_decrement_expression,
6738 pre_increment_expression, pre_decrement_expression,
6739 unary_expression_not_plus_minus, unary_expression:): Actions are
6740 now building the corresponding unary expressions.
6741 (cast_expression:): Actions are now building cast expressions.
6742 (build_unresolved_array_type): New function.
6743 (create_interface): Reset the number of declared interfaces.
6744 (create_class): Likewise.
6745 (method_header): Methods declared within the scope of an interface
6746 are now implicitly set public and abstract.
6747 (java_complete_class): Variable's and parameter's type are patched
6748 with a promoted type.
6749 (declare_local_variables): Resolved non builtin types are promoted
6750 before being used to build a variable decl. Removed type patch
6751 posted on variable initialization statement.
6752 (source_start_java_method): Use build_decl_no_layout to build the
6753 decl of a parameter of incomplete type.
6754 (java_register_parsed_class): Process interfaces too. Call
6755 rest_of_decl_compilation on each processed class declarations.
6756 (java_complete_expand_methods): Don't attempt to expand things in
6758 (java_complete_tree): Process CONVERT_EXPR, even though it always
6759 has a type. Propagate error_mark_node to node's type too. Promote
6760 method's call argument type and return error_mark_node if
6761 argument's completion didn't work. MODIFY_EXPR can have a WFL as a
6762 RHS. Fixed bug in the handling of bogus RHS of a fixed type. Now
6763 handle unary operator nodes.
6764 (build_assignment): Added comment.
6765 (print_int_node): New function.
6766 (patch_assignment): New second argument. New error handling. Use
6767 print_int_node. Handle references. Use can_cast_to_p to issue
6768 different error message according to the context and check upon
6769 the initialization of the RHS.
6770 (can_cast_to_p, valid_ref_assignconv_cast_p): New functions.
6771 (operator_string): Handle more operators.
6772 (patch_binop): No longer use a function static
6773 wfl_operator. Improved error message on shift distance.
6774 (build_unaryop, build_incdec, build_cast, patch_unaryop,
6775 patch_cast): New functions.
6777 Fri Jun 5 18:03:07 1998 Per Bothner <bothner@cygnus.com>
6779 * jvspec.c: New file.
6780 * Make-lang.in: New rules to build gjavac from jvspec.c and ../gcc.c.
6782 * java-tree.h (identifier_subst): Add declaration.
6784 Thu Jun 4 13:44:23 1998 Tom Tromey <tromey@cygnus.com>
6786 * jvgenmain.c (main): Generate call to JvRunMain.
6788 * class.c (make_class_data): Push value for "sync_info" field.
6789 * decl.c (init_decl_processing): Push "sync_info" field.
6791 Wed Jun 3 20:39:14 1998 Per Bothner <bothner@cygnus.com>
6793 * typeck.c (build_java_array_type): Set TYPE_NAME to actual
6794 Java (source) name, not signature.
6795 Set TYPE_ALIGN to (at least) that of element_type.
6797 Tue Jun 2 15:19:19 1998 Per Bothner <bothner@cygnus.com>
6799 * class.c: Moved classname-mangling-rekated code to ...
6800 * mangle.c: ... this new file.
6801 * jvgenmain.c: New program (needs mangle.c) to generate main program.
6802 * Makefile.in: Update for above changes.
6804 Mon Jun 1 09:58:36 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6806 * expr.c (truthvalue_conversion): Convert integer and floating
6807 point value to their truth value.
6808 * lex.c (java_lex): Handle the `null' literal.
6809 * parse.h (JREFERENCE_TYPE_P, DECL_P): New macros.
6810 (ERROR_CANT_CONVERT_TO_BOOLEAN, ERROR_CANT_CONVERT_TO_NUMERIC,
6811 ERROR_CAST_NEEDED_TO_INTEGRAL, ERROR_VARIABLE_NOT_INITIALIZED):
6814 * parse.y: Reorganization/documentation on token declaration.
6815 (binop_lookup[]): New added new tree codes.
6816 (relational_expression): Build corresponding binary operators.
6817 (equality_expression, conditional_and_expression,
6818 conditional_or_expression): Likewise.
6819 (java_complete_class): Fix crash in debug message.
6820 (java_complete_tree): Check initialization of method call
6821 arguments. Further bogus node evaluation to detect more error
6822 during assignments. Handles more binary operators.
6823 (patch_assignment): Use DECL_P.
6824 (build_binop): Fix crash when using URSHIFT_EXPR, a Java only tree
6826 (operator_string): Handle more case. Compacted source.
6827 (patch_binop): Changed function comment. Checking for
6828 uninitialized first operand takes the compound assignment into
6829 account and uses DECL_P. Checking for uninitialized second operand
6830 delayed to routine's end. Use macros to issue type bound error
6831 messages and issue messages on both operands if their types are
6832 different. Force fixed type into node. Handle all binary
6835 Wed May 27 10:30:31 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6837 * java-tree.h (COMPOUND_ASSIGN_P, INITIALIZED_P): New macros.
6838 * lex.c (java_lex): Use BUILD_OPERATOR and BUILD_OPERATOR2 to
6839 build operator node and return tokens.
6840 * lex.h (BUILD_OPERATOR, BUILD_OPERATOR2): New macros.
6841 * parse.h (java_complete_tree): Changed returned type in prototype.
6842 (build_method_invocation, build_assignment, patch_assignment,
6843 patch_binop): New static function declarations.
6844 (JFLOAT_TYPE_P, JNUMERIC_TYPE_P, JPRIMITIVE_TYPE_P, JSTRING_P,
6845 BUILD_EXPR_WFL): New macros.
6846 * parse.y (enum tree_code binop_lookup[]): New static for token to
6848 (%union): Parser union has new sub-structure `operator'.
6849 (ASSIGN_TK, MULT_ASSIGN_TK, DIV_ASSIGN_TK, REM_ASSIGN_TK,
6850 PLUS_ASSIGN_TK, MINUS_ASSIGN_TK, LS_ASSIGN_TK, SRS_ASSIGN_TK,
6851 ZRS_ASSIGN_TK, AND_ASSIGN_TK, XOR_ASSIGN_TK, OR_ASSIGN_TK,
6852 ASSIGN_ANY_TK): Tokens tagged `operator'.
6853 (EQ_TK, GTE_TK, ZRS_TK, SRS_TK, GT_TK, LTE_TK, LS_TK, BOOL_AND_TK,
6854 AND_TK, BOOL_OR_TK, OR_TK, INCR_TK, PLUS_TK, DECR_TK, MINUS_TK,
6855 MULT_TK, DIV_TK, XOR_TK, REM_TK, NEQ_TK, NEG_TK, REL_QM_TK,
6856 REL_CL_TK, NOT_TK, LT_TK): Tokens tagged `operator'.
6857 (assignment_operator:): Rule tagged `operator'.
6858 (expression_statement:): Re-installed default rule.
6859 (method_invocation:): Sub rules call build_method_invocation.
6860 (postfix_expression:): Don't attempt to resolve name here. Just
6862 (multiplicative_expression:): Sub-rules build corresponding binop
6864 (additive_expression:, shift_expression:, and_expression:,
6865 exclusive_or_expression:, inclusive_or_expression:): Likewise.
6866 (assignment:): Sub rule invoke build_assignment.
6867 (assignment_operator:): Default rules on sub rules.
6868 (force_error): Added documentation on this variable.
6869 (declare_local_variables): Build initialization calling
6871 (expand_start_java_method): Removed unused rtx declaration. Mark
6872 arguments as already initialized.
6873 (java_method_add_stmt): Type of built COMPOUND_EXPR set to NULL.
6874 (java_complete_expand_methods): Don't process next method if
6875 completion of the previous one triggered errors.
6876 (java_complete_expand_method): Call source_end_java_method if no
6877 error were found during completion.
6878 (resolve_expression_name): Use IDENTIFIER_LOCAL_VALUE to retrieve
6879 locals declaratilon. Handle names found within a class. Return
6880 error_mark_node when things aren't found.
6881 (patch_method_invocation_stmt): Return error_mark_node on failures.
6882 (patch_invoke): Removed unused local. Return the correct node.
6883 (java_complete_tree): Now returns a value. The BLOCK section binds
6884 local identifiers and the type of a BLOCK is now void. Assign the
6885 result of operand completion on COMPOUND_EXPR. Assign the
6886 encapsulated node of a WFL to the result of its completion, except
6887 when the node is an identifier. Now handle MODIFY_EXPR and several
6888 binary operators. Return error_mark_node on errors.
6889 (build_method_invocation, build_assignment, patch_assignment,
6890 build_binop, operator_string, patch_binop): New functions.
6891 * typeck.c (binary_numeric_promotion): New function.
6893 Thu May 21 12:01:04 1998 Per Bothner <bothner@cygnus.com>
6895 * class.c (identifier_subst): New convenience wrapper for ident_subst.
6896 Replace most uses of ident_subst by identifier_subst.
6898 * class.c (push_class_static_dummy_field): Removed function.
6899 (build_class_ref): Find Class object decl by looking up "CNAME.class",
6900 instead of looking got "class" static field. Create that decl here.
6901 (class_identifier_node): Removed; no longer needed.
6902 (init_class_processing): Don't init class_identifier_node.
6903 * jcf-parse.c (jcf_parse): Don't call push_class_static_dummy_field.
6904 Do nreverse 0 times (instead of twice) for Object and Class.
6905 * parse.y (java_layout_parsed_class): No push_class_static_dummy_field.
6907 Wed May 20 16:35:04 1998 Per Bothner <bothner@cygnus.com>
6909 * jcf-parse.c (parse_class-file): Set lino to smallest line number,
6910 while initializing linenumber_count and linenumber_table.
6911 Do it before init_function_start (which calls emit_line_note).
6912 * expr.c (expand_byte_code): Don't need to clear lineno here.
6914 Mon May 18 16:23:32 1998 Tom Tromey <tromey@cygnus.com>
6916 * class.c (append_gpp_mangled_type): If `qualifications' is >=9,
6917 then mangle number as _N_.
6919 * class.c (mangle_class_field): New function.
6920 (build_class_ref): Set assembler name of class reference using
6922 (push_class_static_dummy_field): Likewise.
6924 Sun May 17 12:52:35 1998 Michael Tiemann <tiemann@cygnus.com>
6926 * parse.y (source_start_java_method): Use TREE_SET_CODE instead
6927 of assigning to TREE_CODE. The latter method exploits a feature
6928 of GCC that is not ANSI compliant.
6930 Thu May 12 13:44:27 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
6932 * decl.c (pushdecl_force_head): New function.
6933 (pushlevel): Removed conditional printf.
6934 (complete_start_java_method): Don't enter local variable scope if
6935 function is compiled from source code.
6936 * expr.c: parse.h now included
6937 (java_lang_expand_expr): New function.
6938 * jcf-io.c (find_class): Use SOURCE_FRONTEND_DEBUG instead of
6939 printf. Terminate buffer when doing directories.
6940 * jcf-parse.c (parse_source_file): Call lang_init_source before
6941 parsing and before code generation.
6942 * jcf.h (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally
6943 use printf if the macro is defined.
6944 * lang.c (lang_init): Install lang_expand_expr hook on
6945 java_lang_expand_expr.
6946 (java_dummy_print): New function.
6947 (lang_init_source): New function.
6948 * lex.c (java_lex): Remember location of an opening brace at the
6949 second nesting level.
6950 (java_is_eol): Unget character seen after a CR if it is EOF.
6951 * parse.h: Now includes lex.h
6952 (SOURCE_FRONTEND_DEBUG): Macro redefined to conditionally use
6953 printf if the macro is defined.
6954 (expand_start_java_method, build_expr_block, enter_block,
6955 exit_block, lookup_name_in_blocks, maybe_absorb_scoping_blocks):
6956 New static function declarations.
6957 (pushdecl_force_head): New extern function declaration.
6958 (INCOMPLETE_TYPE_P): New macro.
6959 (JDEP_PARM, JDEP_TYPE): New entries in JDEPs enum.
6960 (BLOCK_CHAIN_DECL, BLOCK_EXPR_DECLS, BLOCK_EXPR_BODY,
6961 BLOCK_EXPR_ORIGIN): New macros.
6962 (DECL_SOURCE_LINE_MERGE, DECL_SOURCE_LINE_FIRST,
6963 DECL_SOURCE_LINE_LAST): New macros.
6964 (struct parser_ctxt): Removed field current_method_decl, redundant
6965 with the field current_function_decl. Added fields
6966 first_ccb_indent1 and pending_block.
6967 * parse.y (method_body, literal, INT_LIT_TK, FP_LIT_TK,
6968 BOOL_LIT_TK, CHAR_LIT_TK, STRING_LIT_TK, NULL_TK, VOID_TK): Rules
6970 (SOURCE_FRONTEND_DEBUG): Used as macro accepting varargs.
6971 (compilation_unit:): Cosmetic on sub rule.
6972 (type_declaration:): Cosmetic on sub rules. Added an error rule.
6973 (variable_initializer:): Installed default rule on expression:.
6974 (method_declaration:): method_header: starts a new
6975 method. method_body: installs the function body, absorbs blocks
6976 emitted for temporary variable scopings, pops function's body block
6977 and merges function's last statement lineno in DECL_SOURCE_LINE.
6978 (method_body:): Installed default rules.
6979 (block:): Call enter_block when an opening brace is seen. Absorb
6980 scoping blocks and call exit_block when a closing brace is seen.
6981 (block_statement:): Cosmetic changes.
6982 (method_invocation:): Create WFL around CALL_EXPR node.
6983 (patch_stage): Added comment around definition.
6984 (method_header): Try to use first_ccb_indent1 as the first line of
6985 the method, so BP debug info are emitted at the first opening
6986 brace of the function. If the function has no body, use the
6987 location of the function's name. Override currently defined method
6988 name with the matching WFL so we can point redefinition errors
6989 using the location where the function's name was declared.
6990 (check_abstract_method_header): Interprets DECL_NAME as an
6991 identifier or as a WFL, accordingly.
6992 (java_complete_class): New cases for JDEP_TYPE and JDEP_PARM.
6993 (check_method_redefinition): Use DECL_NAME as a WFL. Extract
6994 location and name information out of it and reinstall DECL_NAME to
6995 its original identifier node value.
6996 (lookup_cl): Use DECL_SOURCE_LINE_FIRST (first line of the
6997 function's source code).
6998 (read_import_dir): Test the value returned by find_class and issue
6999 a fatal accordingly.
7000 (declare_local_variables): Push a new block for the scope of the
7001 new variable(s) if code has been already generated at that nesting
7002 level. Pinpoint redefinition errors using the variable id
7003 WFLs. Generate initialization code if necessary. If the variable
7004 type is incomplete, register a patch on its decl.
7005 (source_start_java_method): Rewritten. Define a new block for the
7006 function's parameters. Build parameter decl out of function's
7007 arguments and register them for a patch if their types are
7009 (expand_start_java_method): Includes the part of
7010 source_start_java_method that was pushing the parameter decls and
7011 completing the method start code.
7012 (source_end_java_method): Removed call the expand_end_bindings and
7013 poplevel (already taken care of). Reinstall function's arguments
7014 and get function's last line of code before calling
7015 expand_function_end.
7016 (java_method_add_stmt): New comment before the function's
7017 code. Complement the second operand of the current COMPOUND_EXPR
7019 (java_complete_expand_methods): Don't generate debug info on line
7020 zero when expanding a generated constructor.
7021 (java_complete_expand_method): Set start and end line numbers for
7022 a artificially generated constructor to one and manually call
7023 enter_block and exit_block when defining it. For all methods:
7024 expand function's start calling the new expand_start_java_method
7025 and invoke java_complete_tree on the effective method's body, if
7027 (resolve_expression_name): Now use lookup_name_in_blocks to search
7028 local variable decls and print out an error when variables are
7030 (patch_method_invocation_stmt): Inserted comment before the
7032 (lookup_method_invoke): Chain method's arguments using chainon
7033 with the current arg list as a second argument. Inserted missing
7034 IDENTIFIER_POINTER when reporting an error on methods not found.
7035 (refine_accessible_methods_list): Don't retain constructors.
7036 (patch_arguments): Function removed.
7037 (java_complete_tree): Inserted comment before the function's
7038 code. New case for BLOCKs. Moved the WFL case a bit
7039 further. Complete function's arguments.
7040 (build_expr_block, enter_block, exit_block, lookup_name_in_blocks,
7041 maybe_absorb_scoping_blocks): New functions.
7043 Mon Apr 27 10:50:05 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7045 * jcf-io.c (find_class): Reset jcf->java_source after JCF_ZERO, if
7047 * jcf-parse.c (parse_source_file, java_error_count): New forward
7048 and extern declarations.
7049 (java_parse_abort_on_error): Macro moved.
7050 (jcf_parse_source): fatal called if fopen fails. Now calls
7052 (parse_source_file): New parse_only parameter. Reflects the
7053 elimination of the second pass.
7054 (yyparse): parse_source_file called with argument set to 0.
7055 * jcf.h (JCF_ZERO): Sets java_source to zero.
7056 * lex.c (java_init_lex): pass argument is gone. Function modified
7057 to be called once during the analysis of a file.
7058 (java_unget_unicode): Fixed typo in fatal message.
7059 (java_get_line_col): Likewise.
7060 (java_lval): Likewise. String literals no longer built during
7062 * lex.h (JAVA_COLUMN_DELTA): Take the tabulation character into
7064 * parse.h (MODIFIER_WFL): New macro.
7065 (parse_check_super, parser_check_super_interface): Now return int.
7066 (parser_chain_incomplete_item, not_builtin_p,
7067 complete_method_decl): Declarations removed.
7068 (build_method_invocation_stmt, build_invoke): Renamed using the
7069 `patch' instead of `build'
7070 (register-incomplete_type, obtain_incomplete_type,
7071 java_complete_tree, java_complete_expand_method,
7072 unresolved_type_p, create_jdep_list): New function declarations.
7073 (IC_TYPE, IC_DEPEND, DEPEND_DECL, DEPEND_WFL, BEGIN_ONLY_PASS,
7074 END_ONLY_PASS, ELSE_ONLY_PASS): Macro deleted.
7075 (jdep): New typedef on new struct _jdep.
7076 (JDEP_DECL, JDEP_DECL_WFL, JDEP_KIND, JDEP_SOLV, JDEP_WFL,
7077 JDEP_MISC, JDEP_APPLY_PATCH, JDEP_GET_PATCH, JDEP_CHAIN,
7078 JDEP_TO_REVOLVE, JDEP_RESOLVED_DECL, JDEP_RESOLVED,
7079 JDEP_RESOLVED_P): New macros.
7080 (JDEP_NO_PATCH, JDEP_SUPER, JDEP_FIELD, JDEP_METHOD,
7081 JDEP_METHOD_RETURN, JDEP_METHOD_END, JDEP_INTERFACE,
7082 JDEP_VARIABLE): New enum values and jdep kinds.
7083 (jdeplist): New typedef on struct _jdeplist.
7084 (CLASSD_FIRST, CLASSD_LAST, CLASSD_CHAIN, JDEP_INSERT): New
7086 (CALL_EXPR_PRIMARY): New macro.
7087 (struct parser_ctxt): Fields java_pass, current_method_decl,
7088 method_decl_list deleted. New field jdeplist.
7089 (INCOMPLETE_P): Macro deleted.
7090 * parse.y (single_type_import_declaration:): Removed pass switch.
7091 (type_import_on_demand_declaration): Likewise.
7092 (field_declaration:): Removed pass switch on all sub rules.
7093 (class_declaration:): Call the complete_class_decl removed on
7095 (method_declaration:): Removed second pass switch. No longer chain
7096 methods decl when method_header reduced.
7097 (method_header:): Sub rules no longer depend on pass switch.
7098 (method_declarator:): Likewise.
7099 (method_body:): Likewise.
7100 (abstract_method_declaration:): Likewise.
7101 (block_statement:): Likewise.
7102 (local_variable_declaration:): Likewise.
7103 (argument_list:): Likewise.
7104 (method_invocation:): Likewise. Call to build_method_invocation_stmt
7105 removed. Partial CLASS_EXPR tree node built instead.
7106 (postfix_expression:): Removed pass switch on all sub rules.
7107 (java_pop_parser_context): Free classd_list content.
7108 (yyerror): Call obstrack_grow0 to finalize error message.
7109 (check_class_interface_creation): Comment modified to reflect new
7110 returned value meaning. Removed second pass switch. Return 1 if an
7111 error was found, 0 otherwise. Adjust pointer on filename if a
7112 leading path separator was found.
7113 (maybe_create_class_interface_decl): Removed first pass switch
7114 when linking the class decl to the class_list. Install a new
7115 jdep_list for the class.
7116 (add_superinterfaces): List of unresolved interfaces is
7117 gone. Unresolved interfaces are directly added to the current
7119 (create_interface): Second pass shortcut removed.
7120 ctpx->modifier_ctx access through MODIFIER_WFL.
7121 (create_class): Second pass shortcut removed. Call to
7122 register_incomplete_type replaces the call to
7123 parser_chain_incomplete_item.
7124 (complete_class_decl): Function removed.
7125 (duplicate_declaration_error): New way of retrieving redeclared
7127 (register_fields): Call to lookup_modifier_cl replaced by
7128 MODIFIER_WFL. New way of handling unresolved type, using
7129 unresolved_type_p and obtain_incomplete_type.
7130 register_incomplete_type replaces call to parser_chain_incomplete_item.
7131 (patch_stage): New static global variable.
7132 (method_header): New way of handling unresolved type, using
7133 unresolved_type_p and obtain_incomplete_type. patch_stage used to
7134 indicates that the method decl needs to be patched.
7135 (check_abstract_method_header): Call to lookup_modifier_cl
7136 replaced by MODIFIER_WFL.
7137 (method_declarator): Incomplete argument type are registered
7138 calling register_incomplete_type. Patch on the declared method is
7139 issued in that case.
7140 (unresolved_type_p): New function.
7141 (parser_check_super_interface): New comment to reflect function's
7142 modified returned type (int). Function and has a new argument
7143 this_wfl. Call to parse_error_context uses this_wfl instead of
7144 relying on lookup_cl.
7145 (parser_check_super): Comment reflects function's new returned
7146 type (int). Function returns non zero value on error.
7147 (create_jdep_list, reverse_jdep_list, obtain_incomplete_type,
7148 register_incomplete_type, jdep_resolve_class): New functions to
7149 handle incomplete types in declarations.
7150 (java_complete_class): Rewritten to work with the new incomplete
7151 type handling scheme.
7152 (complete_class_report_errors): Likewise.
7153 (complete_method_decl): Removed: it jobs is now handled by
7154 java_complete_class.
7155 (do_resolve_class): Class loaded in not already loaded and not
7156 found in Java source code.
7157 (java_check_regular_methods, java_check_abstract_methods): Don't
7158 call complete_method_decl anymore.
7159 (lookup_modifier_cl, not_builtin_p): Functions deleted.
7160 (read_import_dir): Got rid of the pass number dependency.
7161 (declare_local_variables): New handling of unresolved types (patch
7163 (source_start_java_method): New parameter level. Function called
7164 with level set to 1 when argument types are potentially
7165 unresolved. Called to complete the job with level set to 2 once
7167 (source_end_java_method): Call to permanent_allocation
7168 removed. Waiting to be replaced by a more suitable obstack
7170 (java_complete_expand_methods, java_complete_expand_method,
7171 java_expand_finals): New functions.
7172 (build_method_invocation_stmt): Renamed
7173 patch_method_invocation_stmt. Extracts function call expression
7174 (wfl) and arguments (args) from CALL_EXPR tree operands.
7175 (build_invoke): Renamed patch_invoke. Fixed typo in fatal
7176 call. Patch the function and argument operand of the CALL_EXPR
7178 (patch_argument, java_complete_tree): New functions.
7180 Mon Apr 20 18:26:57 1998 Per Bothner <bothner@cygnus.com>
7182 Recover from missing fields and methods (i.e. error instead of fatal).
7183 * decl.c, java-tree.h (TYPE_identifier_node): New global constant.
7184 * expr.c (expand_invoke): Recover from missing method.
7185 (expand_java_field_op): Recover from missing field.
7186 Inline references to java.lang.{Integer,Char,...}.TYPE.
7187 * typeck.c (get_type_from_signature), java-tree.h: New function.
7188 * class.c (add_method): Use get_type_from_signature.
7189 (build_class_ref): Handle a class that was not found.
7190 * typeck.c (convert): Handle conversion to pointers (for convenience).
7191 * verify.c (verify_jvm_instructions): Use get_type_from_signature
7192 instead of lookup_field to handle missing fields.
7194 * jcf-parse.c (process_zip_dir): Set java_source.
7196 1998-04-20 Brendan Kehoe <brendan@cygnus.com>
7198 * jcf-parse.c (set_source_filename): Use TYPE_NAME, not DECL_NAME.
7200 Tue Apr 14 15:59:54 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7202 * jcf-parse.c (load_class): Don't change input_filename before
7203 calling jcf_parse_source (but still do it before calling
7205 (jcf_parse_source): Assign input_filename after having saved the
7207 * lex.c (java_init_lex): Chain a WFL node to the import on demand
7208 list. ctxp->modifier_ctx zeroed according to its new
7209 definition. ctxp->filename initialized. Removed
7210 JAVA_MODIFIER_CTX_UNMARK.
7211 (java_unget_unicode): Update the character based column position.
7212 (java_allocate_new_line): ref_count not used anymore. Always free
7213 ctxp->p_line. Initialize c_line->char_col to 0.
7214 (java_get_unicode): Update the character based column position.
7215 (java_lex): Use ctxp->elc to store current position in source
7216 file, at the beginning of the parsed token. Set modifier_ctx entry
7217 corresponding to the parse modifier to a WFL node. Return a WFL
7218 node when an identifier is parsed.
7219 (java_lex_error): Now uses ctxp->elc to store current position in
7221 (build_wfl_node, java_is_eol, java_get_line_col): New functions.
7222 * lex.h (build_wfl_node): New function definitions.
7223 (struct java_line): ref_count and next fields are gone. New field
7225 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
7226 JAVA_LINE_UNMARK, ID_NAME, ID_CL): Macro definitions deleted.
7227 (JAVA_COLUMN_DELTA): New macro.
7228 (java_lc): New typedef on new struct _java_lc.
7229 * parse.h (lookup_cl, lookup_modifier_cl): Changed returned types.
7230 (parse_error_context, parse_warning_context): Changed prototypes.
7231 (java_get_line_col): Added as an available global function.
7232 (JAVA_MODIFIER_CTX_UNMARK): Macro removed.
7233 (IC_DECL): Replaced by macro IC_TYPE
7234 (DEPEND_WFL): New macro.
7235 (THIS_MODIFIER_ONLY): Now works with WFL and only remembers the first
7237 (exit_java_complete_class): Removed a commented out statement.
7238 (struct parser_ctxt): Added comments on fields. modifier_ctx is
7239 now an array of tree nodes. Deleted fields line_list and
7240 e_line. New field elc, to replace e_line.
7241 * parse.y (array_type:): Build WFL node.
7242 (qualified_name:): Build a single WFL node out of two. Retain
7243 the location information of the first node in the resulting node.
7244 (package_declaration:): Use package name as a WFL node
7245 (single_type_import_declaration:): Use imported name as a WFL node.
7246 (type_import_on_demand_declaration:): Use root of the imported
7247 packages as a WFL node.
7248 (field_declaration:): Removed unused local variable cl.
7249 (method_declaration:): Don't call JAVA_MODIFIER_CTX_UNMARK.
7250 (yyerror): New static elc. Removed static error_line, error_pos.
7251 New local code_from_source. Save ctxp->elc into elc at the first
7252 pass. Call java_get_line_col to get a string of the line where
7254 (debug_line): Removed static function.
7255 (parse_error_context, parse_warning_context): Parameter cl is now
7256 a WFL node. Use its value to initialize ctxp->elc.
7257 (redefinition_error): Parameter cl is now a WFL node.
7258 (parse_add_interface): New parameter wfl. No longer call
7259 lookup_cl, use wfl instead.
7260 (check_class_interface_creation): Parameter cl is now a WFL node.
7261 (maybe_create_class_interface_decl): Likewise.
7262 (add_superinterfaces): New function.
7263 (create_interface): Removed local cl, node, super_decl,
7264 super_decl_type. Function now uses id as a WFL node. Better
7265 warning/error report on obsolete or forbidden mix of
7266 modifiers. Now calls add_superinterfaces to register interfaces.
7267 (create_class): Removed local cl, node. Local variable id is used
7268 as a WFL node. Better error report on forbidden modifier
7269 mix. Uses add_superinterfaces to register interfaces.
7270 (find_field): Argument cl is now a WFL node. Now store the WFL
7271 node of a fields that needs to be checked for their
7273 (method_header): Local variable node non longer used. Local
7274 variable id replaces cl.
7275 (check_modifiers_consistency): Local variable cl is now a WFL
7277 (method_declarator): Local variable cl replaced by parameter id.
7278 (parser_qualified_name): Now uses parameter name as a WFL node.
7279 (parser_check_super_interface): New parameter wfl, for achieve
7280 greater accuracy during error reports.
7281 (parser_chain_incomplete_item): New parameter named location. Used,
7282 along the decl, to construct the incomplete item node.
7283 (java_complete_class): resolve_class now uses WFL node extracted
7284 from the incomplete item node. Macro IC_TYPE replaces TREE_PURPOSE
7286 (complete_method_decl): Unresolved function's argument types are WFL.
7287 (resolve_class): Parameter cl is now a WFL node.
7288 (resolve_and_layout): Likewise.
7289 (do_resolve_class): Likewise. Try first to use cl and then do the
7290 lookup on the decl when calling check_pkg_class_access.
7291 (complete_class_report_errors): Use IC_TYPE in place of
7292 TREE_PURPOSE where appropriate. Use DEPEND_WFL on dependency
7293 instead of doing a lookup over the decl.
7294 (java_check_final): Use WFL info from field tree list.
7295 (lookup_cl): Rewritten and returns a statically defined WFL node.
7296 (lookup_modifier_cl): Now uses information from WFL nodes.
7297 (process_imports): Likewise.
7298 (read_import_dir): name and cl arguments replaced by a single WFL
7299 node. Function modified accordingly.
7300 (find_in_imports_on_demand): Now uses WFL node.
7301 (check_pkg_class_access): cl argument is now a WFL node.
7302 (declare_local_variables): Fixed to use WFL nodes.
7303 (resolve_expression_name): Likewise.
7304 (build_method_invocation_stmt): name_combo argument renamed
7305 wfl. Function modified to use WFL nodes.
7306 (build_invoke): cl used as a WFL node when calling build_expr_wfl.
7307 (lookup_method_invoke): cl is now a WFL node. Added missing
7308 IDENTIFIER_POINTER to class type decl name.
7310 Tue Apr 14 15:23:29 1998 Dave Brolley <brolley@cygnus.com>
7312 * lang.c (init_parse): Now returns char* containing the filename.
7314 Fri Apr 10 11:36:04 1998 Per Bothner <bothner@cygnus.com>
7316 * class.c (layout_class): Mangle repeated arg types to match cc1plus.
7318 * decl.c, java-tree.h (integer_four_node): New INTEGER_CST node.
7319 * class.c (make_class_data): If flag_assume_compiled, initial class
7320 state is CSTATE_PREPARED; make superclass and interfaces direct
7321 references, rather than constant pool indexes.
7323 Thu Apr 9 16:10:56 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7325 * parser.y: Include flags.h. Removed debug variable pl.
7326 (method_declaration:): Uses ctxp->parser_ccb_indent instead of pl.
7328 (labeled_statement_nsi:): Generate debug info when reducing
7329 expression_statement:.
7330 (check_pkg_class_access): get_access_flags_from_decl invokation
7331 fixed for new CLASS_* flags location.
7332 (source_end_java_method): Save/restore parser context when
7333 entering/leaving this routine. Restore lineno to its right value
7334 before calling expand_end_bindings.
7335 (build_method_invocation_stmt): build_invoke called with the
7336 current line information.
7337 (build_invoke): New argument cl. Wrap the function call around a
7339 (refine_accessible_methods_list): Changed comment, removed
7341 * parse.h: Fixed typo in comments.
7342 (CLASS_OR_INTERFACE): Handle the new CLASS_* flags location.
7343 (JAVA_MAYBE_GENERATE_DEBUG_INFO): New macro.
7344 (struct parser_ctxt): New fields ccb_indent, last_ccb_indent1,
7346 * lex.c (java_lex): Record the last closing curly bracket of a
7348 * jcf-parse.c (jcf_parse_source): Now calls
7349 java_check_methods. Clarified comment, fixed typo.
7351 1998-04-09 Dave Brolley <brolley@cygnus.com>
7353 * lang.c (init_parse): Expose for non USE_CPPLIB builds.
7354 (finish_parse): Expose for non USE_CPPLIB builds.
7356 Wed Apr 8 13:06:23 1998 Jeffrey A Law (law@cygnus.com)
7358 * lang.c (lang_print_xnode): New function.
7360 Fri Apr 3 13:22:41 1998 Per Bothner <bothner@cygnus.com>
7362 * decl.c (class_dtable_decl), java-tree.h: New tree node.
7363 * class.c (get_dispatch_vector, get_dispatch_table): New functions
7364 used to build a class's dispatch table.
7365 (make_class_data): Generate dispatch table if flag_assume_compiled.
7366 Set dtable of class object to address of class_dtable_decl.
7368 * decl.c (int_decl_processing): Make soft_badarrayindex_node
7369 be volatile and have side effects - generates better code.
7371 * class.c, expr.c, parse.y: CLASS_INTERFACE, CLASS_FINAL, etc:
7372 These flags were defined for TYPE_DECLs, but used on RECORD_TYPEs.
7374 * expr.c (expand_invoke): If class is final, method is
7375 effectively final, so can call it directly.
7377 * java-tree.h (TYPE_NVIRTUALS, TYPE_VTABLE): New macros.
7379 * Makefile.in, Make-lang.in: Add missing $(exeext)s.
7381 Thu Mar 19 16:59:16 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7383 * parse.y (build_method_invocation_stmt): Removed extra argument
7386 Mon Mar 16 17:25:19 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7388 * expr.c (dtable_indent): Now static global.
7389 (expand_invoke): Now call invoke_build_dtable and
7390 build_invokevirtual.
7391 (invoke_build_dtable, build_invokevirtual): New functions.
7392 * jcf-io.c (find_class): Defer issuing a warning by setting
7393 jcf->outofsynch to 1.
7394 * jcf-parse.c (jcf_out_of_synch): New function.
7395 (load_class): Test this_jcf.outofsynch flag and call
7396 jcf_out_of_synch accordingly.
7397 * jcf.h: (typedef struct JCF): New flag outofsynch. Fixed typo in
7398 comment indentation.
7399 * lex.c (java_get_unicode): Fixed code indentation.
7400 (java_lex): Create string literal. Fixed typo. Removed several
7401 premature obstack_free.
7402 * parse.h: New enums for name resolution and invocation mode.
7403 (struct qualification): New data structure.
7404 (RESOLVE_CHAIN_REMAINDER, BUILD_PTR_FROM_NAME): New macros.
7405 (do_resolve_class, build_method_invocation_stmt,
7406 breakdown_qualified, qualify_ambiguous_name, resolve_and_layout,
7407 debug_line, identical_subpath_p, invocation_mode,
7408 refine_accessible_methods_list, build_invoke,
7409 lookup_method_invoke): New functions declared.
7410 (build_invokevirtual, invoke_build_dtable, match_java_method,
7411 build_field_ref, jcf_out_of_synch): New references to external
7413 (struct parse_ctxt): Removed artificial_constructor field.
7414 * parse.y: (array_type:): Type defined for this rule.
7415 (class_type:): Installed default rule for interface_type:.
7416 (array_type:): Now build Java array type.
7417 (qualified_name:): Now use obstack_grow0.
7418 (method_declaration:): Skip the artificial constructor added to
7420 (abstract_method_declaration:): Execute the code only during pass 1.
7421 (block:): Installed default rule in block_statements:.
7422 (block_statement:): Add the statement to the method during pass 2.
7423 (statement_expression): Installed default rule for
7425 (argument_list:): Added code to build the argument list.
7426 (method_invocation:): Added call to create the method invocation
7428 (yyerror): Now use obstack_grow0. Removed bogus obstack_free.
7429 (debug_line): New function for debug.
7430 (complete_class_decl): No longer do something during pass 1.
7431 (method_header): Use BUILD_PTR_FROM_NAME.
7432 (parser_qualified_classname): Use obstack_grow0. Removed bogus
7434 (parser_chain_incomplete_item): Use BUILD_PTR_FROM_NAME. Modified
7435 function's main comment.
7436 (java_complete_class): Set CLASS_LOADED_P on all fixed incomplete
7438 (complete_method_decl): Use BUILD_PTR_FROM_NAME and promote types.
7439 (resolve_class): Now works with arrays.
7440 (do_resolve_class, resolve_and_layout): New functions.
7441 (java_check_regular_methods): Reverse method list before and after
7442 having processed it. No longer set ctxp->artificial_constructor.
7443 (read_import_dir): Test jcf->outofsynch and call jcf_out_of_synch
7444 accordingly. Fixed typo in issued error message. Now use
7446 (find_in_imports_on_demand): Now use obstack_grow0.
7447 (declare_local_variables): Use BUILD_PTR_FROM_NAME.
7448 (source_end_java_method): Call expand_expr_stmt instead of
7449 expand_expr. Calls it before calling expand_function_end.
7450 (java_method_add_stmt): Do nothing if errors were found during
7452 (java_layout_parsed_class): Set CLASS_LOADED_P and fixed typo.
7453 (build_method_invocation_stmt, build_invoke, invocation_mode,
7454 lookup_method_invoke, refine_accessible_methods_list,
7455 qualify_ambiguous_name, breakdown_qualified, identical_subpath_p):
7457 * typeck.c (build_java_signature): Properly end method signature
7458 if return type skipped.
7459 (match_java_method): New function.
7461 Mon Mar 16 10:40:47 1998 Per Bothner <bothner@cygnus.com>
7463 * jcf-io.c (find_classfile): If USE_JCF_STDIO, fopen in binary mode.
7465 Wed Feb 25 08:55:49 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7467 * expr.c (build_invoke_non_interface): New function.
7468 (methods_ident, ncode_ident): Now static globals.
7469 (expand_invoke): Use build_invoke_non_interface.
7470 * java-tree.h (struct lang_decl): New field function_decl_body.
7471 (DECL_FUNCTION_BODY): New macro.
7472 * jcf-parse.c (jcf_parse_source): Deeper check before setting
7473 CLASS_FROM_SOURCE_P.
7474 (parse_source_file): Fixed typos. Call java_layout_parsed_class
7475 before starting pass 2. Call to java_generate_parsed_class replaced
7476 by java_register_parsed_class.
7477 * lex.c: Fixed typo in header. Some line width related formating.
7478 * lex.h: Some line width related formating.
7479 * parse.h (source_end_java_method, resolve_expression_name,
7480 complete_class_decl, maybe_create_class_interface_decl,
7481 check_class_interface_creation): New static function declarations.
7482 (java_layout_parsed_class, java_method_add_stmt): New function
7484 (struct parser_ctxt): Field mark_class_generate removed. New
7485 fields class_list and artificial_constructor.
7486 * parse.y: Fixed typo in header.
7487 (class_declaration:): Call complete_class_decl when class body
7489 (method_declaration:): Call source_end_java_method in pass 2 when
7490 the method body is defined.
7491 (postfix_expression:): Do expression name resolution on sub-rule
7493 (create_class, create_interface): Merged common pieces.
7494 (check_class_interface_creation, maybe_create_class_interface_decl):
7496 (complete_class_decl): New function.
7497 (register_fields): Fixed line width related typo.
7498 (method_header): Correctly skip first argument when fixing
7499 argument line. Changed the loop.
7500 (java_check_circular_reference): Now use ctxp->class_list.
7501 (java_complete_class): Removed start/stop marking.
7502 (java_check_regular_methods): Now takes a class decl as an
7503 argument. Add default constructor if none were encountered.
7504 (java_check_methods): Now use ctxp->class_list. Changed call to
7505 java_check_regular_methods.
7506 (source_start_java_method): Set DECL_ARG_TYPE for each function
7508 (source_end_java_method, java_method_add_stmt): New functions.
7509 (java_generate_parsed_class): No longer exists.
7510 (java_layout_parsed_class, java_register_parsed_class): New functions.
7511 (resolve_expression_name): New function.
7513 Thu Feb 12 11:54:28 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7515 * jcf-parse.c: (parse_source_file): Check on errors after init lex.
7516 * lex.c: (java_init_lex): Defer ctxp->java_pass initialization
7517 until pass initializations are done. Call read_import_dir with
7519 * parse.h: (lookup_modifier_cl): New function declared.
7520 (INTERFACE_FIELD_MODIFIERS): New macro.
7521 (OBSOLETE_MODIFIER_WARNING): New macro.
7522 * parse.y: (register_fields): Class type and current field name in
7523 local variables. Check modifier(s) if adding field(s) to an interface.
7524 (check_abstract_method_header): Now use OBSOLETE_MODIFIER_WARNING
7525 and report errors using the faulty modifier line context.
7526 (lookup_modifier_cl): New function.
7527 (read_import_dir): Detect and report default import processing
7530 1998-02-11 Brendan Kehoe <brendan@cygnus.com>
7532 Add a pair of -fassume-compiled/-fno-assume-compiled options.
7533 * class.c (is_compiled_class): Return 1 after making sure it
7534 qualifies as loaded, if FLAG_ASSUME_COMPILED is set.
7535 * lang-options.h: Add -fassume-compiled/-fno-assume-compiled.
7536 * java-tree.h (flag_assume_compiled): Add decl.
7537 * lang.c (lang_f_options): Add the flag.
7538 (flag_assume_compiled): Add decl, default to 0.
7540 Wed Feb 11 11:27:59 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
7542 * class.c (class_depth): Call to load_class uses extra VERBOSE arg.
7543 (is_compiled_class): Likewise.
7544 (layout_class): Likewise.
7545 (layout_class): Detect and lay out classes defined in source code.
7546 (interface_of_p, add_interface_do, may_add_interface): New
7548 (add_interface): Now use add_interface_do.
7549 (add_method_1): New function.
7550 (add_method): Now use add_method_1.
7551 (pushlevel): Debug message conditional to SOURCE_FRONTEND_DEBUG.
7552 (complete_start_java_method): New function.
7553 (start_java_mehod): Now call complete_start_java_method.
7554 * expr.c (lookup_field): Call to load_class uses extra VERBOSE arg.
7555 (expand_invoke): Likewise and fixed typo.
7556 *gjava.c: (print_super_field): Use new argument to find_class
7559 *java-tree.h: (CLASS_FROM_SOURCE_P): New flag on RECORD_TYPE.
7560 (IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P, IS_A_CLASSFILE_NAME,
7561 QUALIFIED_P, IS_AN_IMPORT_ON_DEMAND_P): New flags on
7563 (CLASS_COMPLETE_P): New flag on TYPE_DECL.
7564 (add_method_1, push_class): New prototypes.
7565 *jcf-dump.c: find_class now uses new DO_CLASS_FILE argument.
7566 *jcf-io.c: (open_in_zip): jcf now stores a pointer to the Zip
7567 directory where the class was found.
7568 (find_class): New argument DO_CLASS_FILE. Function find_class
7569 modified accordingly.
7570 *jcf-parse.c: (fix_class_path): New function.
7571 (load_class): Use new VERBOSE argument. load_class now finds and
7572 loads/parses .class/.java files. Save read_state of current_jcf
7574 (java_parser_abort_on_error): New macro.
7575 (jcf_parse_source, parse_source_file): New function.
7576 (jcf_parse): Fixed typo.
7577 (yyparse): Call parse_source_file () only.
7578 (process_zip_dir): Fixed typo, fix zdir->filename_length when
7579 writing the real class name back in the zip directory entry.
7580 (find_in_current_zip): IDENTIFIER_CLASS_VALUE may be null.
7581 (jcf_figure_file_type): Fixed bogus alloc and bcopy.
7582 *jcf.h: (typedef struct JCF): New fields java_source and zipd.
7583 (find_class): Prototype fixed.
7584 *lex.c: Added 1998 time stamp.
7585 Removed all static global variables, moved into the parser
7586 context data structure.. Now include unistd.h if SEEK_SET not
7588 (java_init_lex): Rewritten.
7589 (java_sneak_unicode): Modified current unicode access in current line.
7590 (java_unget_unicode): Likewise.
7591 (java_allocate_new_line): New allocation management.
7592 (java_read_char): Modified access and storage of unget_utf8_value.
7593 New way of processing current unicode.
7594 (java_store_unicode, java_read_unicode): Fixed typo in declaration.
7595 (java_get_unicode): Now use the parser context.
7596 (java_lineterminator): Likewise.
7597 (java_lex): Now used java_lval argument (pointer to YYSTYPE), part
7598 of the reentrant parser implementation. Function now use the
7599 parser context data structure and java_lval. Fixed production of
7600 the float and double constant "out of range" error message. Fixed
7601 obstack use. Return integer value when hitting a modifier. Now
7602 return type for TRUE, FALSE and other predefined types. Return
7603 identifier as a TREE_LIST list containing the current line context
7604 as the TREE_VALUE sub-node.
7605 (java_unicode_2_utf8): Fixed typo in declaration.
7606 (java_lex_error): Now use the parser context data structure.
7607 *lex.h: Added 1998 time stamp.
7608 (struct java_line): New fields ref_count and next.
7609 (JAVA_LINE_CHECK, JAVA_LINE_MARK, JAVA_LINE_CHAIN,
7610 JAVA_LINE_UNMARK, ID_NAME, ID_CL): New macros.
7611 (JAVA_FLOAT_RANGE_ERROR, JAVA_INTEGRAL_RANGE_ERROR, UNGETC): Fixed.
7612 *parse.h: Added 1998 time stamp.
7613 (java_parse_source_file): Renamed from parse_source_file.
7614 (YYERROR_NOW, YYNOT_TWICE): Fixed.
7615 (CLASS_MODIFIERS, FIELD_MODIFIERS, METHOD_MODIFIERS,
7616 INTERFACE_MODIFIER, INTERFACE_METHOD_MODIFIERS,
7617 JAVA_MODIFIER_CTX_UNMARK, IC_DECL, IC_DEPEND, DEPEND_DECL,
7618 THIS_MODIFIER_ONLY, ABSTRACT_CHECK, BEGIN_ONLY_PASS,
7619 END_ONLY_PASS, ELSE_ONLY_PASS, exit_java_complete_class,
7620 CLASS_OR_INTERFACE, INCOMPLETE_P): New macros.
7621 (struct parser_ctxt): New data structure to keep the parser context.
7622 *parse.y: Added 1998 time stamp, got rid of static global variables.
7623 (java_error_count, ctxp): New global variables.
7624 (%union): New value field.
7625 (numeric_type, integral_type): Rules removed.
7626 (primitive_type): Rule defined to handle integral, float, double and
7628 (qualified_name, package_declaration,
7629 single_type_import_declaration, type_import_on_demand_declaration,
7630 modifiers, class_declaration, super, interfaces,
7631 interface_type_list, class_body, field_declaration,
7632 field_declaration, variable_declarators, variable_declarator,
7633 variable_declarator_id, method_declaration, method_header,
7634 formal_parameter_list, formal_parameter, method_body, block,
7635 static, interface_declaration, extends_interfaces,
7636 abstract_method_declaration, local_variable_declarators): Rules now
7638 (force_error, do_warning): New global statics.
7639 (push_parser_context, parser_context_save_global,
7640 parser_context_restore_global, pop_parser_context): New functions.
7641 (yyerror): Now uses the global parser context. Fixed use of obstack.
7642 (parse_error, parse_error_context, parse_warning_context,
7643 java_accstring_lookup, redefinition_error, check_modifiers,
7644 parser_add_interface, create_interface, create_class, find_field,
7645 duplicate_declaration_error, register_fields, method_header,
7646 check_modifiers_consistency, check_abstract_method_header,
7647 method_declarator, parser_qualified_classname,
7648 parser_check_super_interface, parser_check_super,
7649 parser_chain_incomplete_item, java_check_circular_reference,
7650 layout_class_from_source, java_complete_class,
7651 complete_method_decl, resolve_class, complete_class_report_errors,
7652 java_check_final, check_method_redefinition,
7653 java_check_regular_methods, java_check_abstract_methods,
7654 java_check_methods, lookup_java_interface_method2,
7655 lookup_java_method2, lookup_cl, find_name_in_single_imports,
7656 process_imports, find_in_imports, read_import_entry,
7657 read_import_dir, find_in_imports_on_demand,
7658 check_pkg_class_access, not_builtin_p, declare_local_variables,
7659 source_start_java_method, java_generate_parsed_class): New
7661 *typeck.c: (signature_include_return): New global variable.
7662 (build_java_signature): Use SIGNATURE_INCLUDE_RETURN figure whether
7663 to add the function returned type in the signature.
7665 1998-02-09 Brendan Kehoe <brendan@cygnus.com>
7667 * jcf-io.c (open_in_zip): Use strncmp and LEN.
7669 Thu Jan 29 16:12:13 1998 Dave Brolley <brolley@cygnus.com>
7671 * Make-lang.in (java.info): Added.
7672 (java.install-info): Added
7674 1998-01-27 Brendan Kehoe <brendan@cygnus.com>
7676 * Makefile.in (clean): Also remove java/parse.c.
7678 1998-01-26 Brendan Kehoe <brendan@cygnus.com>
7680 Add a pair of -fbounds-check/-fno-bounds-check options.
7681 * lang.c (lang_decode_option): Add code to grok arguments.
7682 (flag_bounds_check): Add decl.
7683 (lang_f_options): New array w/ the option in it.
7684 * java-tree.h (flag_bounds_check): Add decl.
7685 * lang-options.h: New file.
7686 * expr.c (build_java_arrayaccess): Use flag_bounds_check instead
7687 of a static macro value.
7688 (JAVA_ARRAY_EXCEPTION): Delete macro.
7690 Fri Jan 23 14:19:47 1998 Per Bothner <bothner@cygnus.com>
7692 * typeck.c (build_java_array_type): Fix two bugs in previous change.
7693 * expr.c (build_anewarray): Add missing promote_type.
7695 Thu Jan 22 17:43:45 1998 Per Bothner <bothner@cygnus.com>
7697 Add array types with known length to optimize bounds checking.
7698 * typeck.c (build_java_array_type): Take length parameter.
7699 (java_array_type_length, build_prim_array_type): New functions.
7700 * java-tree.h: Update for new functions.
7701 * expr.c, typeck.c, verify.c: Update build_java_array_type calls.
7702 * class.c: Use build_prim_array_type.
7703 * expr.c (can_widen_reference_to): Handle known-length array types.
7704 (verify_jvm_instructions): Keep track of integer push instructions
7705 followed by newarray/anewarray, so we can build known-length arrays.
7706 (JAVA_ARRAY_DATA_OFFSET): Replace by ...
7707 (java_array_data_offset): New function.
7708 (build_java_array_length_access): New function. Optimize if constant.
7709 (build_java_arrayaccess): Constant fold bounds check.
7710 (expand_java_newarray, expand_java_anewarray): Replaced by ...
7711 (build_newarray, build_anewarray): New functions.
7712 (ARRAY_NEW_NUM, ARRAY_NEW_PTR): Use build_{a,}newarray.
7713 * verify.c (merge_types): Handle known-lengh array types.
7715 Mon Jan 19 13:09:25 1998 Per Bothner <bothner@cygnus.com>
7717 * expr.c (expand_byte_code): Fix performace bug, which caused
7718 searching linenumber_table to be linear rather than constant.
7720 Fri Dec 12 19:18:42 1997 Per Bothner <bothner@cygnus.com>
7722 * Makefile.in (BISON, BISONFLAGS): Add missing macros.
7724 * decl.c, java-tree.h (soft_fmod_node): New global.
7725 * decl.c (init_decl_processing): Define __builtin_fmod.
7726 * expr.c (build_java_binop): Implement TRUNC_MOD_EXPR for REAL_TYPE
7727 using __builtin_fmod.
7729 Thu Dec 4 13:22:59 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7731 * keyword.h: New file, output of keyword.gperf as processed by
7733 * lex.c (java_lex_init): Initialize java_error_flag.
7734 * parse.c (YYERROR_NOW): Uses java_error_flag.
7735 * parse.y: New static java_error_flag. Useless definition of
7737 * parse.y (java_error): Portable error recovery using
7738 java_error_flag (not yet completely tuned).
7740 1997-12-04 Brendan Kehoe <brendan@lisa.cygnus.com>
7742 * Makefile.in (parse.c): Use $(srcdir) for parse.y.
7744 Wed Dec 3 18:37:42 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7746 * Makefile.in: (JAVA_OBJS): New object jcf-parse.o.
7747 (parse.c, lex.c, keyword.h): New rules for Java source code
7749 * parse.c: Renamed into jcf-parse.c.
7750 * jcf-parse.c (yyparse): Invoke the parser to process Java source code.
7751 * keyword.gperf: New file, Java keywords.
7752 * parse.y: New file, Java language grammar.
7753 * parse.h: New file, Java language grammar definitions.
7754 * lex.c: New file, Java language lexer.
7755 * lex.h: New file, Java language lexer definitions.
7757 Wed Dec 3 17:00:17 1997 Per Bothner <bothner@cygnus.com>
7759 * decl.c (clinit_identifier_node), java-tree.h: New global.
7760 * java-tree.h (IS_METHOD_INIT_P, IS_METHOD_CLINIT_P): Removed.
7761 * verify.c (verify_jvm_instructions): Inline use of removed macros.
7762 * expr.c (expand_java_field_op): Check for invalid assignment
7765 * jcf-reader.c (get_attribute): Test for wrong attribute length.
7767 Mon Oct 27 17:46:36 1997 Per Bothner <bothner@cygnus.com>
7769 * verify.c (verify_jvm_instructions): When processing a handler,
7770 attempt to set the current_subr to the right value.
7771 (More complicated code combines Sep 17 and Oct 22 versions.)
7773 Fri Oct 24 11:36:54 1997 Per Bothner <bothner@cygnus.com>
7775 * class.c (push_class): Figure out (guess) name of source file.
7776 * parse.c (set_source_filename): Set DECL_SOURCE_FILE of class decl.
7777 (give_name_to_class): Don't guess source name; use DECL_SOURCE_FILE.
7778 (parse_class_file): Change return type from int to void.
7779 Call debug_start_source_file/debug_end_source_file.
7781 * expr.c (build_java_binop): Fix masking 2nd operand.
7782 * decl.c (init_decl_processing): Set sizetype first.
7784 Wed Oct 22 19:39:05 1997 Per Bothner <bothner@cygnus.com>
7786 * verify.c (verify_jvm_instructions): Don't set current_subr to NULL.
7787 (Revert Sep 17 change.)
7789 Tue Oct 21 15:09:02 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7791 * parse.c (process_zip_dir): Skip ZIP entries not bearing the
7792 .class extension in their name and fix thing so we don't process
7793 them parse_zip_file_entries().
7794 (parse_zip_file_entries): Cleaned unused local variables.
7796 Mon Oct 20 14:52:42 1997 Per Bothner <bothner@cygnus.com>
7798 * expr.c (can_widen_reference_to): Allows equal array element types.
7799 (expand_byte_code): PRE_RET must expand OPERAND_VALUE (to get index).
7800 * jcf-dump.c (RET): Get (and print) index.
7802 * verify.c (verify_jvm_instructions case OPCODE_anewarray):
7803 Promote element type to POINTER_TYPE.
7805 Mon Oct 20 13:40:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7807 * jcf-reader.c, parse.c: (parse_zip_file, process_zip_dir,
7808 find_in_current_zip, jcf_figure_file_type): Moved from
7809 jcf-reader.c to parse.c.
7810 * zextract.c: (read_zip_archive): takes file_comment_length possible
7813 Mon Oct 20 11:45:06 1997 Per Bothner <bothner@cygnus.com>
7815 * verify.c (verify_jvm_instructions): Var can also be promoted to int.
7817 * verify.c (merge_types): Handle array types even better ...
7819 Fri Oct 17 15:56:37 1997 Per Bothner <bothner@cygnus.com>
7821 * expr.c (java_stack_pop): Fix use of NULL_TREE for TYPE_SECOND.
7823 * java-tree.h (PUSH_FIELD): Set DECL_ARTIFICIAL.
7824 * class.c (make_class_data): Don't build fields_decl if no fields.
7825 When building fields_decl, skip if DECL_ARTIFICAL.
7827 * expr.c (java_stack_swap): Update stack_type_map.
7828 * verify.c (merge_types): Handle array types better.
7830 Wed Oct 15 18:09:45 1997 Per Bothner <bothner@cygnus.com>
7832 * class.c (add_field): Don't promote short integral fields to
7833 int any more (unless JAVA_PROMOTE_TO_INT), since Kaffe doesn't.
7834 * expr.c (push_value): Promote and convert short integral values.
7836 * decl.c, java-tree.h (integer_two_node): New constant node.
7837 * verify.c (merge_types): Check for TYPE_RETURN_ADDR.
7839 Wed Oct 15 17:04:50 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7841 * class.c (append_gpp_mangled_type): Use function argument
7842 unpromoted type to generate mangled name.
7844 Mon Oct 13 16:52:55 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7846 * constants.c (build_constant_data_ref): Now uses current_class
7847 instead of main_class.
7848 (build_constants_constructor): Now uses current_class instead of
7850 * zipfile.h: (struct ZipFileCache): Now defined here. Declaration
7851 of the global variable SeepZipFiles done here.
7852 * zextract.c (read_zip_archive): extra_field optional field taken
7853 into account while computing the position of the class file in the
7855 * verify.c (verify_jvm_instructions): Use current_jcf to search
7857 * parse.c (load_class): First search for the class to load in the
7858 current zip file. Saves current_jcf (restored before returning
7859 from that function). Don't call JCF_FINISH in the class was found
7860 in the current ZIP file.
7861 (jcf_parse): If the class was found in the current ZIP file, save
7862 its tree_constant_pool (for later reuse).
7863 (parse_class_file): New function. Process each method defined in
7864 the current class and record the class as to be later registered.
7865 (yyparse): Rewritten. Figure the type of the current file and switch
7867 * lang.c: New global variable current_jcf.
7868 (lang_init): Removed compiling_from_source test (done later, in
7869 yyparse). Removed call the jcf_parse ().
7870 * jcf.h (JCF_ZIP, JCF_CLASS, JCF_SOURCE): New defined values.
7871 (typedef struct JCF): New fields seen_in_zip (to mark a class found
7872 in the current ZIP file) and zip_offset (offset to the class data in
7873 the current zip file).
7874 * jcf-reader.c: zipfile.h included.
7875 localToFile: New ZipFileCache static global variable
7876 (parse_zip_file_entries): New function. Browse the current ZIP
7877 file directory and process each class found.
7878 (process_zip_dir): New function. Register each class found in the
7879 ZIP file directory. The class aren't parsed but a valid JCF is
7880 link to each of them.
7881 (find_in_current_zip): New function. Search for a class in the
7882 current ZIP file directory. If found, prepare the class so that it
7884 (jcf_figure_file_type): New function. Examine the file structure
7885 to figure a class file, a ZIP file. If none of these categories are
7886 matched, a source file is assumed.
7887 * jcf-io.c: Removed definition of ZipFileCache (moved in zipfile.h).
7888 SeenZipFile: New global variable.
7889 (open_in_zip): Use zipmember's length to accelerate the search for
7890 a member. If zipmember was NULL and zip file successfully read,
7892 * java-tree.h: New global variable current_jcf declared. Added
7893 declaration for current_constant_pool_tags, current_constant_pool_data,
7894 current_constant_pool_length, current_constant_pool_data_ref.
7895 (struct lang_type): Augmented with two fields. struct JCF *jcf (to
7896 store the JCF of classes seen in a zip file) and tree *constant_pool
7897 (to save a loaded class constant pool). current_class declared here.
7898 * expr.c (expand_invoke): Use current_jcf instead of main_jcf to
7899 retrieve method_ref_constant.
7900 (PUSHC): java_push_constant_from_pool now uses current_jcf.
7901 (OBJECT): get_class_constant now uses current_jcf.
7902 (ARRAY_NEW_PTR): get_class_constant now uses current_jcf.
7903 (ARRAY_NEW_MULTI): get_class_constant now uses current_jcf.
7904 (expand_invoke): Now uses current_class instead of main_class
7905 (build_class_init): Now uses current_class instead of main_class
7906 * class.c: New static global variable registered_class.
7907 (register_class): New function.
7908 (emit_register_class): Modified to use registered_class instead of
7910 (is_compiled_class): Now take into account class seen in the archive.
7912 Mon Oct 6 12:03:23 1997 Per Bothner <bothner@cygnus.com>
7914 * except.h: Renamed to: java-except.h.
7915 * parse.c, except.c, expr.c, verify.c: Update #include accordingly.
7916 * except.c: Add semi-working (commented out) implementation.
7918 * expr.c (expand_iinc): Add needed flush_quick_stack.
7919 * parse.c (set_source_filename): New function.
7920 (give_name_to_class): Set input_filename from package.classname.java.
7922 * jcf-io.c (find_class): Don't look first in ".".
7924 Wed Oct 1 11:26:10 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7926 * zextract.c (read_zip_archive): Now takes into account the
7928 * expr.c (can_widen_reference_to): Modified to handle sub-interfaces.
7930 Sat Sep 20 12:44:28 1997 Per Bothner <bothner@cygnus.com>
7932 * constants.c, java-tree.h (build_internal_class_name): New function.
7933 (alloc_class_constant): Re-implement using build_internal_class_name.
7934 * class.c (make_class_data): Likewise.
7935 * class.c (hashUtf8String): Make hash algorithm match String.hashCode.
7937 Wed Sep 17 13:15:23 1997 Per Bothner <bothner@cygnus.com>
7939 * verify.c (verify_jvm_instructions): Temporarily set current_subr
7940 to NULL before pushing an exception handler target.
7942 * expr.c (flush_quick_stack): Save from low stack indexes to high.
7943 (java_stack_swap, java_stack_dup): Re-write to be safe from
7944 clobbering registers.
7945 (build_class_init): New function.
7947 Wed Sep 17 11:02:41 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7949 * typeck.c (build_java_array_type): Temporary use
7950 permanent_obstack to create the array 'length' field.
7951 * expr.c (lookup_label): Temporay use permanent_obstack to create
7953 * class.c (push_super_field): Tempory use permanent_obstack.
7955 Mon Sep 15 11:33:31 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7957 * typeck.c (type_for_mode): Now handles double_type_node and
7959 * verify.c (verify_jvm_instructions): The instruction following
7960 the wide bytecode is checked. OPCODE_ret added to the list of
7963 Thu Sep 11 19:45:18 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
7965 * class.c (make_class): Temporary use permanent_obstack. Set the
7966 class CLASS_P field to 1.
7967 (push_class): Temporary use permanent_obstack.
7968 (set_super_info): Temporary use permanent_obstack.
7969 (add_method): Temporary use permanent_obstack, set
7971 (add_field): Temporary use permanent_obstack. Sets
7972 FIELD_VOLATILE() and FIELD_TRANSIENT().
7973 (build_class_ref): Temporary use permanent_obstack if the class
7975 (build_static_field_ref): Temporary use permanent_obstack when
7976 creating field's rtl.
7977 (get_access_flags_from_decl): Handle ACC_VOLATILE, ACC_TRANSIENT,
7978 ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT flags for methods
7979 and fields. Function finalized, as far as flag handling.
7980 (push_class_static_dummy_field): Temporary use permanent_obstack.
7981 (emit_register_class): Force generation of class registration at
7983 * decl.c (end_java_method): Call permanent_allocation() before
7985 * expr.c (can_widen_reference_to): Added comment to interface
7986 handling, fixed typo.
7987 (lookup_field): Now uses CLASS_P() to correct FIXME
7988 (expand_invoke): Verification on public && !static &&
7989 !abstract moved into soft_lookupinterfacemethod (kaffe).
7990 Use Object class dtable if objectref is an array when expanding
7992 (java_push_constant_from_pool): Temporary use permanent_obstack
7994 * parse.c (get_ref_constant): Temporary use permanent_obstack to
7995 create constant references.
7996 (get_constant): Temporary use permanent_obstack to create constant.
7997 (load_class): Temporary use permanent_obstack to load class.
7998 (jcf_parse): Temporary use permanent_obstack to perform class
8000 * typeck.c: (parse_signature_string): Temporary use permanent_obstack.
8001 (build_java_signature): Temporary use permanent_obstack.
8002 * verify.c: (verify_jvm_instruction): removed unecessary verification
8004 * java-tree.h (METHOD_NATIVE, METHOD_TRANSIENT): Defined.
8005 (FIELD_VOLATILE, FIELD_TRANSIENT): Defined.
8008 Thu Sep 11 11:57:32 1997 Per Bothner <bothner@cygnus.com>
8010 * class.c (append_gpp_mangled_type): Fix typo.
8011 (emit_register_class): Use main_class to get class object, rather
8012 than looking for no-longer-existing static decl starting with _CL.
8013 * typeck.c (parse_signature_type): Promote array element type
8014 if it is a RECORD_TYPE.
8016 Wed Sep 10 16:09:23 1997 Per Bothner <bothner@cygnus.com>
8018 * class.c (push_class_static_dummy_field): New function.
8019 (mangle_static_field): New. Do G++-style mangling of static fields.
8020 (layout_class): Mandle static fields here, not in add_field.
8021 (build_class_ref): The class object is now a dummy static field.
8022 * decl.c (find_local_variable): Look for best, instead of first match.
8023 * expr.c (push_type): Always promote_type, not just for RECORD_TYPE.
8024 (build_java_athrow): Don't check here if exception is Throwable.
8025 * java-tree.h (TYPE_UNSET): Renamed to TYPE_UNKNOWN.
8026 (TYPE_USED): Removed. No longer used ...
8027 * parse.c (jcf_parse): Call push_class_static_dummy_field.
8028 * verify.c (push_pending_label): New function.
8029 (push_pending_block): Renamed to check_pending_block.
8030 (merge_types): Remove unneeded suuport for TYPE_UNUSED.
8031 (verify_jvm_instructions): Only reset prev_eh_ranges (to force
8032 re-checking possible handlers) after a store (less wasted work).
8033 Check for null handler (finally) before calling add_handler.
8034 Various changes to (finally?) correctly handle try/finally.
8036 1997-09-09 Brendan Kehoe <brendan@lisa.cygnus.com>
8038 * class.c: Include stdio.h.
8040 Thu Sep 4 21:30:55 1997 Per Bothner <bothner@cygnus.com>
8042 * expr.c (expand_invoke): Use COMPOUND_EXPR (and TREE_SIDE_EFFECTS)
8043 to make sure class is initialized before static/special invoke.
8045 * verify.c (verify_jvm_instructions): On a store instruction,
8046 call find_local_variable to force pre-allocation of decl and rtx.
8047 * decl.c (push_jvm_slot): Set DECL_REGISTER on stack slots.
8049 Wed Sep 3 16:13:23 1997 Per Bothner <bothner@cygnus.com>
8051 * class.c (build_class_ref): Strip off "promoted_" if need be.
8052 (make_field_value): Call build_java_signature when needed.
8053 (layout_class): Don't make_function_rtl if METHOD_ABSTRACT.
8054 * expr.c (build_java_athrow): Don't push_value of exception.
8055 (build_java_binop): Implement COMPARE_L_EXPR and COMPARE_G_EXPR to
8056 match specification of [fd]cmp[lg] for NaNs.
8057 (expand_byte_code): Add support for exception handler ranges.
8058 * except.c: Add skeleton for EH code-generation.
8059 * verify.c (merge_types): Treat all promoted integral types as equal.
8060 * constants.c (build_constants_constructor): To force creation of
8061 current_constant_pool_data_ref, call build_constant_data_ref.
8063 * javaop.def (lload): Fix typo.
8064 * jcf-dump.c (main): Clear filename to prevent possibly-bad free.
8066 Tue Sep 2 17:37:25 1997 Brendan Kehoe <brendan@lisa.cygnus.com>
8068 * parse.c: Don't include function.h.
8070 Wed Aug 27 18:33:04 1997 Per Bothner <bothner@cygnus.com>
8072 * except.[ch]: New files.
8073 * Makefile.in (JAVA_OBJS): Add except.o
8074 * expr.c: Temporary warning about unimplemented exceptions.
8075 * verify.c: Verify exception handlers.
8077 * jcf-dump.c (disassemble_method): Print exception table.
8079 Wed Aug 27 13:26:58 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
8081 * expr.c (verify_jvm_instructions): Started a thorough
8082 verification of invoke* bytecodes.
8083 (expand_byte_code): flush quick stack if PC is the target of a
8084 branch. and undef RET (conflicting with config/i386/i386.h).
8085 (expand_java_arrayload): Fixed bogus cast, when Boolean type is
8087 (expand_invoke): Now handles invokeinterface and do more
8088 verification according to the bytecode.
8089 (lookup_field): Don't try to load the class if processing
8091 (can_widen_reference_to): Now handles interfaces.
8092 * decl.c (init_decl_processing): New global variable
8093 soft_lookupinterfacemethod_node, declared in java-tree.h.
8094 Call set_super_info on string_type_node.
8095 * java-tree.h (CLASS_INTERFACE, CLASS_ABSTRACT, CLASS_SUPER): Now
8097 * class.c (set_super_info): Fills the CLASS_* flags according to
8099 (get_access_flags_from_decl): Handles all class flags.
8101 Tue Aug 26 18:54:34 1997 Per Bothner <bothner@cygnus.com>
8103 * class.c (add_method): Zero out newly-allocated DECL_LANG_SPECIFIC.
8104 * parse.c (yyparse): Check for abstract method, and missing code.
8105 * expr.c (expand_byte_code): Change interface.
8106 * lang.c (put_decl_node): Print promoted types prettier.
8107 * verify.c (verify_jvm_instruction): Change interface.
8108 Partial support for scanning exception table.
8109 For load instructions, handle promoted integral types.
8111 Thu Aug 21 13:48:01 1997 Per Bothner <bothner@cygnus.com>
8113 * verify.c: New file, with contents moved from expr.c.
8114 * expr.c: Bunch of stuff (mostly verification) moved to verify.c.
8115 * typeck.c (is_array_type_p): Moved here from expr.c.
8116 * java-tree.h: Add some now-needed function declarations.
8117 * Makefile.in (JAVA_OBJS): Added verify.o.
8119 Wed Aug 20 14:34:34 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
8121 * class.c (add_method): Sets the METHOD_SYNCHRONIZED flag, sets the
8122 METHOD_ABSTRACT flag.
8124 * java-tree.h (METHOD_SYNCHRONIZED): Set to DECL_LANG_FLAG_4.
8125 (IS_METHOD_CLINIT_P, IS_METHOD_INIT_P): New macros.
8126 (METHOD_ABSTRACT): Set to DECL_LANG_FLAG_5
8128 * decl.c (soft_monitorenter_node, soft_monitorexit_node): New global
8130 (start_java_method): Hook for SYNCHRONIZED methods.
8132 * expr.c (build_java_jsr, build_java_ret): New functions
8133 (JSR,PRE): New macros
8134 (PRE_TABLE_SWITCH, PRE_LOOKUP_SWITCH): Fixed and secured.
8135 (verify_jvm_instructions): tableswitch, lookupswitch,
8136 monitorenter, monitorexit, goto_w: verified.
8137 (LOOKUP_SWITCH, TABLE_SWITCH): Fixed generation of default: label
8138 (build_java_monitor): New function.
8139 (MONITOR_OPERATION): Modified to call build_java_monitor()
8140 (verify_jvm_instructions): Started a thorough verification of
8143 Tue Aug 19 13:35:49 1997 Per Bothner <bothner@cygnus.com>
8145 Support verification of jsr/ret subroutines (used for try/finally).
8146 * decl.c (return_address_type_node): New type node.
8147 * java-tree.h (LABEL_RETURN_LABEL, LABEL_RETURN_TYPE_STATE,
8148 RETURN_MAP_ADJUSTED, LABEL_RETURN_LABELS, LABEL_IN_SUBR,
8149 LABEL_SUBR_START, LABEL_SUBR_CONTEXT, BCODE_VERIFIED): New macros.
8150 (TYPE_UNSET, TYPE_SECOND, TYPE_NULL, TYPE_RETURN_ADDR, TYPE_UNUSED,
8151 TYPE_USED): New macros for special types in type_map.
8153 * java-tree.h (BCODE_JUMP_TARGET): Renamed to BCODE_TARGET.
8154 (BCODE_BACKWARDS_TARGET, CODE_FORWARDS_TARGET): Replaced by
8156 * expr.c (expand_byte_code): Fix logic to warn of unused instructions.
8158 * expr.c (can_widen_reference_to): New function.
8160 (merge_type_state): Support handling start of subroutine.
8161 (push_pending_block): Return char* error message, instead of calling
8162 fatal on an error. Also handle subroutines.
8163 (verify_jvm_instructions): Handle errors from push_poending_block.
8164 Support jsr and ret instructions.
8166 Tue Aug 19 13:33:36 1997 Per Bothner <bothner@cygnus.com>
8168 * jcf-io.c (find_classfile): Fix thinko.
8169 * jcf-dump.c: Add CONVERT2 (to match changed javaop.def).
8171 Tue Aug 12 20:14:45 1997 Jason Merrill <jason@yorick.cygnus.com>
8173 * Makefile.in (BISON): Remove.
8175 Thu Aug 7 23:08:24 1997 Per Bothner <bothner@cygnus.com>
8177 * Makefile.in: Convert to autoconf.
8178 * config-lang.in (outputs): Added java/Makefile.
8180 * Make-lang.in, lang-specs.h, config-lang.in, Makefile.in:
8181 Rename cc1java to jc1.
8183 * lang.c (init_parse, finihs_parse): New functions #ifdef USE_CPPLIB.
8184 * Makefile.in (INTERNAL_CFLAGS): Add @extra_c_flags.
8186 * class.c (class_depth): Do load_class if needed.
8188 Mostly better verification.
8189 * decl.c (pushdecl): Set TYPE_STUB_DECL for a type.
8190 (init_decl_processing): Change return type of soft_checkcast.
8191 * expr.c (expand_java_CHECKCAST): Do push_value of the "casted" value.
8192 * lang.c (put_decl_string, put_decl_node, lang_printable_name,
8193 lang_print_error): New functions.
8194 (lang_init): Set global hook print_error_function to lang_print_error.
8195 * expr.c: In the type_map ptr_type_node is only used for null now.
8196 (pop_type, merge_types): Hence ptr_type_node matches any reference.
8197 (merge_types): Dererence pointer to record types before comparing.
8198 (decode_newarray_type, merge_types): On error just return NULL.
8199 (build_java_binop): Add preliminary implementation (with warning)
8200 for COMPARE_L_EXPR and COMPARE_G_EXPR (i.e. [fd]cmp[lg]).
8201 (lookup_label): Set DECL_IGNORED_P (for dwarf2out).
8202 (expand_compare, expand_java_goto, expand_java_call): Don't
8203 push_pending_block, since that only makes sense when verifying.
8204 (merge_type_state): Different return codes.
8205 (push_pending_block): A block may need to be verified more than once.
8206 (expand_byte_code): Warn about unused code at code generation time.
8207 (verify_jvm_instruction): Changed logic, since code may need to be
8208 re-verified if type-state has changed. Also, better error handling.
8209 Implement acmpeq, acmpne, pop, pop2, swap, checkcast, instanceof.
8210 Improve newarray, anewarray, ?aload, athrow,
8211 * java-tree.h (LABEL_CHANGED): New macro.
8213 Tue Aug 5 12:21:27 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
8215 * decl.c (soft_athrow_node): New global variable initialized.
8216 * javaop.def (i2b, i2c, i2s): Invoke CONVERT2
8217 * typeck.c (convert): Added support for REAL_TYPE.
8218 (convert_to_char): New function.
8219 (convert): Handle CHAR_TYPE.
8220 * expr.c (expand_java_arraystore): Modified because CHAR/BYTE/BOOLEAN/
8221 SHORT now expect INT but store as CHAR/BYTE/BOOLEAN/SHORT.
8222 (expand_java_arrayload): CHAR/BYTE/BOOLEAN/SHORT now convert result to
8224 (verify_jvm_instructions): Added break a the end of bogus unop: label.
8225 (OPCODE_<b|c|s>astore): Pop an int operand from the type stack
8226 (OPCODE_<b|c|s>astore): Push the promoted type onto the stack
8227 (process_jvm_instruction): New macro CONVERT2 for i2c, i2s and i2b.
8228 (JAVA_ARRAY_LENGTH_OFFSET, JAVA_ARRAY_DATA_OFFSET): Modified
8229 to Use The Right Things.
8230 (pop_type): Accept CHAR/BYTE/BOOLEAN/SHORT promoted type as
8231 compatible with INT. BOOLEAN is made equivalent to BYTE.
8232 (OPCODE_athrow, OPCODE_aconst_null, OPCODE_ifnull,
8233 OPCODE_ifnonnull): Now supported.
8234 (build_java_athrow): New function.
8236 Mon Aug 4 15:46:45 1997 Per Bothner <bothner@cygnus.com>
8238 Rename method name <init> to match G++ (and fix mangling).
8239 * class.c (layout_class): Replace method name of <init> by class name.
8240 (make_method_value): Do inverse renaming of constructor from <init>.
8241 * java-tree.h (DECL_CONSTRUCTOR_P): New macro.
8242 * typeck.c (lookup_java_constructor): New function.
8243 * expr.c (expand_invoke): If method_name is <init>, call
8244 lookup_java_constructor to find constructor.
8246 * parse.c (get_constant): Handle CONSTANT_Float and CONSTANT_Double.
8248 Fri Aug 1 11:37:09 1997 Alexandre Petit-Bianco <apbianco@cygnus.com>
8250 * parse.c (get_class_constant): Modified to handle array "classes"
8251 * typeck.c (set_local_type): Bug fixed when filling type_map[] with
8253 (convert): Modified to handle real type.
8254 * java-tree.h (soft_badarrayindex_node, soft_anewarray_node,
8255 soft_multianewarray, soft_newarray_node, soft_throw_node): New global
8257 * decl.c (soft_badarrayindex_node, soft_anewarray_node,
8258 soft_multianewarray, soft_newarray_node, soft_throw_node): New
8259 global variables initialized.
8260 (find_local_variable): Handles the case of a pointer
8261 (end_java_method): Restore the use of one more scope
8262 * expr.c (build_java_arraynull_check, build_java_arrayaccess,
8263 build_java_array_length_access, expand_java_arrayload,
8264 expand_java_arraystore, expand_java_array_length,
8265 expand_java_multianewarray, expand_java_anewarray,
8266 build_java_check_indexed_type, is_array_type_p,
8267 build_java_throw_out_of_bound_exception): New functions.
8268 (STORE_INTERNAL): Now forces type of the decl to be type of the value.
8269 (OPCODE_arraylength, OPCODE_newarray, OPCODE_<t>astore,
8270 OPCODE_<t>aload): Implemented code for verification.
8271 (ARRAY_STORE, ARRAY_LOAD, ARRAY_LENGTH, ARRAY_NEW_PTR, ARRAY_NEW_NUM
8272 ARRAY_NEW_MULTI): Macro defined.
8273 (CONVERT): Modified to invoke convert().
8274 (case OPCODE_aload2): Fixed index typo from 2 to 1.
8276 Thu Jul 31 12:48:18 1997 Per Bothner <bothner@cygnus.com>
8278 * class.c (push_class): Set DECL_ARTIFICIAL (for dbxout.c).
8279 (build_class_ref, is_compiled_class): Handle pointer-to-record types.
8280 (make_class_data): Field name needs '/' as package prefix.
8281 * expr.c (type_stack_dup, java_stack_dup): Fix fencepost errors.
8283 Fri Jul 25 11:44:21 1997 Per Bothner <bothner@cygnus.com>
8285 Implement debug information for local variables.
8286 * java-tree.h (DECL_CODE_LENGTH, DECL_ARG_SLOT_COUNT,
8287 DECL_LOCAL_SLOT_NUMBER, DECL_LOCAL_START_PC, DECL_LOCAL_END_PC,
8288 DECL_LOCAL_SLOT_CHAIN): New macros.
8289 (struct lang_decl_var): New type.
8290 * parse.c (give_name_to_locals): Move to decl.c.
8291 * decl.c (give_name_to_locals): Re-written to Do The Right Thing.
8292 (start_java_method): Re-write parameter handling.
8293 (pending_local_decls): New global variable.
8294 (push_jvm_slot, maybe_pushlevels, maybe_poplevels): New functions.
8295 (find_local_variable): Accept pc so we can skips decls not in range.
8296 (struct binding_level): Add end_pc field.
8297 * expr.c (expand_byte_code): Call maybe_pushlevels and maybe_poplevels.
8298 (various): Change so current pc gets passed to find_local_variable.
8300 * decl.c (init_decl_processing): Re-arrange fields in
8301 class_type_node and and method_type_node to match kaffe 0.9.1.
8302 * class.c (make_method_value, make_class_data): Update
8303 initializations to match.
8305 Wed Jul 16 17:17:50 1997 Per Bothner <bothner@cygnus.com>
8307 * class.c (unicode_mangling_length, emit_unicode_mangled_name,
8308 append_gpp_mangled_name, append_gpp_mangled_type): New functions.
8309 (push_super_field): New function.
8310 (make_class_data): Handle inheritance of class static initializer.
8311 (layout_class): New name mangling.
8312 * constants.c (build_constant_data_ref): Init type of data array
8313 to a one-element array.
8314 (build_constants_constructor): Set DECL_SIZE from complete array type.
8315 * decl.c: Rename class_type, object_type etc to class_type_node,
8316 object_type_node etc. Make former inherit from latter.
8317 * expr.c (expand_invoke): Add cast of function address.
8318 * java-tree.h (TYPE_ARRAY_ELEMENT, PUSH_SUPER_VALUE): New.
8319 * parse.c (yyparse): Don't call layout_class here.
8320 * typeck.c (build_java_array_type): Set TYPE_ARRAY_ELEMENT.
8322 Sat Jun 14 12:06:57 1997 Per Bothner <bothner@cygnus.com>
8324 * decl.c, class.c: Update method type to match latest Kaffe snapshot.
8325 * constants.c (lookup_name_constant): Renamed to alloc_name_constant.
8326 (alloc_class_constant): New.
8327 * expr.c (expand_invoke): Make sure method's class is initialized.
8328 * class.c (interits_from_p, emit_register_class): New functions.
8329 * parse.c (yyparse): Call emit_register_class.
8331 Mon Jun 9 18:08:06 1997 Per Bothner <bothner@cygnus.com>
8333 * constants.c: New file, to handle constant pool.
8334 * Makefile.in (JAVA_OBJS): Add constants.o.
8335 * decl.c (init_decl_processing): Update, fix, finish various structs.
8336 (pushdecl_top_level): New.
8337 * parse.c (layout_class): Moved to class.c.
8338 * expr.c (java_push_constant_from_pool): New function.
8339 * class.c (build_class_ref): Make work fully
8340 (make_class_data): Emit super-class, constant pool, interface vector.
8342 Tue Jun 3 10:14:31 1997 Per Bothner <bothner@cygnus.com>
8344 java-tree.h (DECL_SIGNATURE, BCODE_EMITTED): Remove.
8345 (LABEL_VERIFIED, BCODE_EXCEPTION_TARGET, TYPE_ARRAY_P): New.
8346 * class.c (class_depth): New function.
8347 (lookup_named_class): Replaced by new function lookup_class.
8348 * decl.c (object_type_node, string_type_node): New.
8349 Remove various types that we no longer need.
8350 * expr.c (verify_jvm_instructions): New separate verifier pass.
8351 (push_type, pop_type): New functions for verifier.
8352 (type_stack_dup, pop_argument_types, merge_types): Likewise.
8353 (expand_byte_code): Simplify, since we assume already verified.
8354 (expand_invoke): Now mostly works.
8355 * javaop.def: Rename ldc1->ldc, ldc2->ldc_w, ldc2w->ldc2_w.
8356 * lang.c (main_class): Move to parse.c. Don't make_class yet.
8357 * parse.c: Wait to allocate class object until we know its name.
8358 (layout_class): Calculate DECL_VINDEX for each virtual method.
8359 * typeck.c (get_array_type): Rename to ...
8360 (build_java_array_type): ... and provide working implementation.
8361 (build_java_signature): New function - build Java signature of type.
8362 (set_java_signature): New function - cache signature with type.
8363 (lookup_java_method): New function.
8365 Tue May 6 22:08:24 1997 Per Bothner <bothner@deneb.cygnus.com>
8367 * class.c (ident_subst): Take extra SUFFIX parameter.
8368 (add_field): Set DECL_ASSEMBLER_NAME of static fields; more.
8369 (set_constant_value, build_static_field_ref, is_compiled_class): New.
8370 (build_class_ref): Actually implement.
8371 * decl.c, java-tree.h: Renamed some xx_type to xx_type_node.
8372 * decl.c (builtin_function): New.
8373 (init_decl_processing): Update for current Kaffe. Declare some
8374 builtin Kaffe functions.
8375 * expr.c (build_address_of): New.
8376 (expand_java_NEW, expand_java_INSTANCEOF, expand_java_CHECKCAST):
8377 Renamed (from expand_java_new etc), and added working implementations.
8378 (build_field_ref): Now also handle static fields.
8379 (expand_invoke): Implement invokestatic, and start implement rest.
8380 * java-opcodes.h: Use javaop.def to avoid duplicated list.
8381 * javaop.def: Rename invokevirt -> invokevirtual.
8382 * lang.c (use_handles): Removed.
8383 * parse.c: Add support for ConstantValue atribute.
8384 Handle nested loading of a class. (JPOOL_UTF): New.
8386 Tue Mar 11 20:11:05 1997 Per Bothner <bothner@deneb.cygnus.com>
8388 * expr.c (expand_java_pushc): Support #ifndef REAL_ARITHMETIC case.
8390 Thu Feb 27 14:24:29 1997 Per Bothner <bothner@deneb.cygnus.com>
8392 * Make-lang.in (java.install-man): New empty rule.
8393 * typeck.c (set_local_type): New function.
8394 * expr.c (STORE_INTERNAL): Call find_local_variable,
8395 not find_stack_slot. Call set_local_type.
8397 Wed Feb 12 16:11:05 1997 Per Bothner <bothner@kalessin.cygnus.com>
8399 * java-tree.h: Various new macros for constructing RECORD_TYPEs,
8400 and building RECORD_TYPE CONSTRUCTORs.
8401 Also support for creating Utf8Const objects from an INDETIFIER_NODE.
8403 * lang.c (use_handles): Change the default to 0.
8404 * decl.c: Define and build class_type, field_type, utf8const_type.
8405 * class.c (make_class_data, make_field_value,
8406 get_access_flags_from_decl, build_class_ref, build_utf8_ref,
8407 hashUtf8String, strLengthUtf8, mangled_classname:
8408 Functions to build reflective data structures.
8409 * parse.c (yyparse): Call make_class_data.
8411 * jcf-io.c (open_class, find_classfile): New functions.
8412 * jcf-dump.c: Support reading classfile from explicitly-named
8413 class file (without CLASSPATH searching).
8415 Thu Oct 24 14:10:16 1996 Per Bothner <bothner@deneb.cygnus.com>
8417 * jcf-reader.c: Add parameter list to HANDLE_CONSTANT_Utf8.
8418 * parse.c (JPOOL_UTF_LENGTH, JPOOL_UTF_DATA, HANDLE_CONSTANT_Utf8):
8419 Override jcf-reader macros so CONSTANT_Utf8 becomes tree node here.
8420 (get_constant): Now trivial for CONSTANT_Utf8.
8422 * jcf.h: Make NEW_CPOOL the default.
8423 * jcf.h, jcf-reader.c, parse.c: Remove support for !NEW_CPOOL.
8425 Thu Oct 24 13:52:45 1996 Per Bothner <bothner@deneb.cygnus.com>