Commit Graph

109 Commits

Author SHA1 Message Date
Alexandre Petit-Bianco
efa0a23fc2 parse.y (method_header:): Issue error message for rule `type error'.
Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (method_header:): Issue error message for rule `type
 	error'.
	(synchronized:): Error report when not using synchronized.

From-SVN: r30343
1999-11-01 23:51:19 -08:00
Alexandre Petit-Bianco
f63991a86a re GNATS gcj/48 (Compiler fails to catch constructor problem)
Mon Nov  1 01:32:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (resolve_qualified_expression_name): Prevent `this'
 	from being before the superclass constructor has been called.

(This fixes the net PR #48:
 http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00106.html)

From-SVN: r30317
1999-11-01 01:45:18 -08:00
Alexandre Petit-Bianco
8119c72007 parse.y (expression_statement:): Call function to report improper invocation of a constructor.
Fri Oct 29 14:23:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (expression_statement:): Call function to report
 	improper invocation of a constructor.
	(parse_ctor_invocation_error): New function.

From-SVN: r30267
1999-10-29 14:32:28 -07:00
Alexandre Petit-Bianco
ac22f9cb2c re GNATS gcj/56 (gcj segfaults in jc1 on OK java file)
Thu Oct 21 01:27:31 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (resolve_qualified_expression_name): Handle MODIFY_EXPR.
	(qualify_ambiguous_name): Likewise.

This fixes the net PR #56
(http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00131.html)

From-SVN: r30127
1999-10-21 23:06:47 -07:00
Alexandre Petit-Bianco
100f7cd8b9 re GNATS gcj/37 (gcj fails to compile "jBYTEmark" from source code when optimization is used)
Wed Oct 20 01:41:47 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (java_complete_tree): fold_constant_for_init to work on
 	permanent_obstack.
	(java_complete_lhs): Likewise.
	(array_constructor_check_entry): Complete an initializer element
 	on permanent_obstack.

This patch fixes the net PR #37
(http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00043.html)

From-SVN: r30126
1999-10-21 22:27:34 -07:00
Kaveh R. Ghazi
1ebadc609b jcf-dump.c (print_constant, [...]): Don't call a variadic function with a non-literal format string.
* jcf-dump.c (print_constant, disassemble_method): Don't call a
	variadic function with a non-literal format string.

	* parse-scan.y (report_main_declaration): Likewise.

	* parse.h (ERROR_CAST_NEEDED_TO_INTEGRAL): Likewise.

	* parse.y (read_import_dir, patch_assignment, patch_binop,
	patch_array_ref): Likewise.

	* typeck.c (build_java_array_type): Likewise.

	* verify.c (verify_jvm_instructions): Likewise.

From-SVN: r29981
1999-10-14 17:13:57 +00:00
Alexandre Petit-Bianco
b771925e7e re GNATS gcj/46 (Static inializers compiled incorrectly)
Thu Sep 16 15:42:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (java_method_add_stmt): Test against GET_CURRENT_BLOCK
 	instead of fndecl.

(This patch fixes the net Java PR #46:
 http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00092.html)

From-SVN: r29550
1999-09-21 08:53:23 -07:00
Kaveh R. Ghazi
c2e3db9254 gjavah.c (get_field_name, [...]): Use xmalloc, not malloc.
* gjavah.c (get_field_name, print_method_info, print_include,
	add_namelet): Use xmalloc, not malloc.

	* jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
	(munge): Use xrealloc, not realloc, trust xrealloc to handle a
	NULL pointer.

	* jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.

	* jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.

	* jcf-path.c (add_entry): Likewise.

	* jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.

	* jv-scan.c (xmalloc): Remove definition.

	* jvgenmain.c (xmalloc): Likewise.

	* jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.

	* lex.c (java_store_unicode): Use xrealloc, not realloc.

	* parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
	concat, not xmalloc/sprintf.
	(java_push_parser_context): Use xcalloc, not xmalloc/bzero.
	(xstrdup): Remove definition.

	* parse.y (duplicate_declaration_error_p,
	constructor_circularity_msg, verify_constructor_circularity,
	check_abstract_method_definitions, java_check_regular_methods,
	java_check_abstract_methods, patch_method_invocation,
	check_for_static_method_reference, patch_assignment, patch_binop,
	patch_cast, array_constructor_check_entry, patch_return,
	patch_conditional_expr): Use xstrdup, not strdup.

	* zextract.c (ALLOC): Use xmalloc, not malloc.

From-SVN: r29457
1999-09-16 15:45:15 +00:00
Alexandre Petit-Bianco
f4e16489df re GNATS gcj/18 (Internal error: segfault on invalid cast)
Sat Sep 11 16:46:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (find_applicable_accessible_methods_list): Search
        abstract classes as interfaces.

(Fix to Java PR #18:
 http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00015.html)

From-SVN: r29352
1999-09-11 20:20:31 -07:00
Tom Tromey
2f11d4079a parse.y (strip_out_static_field_access_decl): Return operand if it satisfies JDECL_P.
* parse.y (strip_out_static_field_access_decl): Return operand if
	it satisfies JDECL_P.

From-SVN: r29086
1999-09-03 17:18:11 +00:00
Kaveh R. Ghazi
d593dd8c6a class.c (finish_class): Remove unused parameter, all callers changed.
* class.c (finish_class): Remove unused parameter, all callers
	changed.

	* expr.c (build_java_athrow): Change return type to void.
	(java_lang_expand_expr): Make sure each case in switch returns a
	value.

	* java-tree.h (finish_class): Fix prototype to take void args.

	* jcf-dump.c (usage): Mark with ATTRIBUTE_NORETURN.
	(main): Issue return from main, not exit.

	* jcf-parse.c (parse_class_file): Fix call to `finish_class'.

	* jcf.h (jcf_unexpected_eof): Mark with ATTRIBUTE_NORETURN.

	* jv-scan.c (main): Issue return from main, not exit.

	* parse.y (check_abstract_method_definitions,
	java_check_abstract_method_definitions): Add static prototypes.
	(java_complete_expand_methods): Fix call to `finish_class'.

	* verify.c (verify_jvm_instructions): Initialize variables `oldpc'
	and `prevpc'.

From-SVN: r29065
1999-09-02 21:57:09 +00:00
Alexandre Petit-Bianco
f441f67120 re GNATS gcj/32 (A boolean expression containing two qualified expressions makes jc1 die.)
Thu Aug 26 09:10:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (lookup_cl): Changed leading comment. Now does its best
        to set the column number.
        (qualify_ambiguous_name): Take WFL wrappers into account.

This patch fixes the Java net PR #32.

From-SVN: r28894
1999-08-26 09:51:49 -07:00
Kaveh R. Ghazi
be245ac0a0 gjavah.c (print_name, [...]): Add static prototype.
* gjavah.c (print_name, print_base_classname, utf8_cmp,
	cxx_keyword_subst, generate_access, name_is_method_p,
	get_field_name, print_field_name, super_class_name, print_include,
	decode_signature_piece, print_class_decls, usage, help,
	java_no_argument, version, add_namelet, print_namelet): Add static
	prototype.
	(print_base_classname, utf8_cmp, cxx_keyword_subst,
	name_is_method_p): Constify a char*.
	(get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
	Provide a final else clause in an if-else-if.
	(print_field_info): Add missing final arg in function call to
	`print_field_name'.
	(print_method_info, decompile_method, decode_signature_piece,
	print_c_decl, print_full_cxx_name, print_stub,
	print_mangled_classname, super_class_name, print_include,
	add_namelet, add_class_decl, print_class_decls, process_file,
	help): Constify a char*.

	* jcf-write.c (jcf_handler, push_constant1, push_constant2,
	push_int_const, find_constant_wide, find_constant_index,
	push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
	emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
	emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
	emit_if, emit_goto, emit_jsr, call_cleanups,
	make_class_file_name): Add static prototypes.
	(generate_bytecode_return, generate_bytecode_insns): Pass a
	NULL_PTR, not a NULL_TREE.

	* jv-scan.c: Include "jcf.h".
	(main): Declare using DEFUN macro.

	* jvspec.c (find_spec_file, lang_specific_pre_link,
	lang_specific_driver): Add prototypes.
	(find_spec_file): Constify a char*.

	* keyword.gperf (hash, java_keyword): Add prototypes.

	* lang.c (lang_print_error): Add static prototype.
	(lang_init): Prefer memcpy over bcopy to avoid casts.

	* lex.c (yylex): Add static prototype.

	* parse-scan.y: Include "lex.c" earlier.

	* parse.h: Remove redundant declaration for `yylex'.

	* parse.y (java_decl_equiv, binop_compound_p, search_loop,
	labeled_block_contains_loop_p): Add static prototypes.
	(not_accessible_p): Make static to match prototype.

	* verify.c (start_pc_cmp): Don't needlessly cast away const.

From-SVN: r28862
1999-08-25 13:59:28 +00:00
Alexandre Petit-Bianco
d77613be8b re GNATS gcj/30 (gcj not reporting unimplemented methods)
Sun Aug 22 11:07:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* parse.y (check_method_redefinition): Changed leading comment.
	(check_abstract_method_definitions): New function.
	(java_check_abstract_method_definitions): New function.
	(java_check_regular_methods): Call it.
	(verify_constructor_super): Fixed indentation.
	(lookup_method_invoke): Likewise.

(This fixes the Java net PR #30,
 http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00034.html)

From-SVN: r28805
1999-08-22 11:38:07 -07:00
Alexandre Petit-Bianco
79d133336a re GNATS gcj/17 (Internal error: segfault on import-classname clash)
Thu Aug 19 10:26:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (method_header): Return a null pointer if the current
        class node is null.
        (finish_method_declaration): Return if the current function decl
        is null.
        (source_start_java_method): Likewise.
        (java_method_add_stmt): Likewise.

This fixes the net PR #17.

From-SVN: r28765
1999-08-19 13:37:04 -07:00
Alexandre Petit-Bianco
5cbdba6424 [multiple changes]
Wed Aug 18 13:17:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

	* class.c (emit_register_class): Removed unnecessary call to
 	start_sequence.
	* parse.y (labeled_block_contains_loop_p): Removed unused local
 	variable.

Tue Aug 17 22:51:44 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (java_refold): Added prototype.

Tue Aug 17 21:48:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (BINOP_COMPOUND_CANDIDATES): New macro.
        (java_stabilize_reference): Removed unnecessary `else'.
        (java_complete_lhs): Set flag to remember boolean. Call
        java_refold. Added comments.
        (java_decl_equiv): New function.
        (binop_compound_p): Likewise.
        (java_refold): Likewise.
        (patch_unaryop): Striped static field access assigned to decl and
        op. Changed promotion scheme for ++/-- operators.
        (search_loop): New function.
        (labeled_block_contains_loop_p): Likewise.
        (patch_loop_statement): Call labeled_block_contains_loop_p. Added
        comment.
        (patch_bc_statement): Call search_loop. Fixed comment.

Mostly bug fixes in some forms of compound expressions and
break/continue target lookup.

From-SVN: r28758
1999-08-18 17:53:20 -07:00
Kaveh R. Ghazi
49f48c719e Warning fixes:
* Makefile.in (lang.o): Depend on $(RTL_H) $(EXPR_H).

        * expr.c (java_stack_pop, java_array_data_offset,
        build_java_throw_out_of_bounds_exception, case_identity,
        build_java_check_indexed_type): Add static prototypes.
        (linenumber_table, expand_invoke, expand_java_field_op,
        build_primtype_type_ref, expand_byte_code): Constify a char*.

        * java-tree.h (build_primtype_type_ref, linenumber_table):
        Constify a char*.
        (java_lang_expand_expr): Add prototype.

        * lang.c: Include rtl.h and expr.h.  Remove extern prototype for
        `java_lang_expand_expr'.

        * lex.c (java_lex_error): Constify a char*.
        (java_get_unicode, java_read_char, java_allocate_new_line,
        java_unget_unicode, java_sneak_unicode): Prototype.

        * parse-scan.y (current_class, package_name, method_declarator,
        report_class_declaration, yyerror): Constify a char*.

        * parse.h (java_report_errors): Prototype.
        (yyerror): Constify a char*.

        * parse.y (classitf_redefinition_error, check_modifiers,
        parse_jdk1_1_error, lookup_package_type,
        lookup_package_type_and_set_next, get_printable_method_name,
        purify_type_name): Constify a char*.
        (build_super_invocation, maybe_generate_finit,
        verify_constructor_super, parser_add_interface,
        add_superinterfaces, jdep_resolve_class, note_possible_classname,
        java_complete_expand_methods, java_expand_finals,
        cut_identifier_in_qualified, java_stabilize_reference,
        do_unary_numeric_promotion, operator_string, do_merge_string_cste,
        merge_string_cste): Prototype.
        (single_type_import_declaration, yyerror,
        variable_redefinition_error, build_array_from_name,
        build_unresolved_array_type, check_class_interface_creation,
        resolve_class, complete_class_report_errors,
        note_possible_classname, read_import_dir,
        find_in_imports_on_demand, resolve_package, fix_constructors,
        check_deprecation, lookup_method_invoke,
        maybe_build_primttype_type_ref, array_constructor_check_entry):
        Constify a char*.
        (java_complete_expand_methods, java_expand_finals): Make static.
        (convert_narrow): Remove static prototype.

From-SVN: r28498
1999-08-04 13:30:51 +00:00
Richard Henderson
0ae70c6a94 decl.c: Include defaults.h instead of expr.h.
* decl.c: Include defaults.h instead of expr.h.
        * parse.y: Likewise.

From-SVN: r28431
1999-08-02 17:57:50 -07:00
Jakub Jelinek
e438e1b788 Jakub Jelinek <jj@ultra.linux.cz>
* java/decl.c (start_java_method): Change all uses of
        PROMOTE_PROTOTYPES, so that it tests it as a C expression.
        Ensure expr.h is included.
        * java/expr.c (pop_arguments): Ditto.
        * java/parse.y (expand_start_java_method): Ditto.

From-SVN: r28419
1999-08-02 16:14:31 -07:00
Bernd Schmidt
b384405b34 Backport of GC branch patches part 1: kill eh status saving.
From-SVN: r28357
1999-07-31 12:46:53 +00:00
Kaveh R. Ghazi
cd531a2edd Warning fixes:
* expr.c (build_java_soft_divmod): Provide a default case in switch.
        (java_lang_expand_expr): Mark parameters `target', `tmode' and
        `modifier' with ATTRIBUTE_UNUSED.

        * gjavah.c (process_file): Add braces around ambiguous `else'.

        * jcf-dump.c (print_access_flags, localvar_free): Change return
        type to void.

        * parse.y (java_complete_expand_method): Initialize variable
        `exception_copy'.
        (resolve_qualified_expression_name): Likewise for `field_decl'.
        (patch_method_invocation): Likewise for `class_to_search'.
        (qualify_ambiguous_name): Likewise for `name' and `ptr_type'.
        (patch_assignment): Likewise for `lhs_type'.

        * verify.c (verify_jvm_instructions): Remove unused variable
        `caller'.

From-SVN: r28344
1999-07-30 18:31:34 +00:00
Andrew Haley
0b094f655a lang.c (flag_use_divide_subroutine): New variable.
1999-07-15  Andrew Haley  <aph@cygnus.com>

        * lang.c (flag_use_divide_subroutine): New variable.
        * typeck.c: (convert_ieee_real_to_integer): Bounds check
        fp-to-integer conversion.
        (convert): Call convert_ieee_real_to_integer when flag_fast_math
        is not set.

        * expr.c (build_java_soft_divmod): New function.
        (build_java_binop): Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (init_decl_processing) Initialize the new builtins.
        * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (build_java_soft_divmod): New function.
        * parse.y: Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * parse.c: Rebuilt.

        * jvspec.c (lang_specific_driver): Always allow an extra arg (for
        a --specs= arg) even if not linking.
        * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
        -fuse-divide-subroutine

From-SVN: r28209
1999-07-21 14:51:24 +00:00
Alexandre Petit-Bianco
7705e9db01 re GNATS gcj/12 (gcj accepts invalid code where an exception must be caught/thrown)
Tue Jul 20 13:20:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (resolve_and_layout): Check methods only once.
        (resolve_qualified_expression_name): Verify thrown exceptions
        compatibility.
        (check_thrown_exceptions): Reject exceptions thrown in
        initializer. Error message tuned.

(This fixes PR #12. Libgcj's java/net must be updated in order to compiles
 with a patch at this URL:
 http://sourceware.cygnus.com/ml/java-patches/1999-q3/msg00048.html)

From-SVN: r28196
1999-07-20 13:56:10 -07:00
Alexandre Petit-Bianco
1a6d4fb73c [multiple changes]
Sat Jul  3 22:26:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* expr.c (force_evaluation_order): Save the COMPOUND_EXPR'ed
 	CALL_EXPR, to avoid order of evaluation changes.
Fri Jul  2 17:44:08 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (qualify_ambiguous_name): Do not use
 	IDENTIFIER_LOCAL_VALUE when name is a STRING_CST.
Thu Jul  1 23:31:16 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* check-init.c (check_init): Handle MAX_EXPR.
	* expr.c (force_evaluation_order): Force method call arguments to
 	be evaluated in left-to-right order.
	* parse.y (qualify_ambiguous_name): Loop again to qualify
 	NEW_ARRAY_EXPR properly.
Wed Jun 30 17:27:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (patch_invoke): Resolve unresolved invoked method
 	returned type.
	(qualify_ambiguous_name): STRING_CST to qualify expression for
 	type name resolution.

From-SVN: r27998
1999-07-07 06:11:03 -07:00
Alexandre Petit-Bianco
2c56429a68 [multiple changes]
Fri Jun 25 13:35:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (resolve_package): Fixed bogus return statement.
	(patch_method_invocation): Resolve method invocation beginning with
 	a package name qualifier.
Thu Jun 24 13:12:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (java_complete_lhs): When doing cross referencing, don't
 	try to keep file location on a WFL expanded as a CALL_EXPR.
Wed Jun 23 14:37:15 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (finish_method_declaration): Insert a RETURN_EXPR when
 	compiling to class file a void method with an empty method body.
  	As a side effect, the bytecode backend will generate the
 	appropriate `return' instruction.
Tue Jun 22 20:43:49 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (lookup_package_type_and_set_next): New function prototype.
	(resolve_package): Search current and imported packages.
	(lookup_package_type_and_set_next): New function.

From-SVN: r27773
1999-06-25 09:33:20 -07:00
Andrew Haley
45b0aa3189 verify.c (verify_jvm_instructions): Check for pending blocks before invalid PC test and opcode switch, not after.
1999-06-22  Andrew Haley  <aph@cygnus.com>
	* verify.c (verify_jvm_instructions): Check for pending blocks
	before invalid PC test and opcode switch, not after.

From-SVN: r27710
1999-06-22 23:22:13 +00:00
Alexandre Petit-Bianco
8576f0942e [multiple changes]
Mon Jun 14 13:13:39 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (qualify_ambiguous_name): Reorganized the post
 	evaluation of non WFL leading expression nodes.
Fri Jun 11 21:37:18 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (qualify_ambiguous_name): Handle ARRAY_REF after
 	CONVERT_EXPR.
Thu Jun 10 22:26:17 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (qualify_ambiguous_name): Handle qualified expression
 	beginning with a STRING_CST.
Thu Jun 10 20:27:25 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (register_fields): Set DECL_INITIAL on both
 	pre-initialized static and public fields.
	(resolve_field_access): Static field access expressions to always
 	use pointer types.
	(qualify_ambiguous_name): Work out buried CALL_EXPR for proper
 	qualification. CONVERT_EXPR to be resolved as an expression name.
	(java_complete_lhs): Identify and access qualified final
 	initialized field in switch statement case expression.
	(fold_constant_for_init): Pre-initialized field decl constant to
 	be folded.

From-SVN: r27523
1999-06-14 10:15:35 -07:00
Alexandre Petit-Bianco
fe0e4d76c2 parse.y (note_possible_classname): Mark returned node with QUALIFIED_P only if the original class name contained a '/'.
Mon Jun  7 16:09:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (note_possible_classname): Mark returned node with
 	QUALIFIED_P only if the original class name contained a '/'.

From-SVN: r27396
1999-06-07 10:08:34 -07:00
Alexandre Petit-Bianco
930248932e [multiple changes]
Fri May 28 18:22:45 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (lookup_field_wrapper): Unified returned value to NULL
          or the searched field decl.
Fri May 28 11:34:05 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (fold_constant_for_init): Convert numerical constant
        values to the type of the assigned field.
Thu May 27 19:57:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * expr.c (lookup_field): Relaxed the test on class loading error
        detection.
        * parse.y (fold_constant_for_init): Enabeled old code.
Wed May 26 18:06:02 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
        decide the validity of the cast of a java.lang.Cloneable reference
        to an array.
        (patch_conditional_expr): Fixed first argument passed to
        binary_numeric_promotion.

From-SVN: r27229
1999-05-28 12:26:08 -07:00
Alexandre Petit-Bianco
2ba1f15fb9 parse.y (qualify_ambiguous_name): Take into account that a CONVERT_EXPR might specify a type as a WFL.
Wed May 26 15:33:06 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (qualify_ambiguous_name): Take into account that a
        CONVERT_EXPR might specify a type as a WFL.

From-SVN: r27181
1999-05-26 08:41:34 -07:00
Alexandre Petit-Bianco
dc4e6ccfe5 [multiple changes]
Tue May 25 15:06:13 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (patch_assignment): Save the rhs before using it as an
        argument to _Jv_CheckArrayStore.
Tue May 25 11:23:59 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* lex.c (java_parse_doc_section): Fixed `tag' buffer size.
Mon May 24 13:26:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * lex.c (java_lex): Accepts `+' or `-' after the beginning of a
        floating point litteral only when the exponent indicator has been
        parsed.

From-SVN: r27147
1999-05-25 09:36:07 -07:00
Alexandre Petit-Bianco
5256aa37b4 [multiple changes]
Sat May 22 13:54:41 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (formal_parameter:): Construct argument tree list
 	element even if a yet unsupported final parameter was encountered.
Tue May 18 00:28:58 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (finish_method_declaration): Issue errors for native or
 	abstract methods declared with a method body, as well as for non
 	native or non abstract methods with no method body.

From-SVN: r27104
1999-05-22 07:38:13 -07:00
Kaveh R. Ghazi
ab3a6dd6e2 Warning fixes:
* class.c (build_utf8_ref): Initialize variable `field'.
        * decl.c (init_decl_processing): Initialize variable `field'.
        * expr.c (build_known_method_ref): Mark parameters `method_type',
        `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
        (process_jvm_instruction): Likewise for parameter `length'.
        * jvspec.c (lang_specific_driver): Mark variables `saw_math',
        `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
        ATTRIBUTE_UNUSED.
        * parse.y (maybe_generate_clinit): Remove unused variable
        `has_non_primitive_fields'.
        (find_in_imports_on_demand): Initialize variables `node_to_use'
        and `cl'.
        (patch_binop): Likewise for variable `prom_type'.
        (patch_unaryop): Likewise for variable `prom_type'.
        * verify.c (verify_jvm_instructions): Likewise for variable `last'.
        * xref.c (xref_table): Add missing initializer.

From-SVN: r27030
1999-05-19 11:30:30 +00:00
Alexandre Petit-Bianco
2e5eb5c578 parse.y (constructor_block_end:): New rule, tagged <node>.
Mon May 17 19:20:24 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (constructor_block_end:): New rule, tagged <node>.
        (constructor_body:): Use `constructor_block_end' instead of
        `block_end'.

From-SVN: r26978
1999-05-17 12:33:13 -07:00
Alexandre Petit-Bianco
6efa1cc273 parse.y (statement_nsi:): Pop `for' statement block.
Mon May 17 18:01:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (statement_nsi:): Pop `for' statement block.
	(java_complete_lhs): Labelled blocks containing no statement are
 	marked as completing normally.
(Part of the previous check-in, where the generated parse.c was
forgotten.)

From-SVN: r26977
1999-05-17 11:32:30 -07:00
Alexandre Petit-Bianco
1fb89a4d59 parse.y (java_check_regular_methods): Warning check on not overriding methods with default access in other packages...
Thu May 13 18:30:48 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (java_check_regular_methods): Warning check on not
 	overriding methods with default access in other packages does not
 	apply to `<clinit>'.
	(java_complete_lhs): If block body is an empty_stmt_node, replace
 	it by NULL_TREE. This avoid gcc generating an irrelevant warning.

From-SVN: r26930
1999-05-13 12:01:19 -07:00
Alexandre Petit-Bianco
ce6e914727 check-init.c (check_init): Removed code accepting to see things falling through default:, when doing xrefs.
Thu May 13 13:23:38 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* check-init.c (check_init): Removed code accepting to see things
	falling through default:, when doing xrefs.
	* java-tree.h (do_not_fold): New global variable, declared.
	* parse.y (do_not_fold): New global variable, defined.
	(java_complete_expand_method): Set `do_not_fold' to the value of
 	`flag_emit_xref'. When doing xrefs: copy the thrown exceptions,
 	and reinstall them after them have been purged; do not check for
 	initializations; do not issue missing return errors.
	(java_complete_lhs): Do not attempt to patch INSTANCEOF_EXPR nodes
 	when doing xrefs.
	(patch_binop): Skip the fold part when doing xrefs.
	(build_string_concatenation): Skip the concatenation part when
 	doing xrefs.
	(patch_synchronized_statement): Do not generate a try-finally when
 	doing xrefs.
	(patch_throw_statement): When doing xrefs, do not call BUILD_THROW
 	and keep the location where the throw was seen.
	* typeck.c (convert): When `do_not_fold' is set, do not attempt
 	any treatment on the converted node an simply return a NOP_EXPR of
 	the targeted type.
	* xref.c (xref_get_data): New function, defined.
	* xref.h (xref_get_data): New function, declared.
	(XREF_GET_DATA): Use xref_get_data.

From-SVN: r26926
1999-05-13 07:33:37 -07:00
Andrew Haley
138657ecb0 parse.y (source_end_java_method): If the current method contains any exception handlers...
1999-05-11  Andrew Haley  <aph@cygnus.com>
        * parse.y (source_end_java_method): If the current method contains
        any exception handlers, force asynchronous_exceptions: this is
        necessary because signal handlers in libjava may throw exceptions.
        * decl.c (end_java_method): Ditto.

From-SVN: r26884
1999-05-11 12:09:13 +00:00
Per Bothner
cd9643f75b class.c (make_field_value): DECL_INITIAL may be a string literal...
d
	* class.c (make_field_value):  DECL_INITIAL may be a string literal;
	temporarily zero it while calling rest_of_decl_compilation.
	* java-tree.h (string_ptr_type_node):  Add declaration.
	* decl.c:  Define and initialize string_ptr_type_node.
	* parse.y (patch_string_cst):  Use string_ptr_type_node.
	* parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P):  Removed.
	* parse.y (for_statement):  Now unconditionally exit_block.
	(finish_labeled_statement):  No longer exit_block if for-loop.
	(patch_loop_statement):  Check harder if the loop is already labeled.
	* parse.y (patch_initialized_static_field):  Removed function.
	(maybe_generate_clinit):  Removed special handling for interfaces.
	(java_complete_expand_methods):  Do a preliminary java_complete_tree
	on <clinit> to determine if it can be removed.
	(java_complete_expand_method):  Remove special handling for <clinit>.
	(java_complete_lhs):  For BLOCK and EXPR_WITH_FILE_LOCATION
	optimize if we get back empty_stmt_node.
	For MODIFY_EXPR, re-do checking of static initializers.
	(fold_constant_for_init):  Don't return immediate if VAR_DECL.
	For VAR_DECL, pass correct context.

From-SVN: r26790
1999-05-05 14:10:07 -07:00
Alexandre Petit-Bianco
7f10c2e2fc check-init.c (check_init): Exclude a case of error when doing xrefs.
Fri Apr 30 17:54:40 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* check-init.c (check_init): Exclude a case of error when doing
 	xrefs.
	* class.c (layout_class_method): Don't generate the error message
 	twice when compiling from source.
	* lang-options.h: Added `-Wredundant-modifers' and
	`-Wunusupported-jdk11' flags and help text.
	* lang.c (lang_decode_option): Added support for
 	`-Wunsupported-jdk11' and `-Wredundant-modifiers'.
	flag_static_local_jdk11 and flag_redundant set accordingly.
	* lex.c (java_lex): Call BUILD_OPERATOR on CCB_TK.
	* parse.h (EXPR_WFL_ADD_COL): New macro.
	(DECL_END_SOURCE_LINE): Likewise.
	(DECL_INHERITED_SOURCE_LINE): Likewise.
	* parse.y (static_ref_err): New function, prototyped.
	(CCB_TK): Now tagged <operator>.
	(class_body:): Remember the location of the closing '}' of a class
 	definition when doing xrefs.
	(block:): Likewise.
	(block_end:): Likewise.
	(create_class): Remember the location of the inherited class
 	identifier when doing xrefs.
	(register_fields): Added test on first operand of `init' before
 	testing it TREE_CODE.
	(method_header): Store the location of the class identifier in the
 	class decl when doing xrefs.
	(finish_method_declaration): Don't combine first/last method line
 	when doing xref.
	(java_check_regular_methods): Warning check on not overriding
 	methods with default access on other packages move before check on
 	static methods. Initialization of `aflags' also moved up.
	(resolve_expression_name): Call static_ref_err to report the error.
	(static_ref_err): New function, implemented.
	(resolve_field_access): Returned simplified static field access
 	when doing xrefs.
	(resolve_qualified_expression_name): Check for illegal use of
 	static fields in a non static context. Call static_ref_err to
 	report error in various places.
	(java_complete_tree): To not fold initialized static fields when
 	doing xrefs.
	(java_complete_lhs): Likewise.

From-SVN: r26758
1999-05-03 09:45:18 -07:00
Alexandre Petit-Bianco
7f1d48663e class.c (layout_class_method): Generate <clinit>'s rtl for interfaces.
Sat Apr 24 16:50:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* class.c (layout_class_method): Generate <clinit>'s rtl for
 	interfaces.
	* decl.c (complete_start_java_method): Don't call _Jv_InitClass
 	for interfaces' <clinit>.
	* expr.c (lookup_field): Search for fields in interfaces.
	(expand_invoke): Fixed indentation.
	(expand_java_field_op): Likewise. Use IS_CLINIT.
	* parse.h (JPRIMITIVE_TYPE_OR_VOID_P): Macro removed.
	(IS_CLINIT): New macro.
	* parse.y (type_declaration:): Call maybe_generate_clinit after an
 	interface was parsed.
	(maybe_generate_clinit): Don't generate if the current class is an
 	interface with only fields of primitive types.
	(reset_method_name): Use IS_CLINIT.
	(java_complete_expand_method): Expand <clinit> when it exists for
 	interfaces. Use IS_CLINIT.
	(resolve_expression_name): Use DECL_CONTEXT instead of
 	current_class to build static field references.
	(java_complete_lhs): Use IS__CLINIT. Don't use SAVE_EXPR on
 	ARRAY_REF when doing xreferencing.
	(check_final_assignment): Fixed typo in leading comment. Use
 	IS_CLINIT.
	(patch_array_ref): Don't fully expand array references when
 	xreferencing.
	(patch_return): Use IS_CLINIT.
	(patch_throw_statement): Likewise.

From-SVN: r26661
1999-04-26 12:09:37 -07:00
Alexandre Petit-Bianco
5423609c57 decl.c (predef_filenames, [...]): New globals
Wed Apr 21 11:13:36 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* decl.c (predef_filenames, predef_filenames_size): New globals
	(init_decl_processing): predef_filenames and predef_filenames_size
 	initialized.
	* java-tree.h (predef_filenames, predef_filenames_size): Declared
 	extern.
	* jcf-parse.c (predefined_filename_p): New function.
	(yyparse): Check that files on the command line are specified only
 	once and issue a warning otherwise.
	* parse.h (JPRIMITIVE_TYPE_OR_VOID_P): New macro.
	* parse.y (source_end_java_method): Nullify NOP method bodies, to
 	avoid a gcc warning with -W -Wall turned on.
	(java_expand_classes): Abort if errors were encountered.
	(java_complete_lhs): If the cross reference flag is set, wrap
 	field DECL node around a WFL when resolving expression name.

From-SVN: r26578
1999-04-21 06:49:49 -07:00
Tom Tromey
a3f406ce4c xref.h (enum): Removed trailing comma.
* xref.h (enum): Removed trailing comma.
	* parse.y (resolve_qualified_expression_name): Added missing
	`break'.

From-SVN: r26546
1999-04-19 10:20:27 +00:00
Alexandre Petit-Bianco
b3edebcf49 parse.y (patch_unaryop): Fix ++ operator check on array references.
Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (patch_unaryop): Fix ++ operator check on array
 	references.

From-SVN: r26382
1999-04-12 11:32:22 -07:00
Alexandre Petit-Bianco
2622b94785 parse.y (patch_assignment): Added ArrayStoreException runtime check.
Tue Apr  6 15:15:51 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
        * parse.y (patch_assignment): Added ArrayStoreException runtime
        check.

From-SVN: r26318
1999-04-09 09:26:33 -07:00
Per Bothner
7c3f7c03af parse.y (patch_binop): Don't fold if non-constant and emiting class files.
�
	* parse.y (patch_binop):  Don't fold if non-constant and emiting
	class files.

From-SVN: r26215
1999-04-06 07:27:19 -07:00
Kaveh R. Ghazi
4504ead1db class.c (add_method_1): Cast the argument of `bzero' to PTR.
* class.c (add_method_1): Cast the argument of `bzero' to PTR.
        * decl.c (copy_lang_decl): Likewise for `bcopy'.
        * jcf-depend.c: Include "config.h", not <config.h>.
        * jcf-parse.c (jcf_figure_file_type): Cast the arguments of
        `bcopy' to PTR.
        * jcf-path.c: Include "config.h", not <config.h>.
        * lex.c: Don't include various system header files.
        (java_init_lex): Cast the argument of `bzero' to PTR
        * parse-scan.y (java_push_parser_context): Likewise.
        * parse.y (java_push_parser_context): Likewise.
        * xref.c: Don't include <stdio.h>.

From-SVN: r26203
1999-04-05 13:04:38 +00:00
Alexandre Petit-Bianco
d4370213f6 parse.y (struct parser_ctxt *ctxp): Now global.
Mon Apr  5 11:24:19 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (struct parser_ctxt *ctxp): Now global.
	(declare_local_variables): Use WFL compound value for the
 	declaration source line value, when doing cross-referencing.

From-SVN: r26201
1999-04-05 05:00:08 -07:00
Alexandre Petit-Bianco
1504b2b439 [multiple changes]
Tue Mar 30 11:31:53 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (patch_bc_statement): Fixed identation and a bogus
 	`printf' format.
Tue Mar 30 11:29:29 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.y (patch_assignment): Allow static variables in other
 	classes to be assigned.

From-SVN: r26065
1999-03-30 03:35:27 -08:00
Alexandre Petit-Bianco
f099f336d1 [multiple changes]
Sat Mar 27 15:13:21 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.h (EXPR_WFL_GET_LINECOL): Set a line and column count
 	using a WFL compound value.
	* parse.y (xref.h): Include.
	(maybe_create_class_interface_decl): Set DECL_SOURCE_LINE to the
 	WFL compound value.
	(register_fields): Set WFL compound value to lineno if doing
 	xrefs.
	(java_complete_expand_method): Call expand_xref if flag_emit_xref
 	is set.
	* xref.c (system.h, jcf.h, parse.h, obstack.h): Include.
	* xref.h (expand_xref): Prototype renamed from xref_generate.
Sat Mar 27 14:16:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
	* parse.h (BLOCK_CHAIN_DECL): New use GET_CURRENT_BLOCK.
	(GET_CURRENT_BLOCK): New macro.
	* parse.y (current_static_block): New global variable.
	(method_body:): Define action.
	(complete_method_declaration): Set current_function_decl to NULL
 	when work on the current method is done.
	(declare_local_variables): Use GET_CURRENT_BLOCK.
	(java_method_add_stmt): Likewise.
	(java_complete_expand_method): Disable the use of `this' when
 	expanding <clinit>.
	(enter_a_block): If no current method exist, use
 	current_static_block to link static initializer blocks.
	(exit_block): Rewritten to use current_static_block when no current
 	method decl exists.
	(lookup_name_in_blocks): Use GET_CURRENT_BLOCK.
	(patch_return): Forbid the use of `return' in static initializers.
	(patch_throw_statement): Fixed indentation. Issue specific error
 	for uncaught thrown checked exception in static initializer
 	blocks. Removed FIXME.

From-SVN: r26018
1999-03-27 08:17:16 -08:00