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