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