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