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