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