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