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