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