aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.c
AgeCommit message (Collapse)AuthorFilesLines
2000-07-27[multiple changes]Alexandre Petit-Bianco1-17728/+0
2000-07-27 Tom Tromey <tromey@cygnus.com> * parse.y (patch_method_invocation): Don't reverse the argument list when dealing with anonymous class constructors. Fixed typo in comment. 2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (build_alias_initializer_parameter_list): Reverse crafted list when building aliases for anonymous class constructors. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg01146.html) From-SVN: r35303
2000-07-21parse.y (simple_name:): Fixed typo in error message.Alexandre Petit-Bianco1-0/+17728
2000-07-21 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (simple_name:): Fixed typo in error message. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00881.html) From-SVN: r35186
2000-07-14* parse.c: Remove.Mark Mitchell1-17653/+0
From-SVN: r35029
2000-07-13parse.y (fold_constant_for_init): Avoid bullish conversion.Alexandre Petit-Bianco1-4/+1
2000-07-13 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (fold_constant_for_init): Avoid bullish conversion. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00506.html) From-SVN: r35022
2000-07-07jcf-write.c (generate_classfile): Properly install the ConstantValue ↵Alexandre Petit-Bianco1-2/+2
attribute and the initial value constant... 2000-07-07 Alexandre Petit-Bianco <apbianco@cygnus.com> * jcf-write.c (generate_classfile): Properly install the ConstantValue attribute and the initial value constant pool index on string constants. * parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting class files. (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00233.html) From-SVN: r34921
2000-07-06[multiple changes]Alexandre Petit-Bianco1-18/+38
2000-07-06 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while construct. * parse.y (find_as_inner_class): Fixed typo. (do_resolve_class): Explore enclosing contexts when searching for innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME. (check_inner_class_access): Check `decl' which can be null in case of previous errors. 2000-07-05 Alexandre Petit-Bianco <apbianco@cygnus.com> * java-tree.h (java_debug_context): Declared `extern.' (safe_layout_class): Likewise. * parse.y (resolve_field_access): Field must be `static' in order to be replaced by its initial value. Added comments. (find_applicable_accessible_methods_list): Fixed typo. (find_most_specific_methods_list): Methods found in innerclasses take over methods founds in the enclosing contexts. (java_complete_tree): Loosen restrictions on the type of DECLs that can be replaced by their initialization values. (valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p.' (http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00184.html) From-SVN: r34895
2000-07-06Java: fixes for the PRs gcj/{271,272,275}.Alexandre Petit-Bianco1-15/+6
2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (parser_qualified_classname): Removed parameter `is_static'. (create_interface): Removed first passed parameter to parser_qualified_classname. (create_class): Likewise. Don't install alias on static innerclasses. Fixes gcj/275. 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (maybe_generate_pre_expand_clinit): Don't build a debugable statement with empty_stmt_node. Fixes gcj/272 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * expr.c (build_instanceof): Layout type after it's loaded. Fixes gcj/271. (Fix to the PR gcj/271, gcj/272 and gcj/275: http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00000.html http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00002.html http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00001.html ) From-SVN: r34894
2000-06-29parse.y (verify_constructor_super): Use loop variable `m_arg_type' ↵Alexandre Petit-Bianco1-6/+7
initialized with `mdecl_arg_type'. 2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (verify_constructor_super): Use loop variable `m_arg_type' initialized with `mdecl_arg_type'. From-SVN: r34800
2000-06-30parse.y (resolve_field_access): Handle case where `type_found' is NULL.Tom Tromey1-1/+1
* parse.y (resolve_field_access): Handle case where `type_found' is NULL. From-SVN: r34795
2000-06-27parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to ↵Tom Tromey1-1/+1
java_complete_tree. * parse.y (resolve_field_access): Pass decl, not DECL_INITIAL, to java_complete_tree. From-SVN: r34732
2000-06-26re GNATS gcj/238 (Can't call methods from Object on an inner class)Bryce McKinlay1-46/+53
2000-06-09 Bryce McKinlay <bryce@albatross.co.nz> * parse.y (find_applicable_accessible_methods_list): Use a hashtable to track searched classes, and do not search the same class more than once. Call find_applicable_accessible_methods_list on immediate superclass, instead of search_applicable_method_list on all ancestors. Fix for PR gcj/238. (Fix to the Java PR #238: http://sourceware.cygnus.com/ml/java-prs/2000-q2/msg00206.html) From-SVN: r34727
2000-06-26[multiple changes]Alexandre Petit-Bianco1-433/+456
2000-06-23 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (set_super_info): Handle ACC_PRIVATE for (inner) classes. * java-tree.h (TYPE_PRIVATE_INNER_CLASS): New macro. (struct lang_type): New field `pic.' (CLASS_PRIVATE): New macro. * parse.y (check_inner_class_access): New function. (jdep_resolve_class): Call it. 2000-06-09 Bryce McKinlay <bryce@albatross.co.nz> * parse.y (register_fields): Permit static fields in inner classes if they are final. Fix for PR gcj/255. (These patches are fixes to the PR #224 and #255: http://sourceware.cygnus.com/ml/java-prs/2000-q2/msg00158.html http://sourceware.cygnus.com/ml/java-prs/2000-q2/msg00287.html) From-SVN: r34725
2000-06-26re GNATS gcj/268 (Internal compiler error in for-loop test condition)Tom Tromey1-211/+215
* parse.y (for_statement): Wrap expression in a WFL if it is a constant. For PR gcj/268. From-SVN: r34712
2000-06-26parse.y (do_resolve_class): Minor optimiztion in the package list search.Alexandre Petit-Bianco1-5/+7
2000-06-25 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (do_resolve_class): Minor optimiztion in the package list search. Removed unecessary test and return statement. (valid_ref_assignconv_cast_p): Order of arguments to enclosing_context_p fixed. From-SVN: r34705
2000-06-25parse.y (check_abstract_method_definitions): Also check if `other_method' is ↵Tom Tromey1-1/+3
abstract. * parse.y (check_abstract_method_definitions): Also check if `other_method' is abstract. From-SVN: r34697
2000-06-25re GNATS gcj/260 ("Klass.class" expression should cause Klass to be initialized)Tom Tromey1-3/+6
* parse.y (patch_incomplete_class_ref): Initialize the returned class. For PR gcj/260. From-SVN: r34695
2000-06-21[multiple changes]Alexandre Petit-Bianco1-520/+577
2000-06-21 Alexandre Petit-Bianco <apbianco@cygnus.com> * except.c (prepare_eh_table_type): Use `CATCH_ALL_TYPE'. 2000-06-20 Alexandre Petit-Bianco <apbianco@cygnus.com> * check-init.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for Java specific checks. * expr.c (build_instanceof): CLASS_INTERFACE and CLASS_FINAL usage screened by DECL_P. * java-tree.def (CASE_EXPR): Marked 'e'. (DEFAULT_EXPR): Likewise. * jcf-parse.c (set_source_filename): CLASS_COMPLETE_P usage screened by DECL_P. * jcf-write.c (ENABLE_JC1_CHECKING): Replaces ENABLE_CHECKING for Java specific checks. (generate_bytecode_insns): Test try_block for BLOCK before using BLOCK_EXPR_BODY. * parse.y (build_wfl_wrap): Added `location' argument. Set EXPR_WFL_LINECOL accordingly. (dim_expr:): Wrap constants with WFLs. (method_declarator): Use TREE_TYPE not TYPE_NAME on GET_CPC. (resolve_package): Check for `stmt' not being a BLOCK before building a debuggable statement with it. (make_qualified_primary): Added extra parameter to build_wfl_wrap invocation. (resolve_field_access): Make sure `decl' is a DECL before treating it as such. (maybe_build_primttype_type_ref): Make sure `wfl''s node is an IDENTIFIER_NODE before treating it as such. (patch_new_array_init): Make sure `elt' is a TREE_LIST before treating it as such. (find_applicable_accessible_methods_list): CLASS_INTERFACE macro to be applied only on non array types. 2000-06-16 Per Bothner <per@bothner.com> * java-tree.h (LABEL_RETURN_LABELS, LABEL_PENDING_CHAIN): Don't define in terms of DECL_RESULT, as that fails when --enable-checking. 2000-06-06 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (REGISTER_IMPORT): Use `chainon' to link new entries. * parse.y (find_in_imports): Returned type changed to void, leading comment fixed. (register_package): New function. (qualify_and_find): Likewise. (package_declaration:): Use `register_package'. (single_type_import_declaration:): Removed local variable `node'. Added missing `;' for consistency. (type_import_on_demand_declaration:): Use `chainon' to link new entries. (lookup_field_wrapper): Lookup local variables defined in outer contexts first. (java_complete_class): Don't reverse the list of imported on demand. (do_resolve_class): Reorganized. Removed local variable `original_name'. Call `qualify_and_find' with the current package name, invoke `find_in_imports_on_demand' right after. Call `qualify_and_find' with the packages we've seen so far. Fixed operations numbering in comments. (java_expand_class): Don't reverse `package_list'. (find_most_specific_methods_list): New local variables `abstract' and `candidates'. Use them to pick the right method. (Fixes for the ENABLE_TREE_CHECKING Java run-time build problem: http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00551.html) From-SVN: r34642
2000-06-14tree.h (TYPE_USER_ALIGN, [...]): Define.Jakub Jelinek1-0/+1
* tree.h (TYPE_USER_ALIGN, DECL_USER_ALIGN): Define. (struct tree_type, struct tree_decl): Add user_align member. * stor-layout.c (layout_decl): Set DECL_USER_ALIGN. (place_union_field): If BIGGEST_FIELD_ALIGNMENT is defined and DECL_USER_ALIGN 0, cap alignment to this value. (place_field): Likewise. (finalize_type_size): Set TYPE_USER_ALIGN. (layout_type): Likewise. (initialize_sizetypes): Likewise. * c-common.c (decl_attributes): Set TYPE_USER_ALIGN resp. DECL_USER_ALIGN to 1. * c-decl.c (duplicate_decls): Set DECL_USER_ALIGN. (xfer_tag): Set TYPE_USER_ALIGN. (finish_struct): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (finish_enum): Likewise. * stmt.c (expand_decl): Set DECL_USER_ALIGN. (expand_anon_union_decl): Likewise. * tree.c (make_node): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (build_index_type): Set TYPE_USER_ALIGN. (build_range_type): Likewise. (build_common_tree_nodes_2): Likewise. * tm.texi (BIGGEST_FIELD_ALIGNMENT): Document the changed meaning. ch/: * decl.c (init_decl_processing): Set TYPE_USER_ALIGN. (layout_enum): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. * typeck.c (layout_chill_range_type): Set TYPE_USER_ALIGN. (apply_chill_field_layout): Set DECL_USER_ALIGN. (layout_chill_struct_type): Set TYPE_USER_ALIGN. cp/: * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. (check_bitfield_decl, check_field_decl): Likewise. (build_vtbl_or_vbase_field, build_base_field): Likewise. (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. (xfer_tag, finish_enum): Likewise. * decl2.c (finish_builtin_type): Likewise. * init.c (init_init_processing): Likewise. * pt.c (instantiate_class_template): Likewise. * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. * cp-tree.h (struct lang_type): Add user_align member. (CLASSTYPE_USER_ALIGN): Define. f/: * com.c (ffecom_transform_common_): Set DECL_USER_ALIGN. (ffecom_transform_equiv_, ffecom_decl_field): Likewise. (ffecom_init_0): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (duplicate_decls): Set DECL_USER_ALIGN. java/: * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN. * parse.y (java_complete_class): Set DECL_USER_ALIGN. * parse.c: Rebuilt. From-SVN: r34541
2000-06-01re GNATS gcj/127 (gcj dumps core on method invocation on a primitive type)Bryce McKinlay1-0/+10
2000-05-23 Bryce McKinlay <bryce@albatross.co.nz> * parse.y (patch_method_invocation): Don't try to lookup methods in primitive types. (This fixes the PR gcj/127: http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00011.html) From-SVN: r34347
2000-06-01re GNATS gcj/129 (Static array length access bug in gcj)Alexandre Petit-Bianco1-0/+12
2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (resolve_field_access): Call the appropriate <clinit> before accessing the length of a static array. Craft a decl for the field while its time. (Fixes the PR #129: http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00013.html) From-SVN: r34340
2000-06-01class.c (common_enclosing_context_p): New function.Alexandre Petit-Bianco1-8/+35
2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (common_enclosing_context_p): New function. * java-tree.h (common_enclosing_context_p): Added prototype. * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow classes sharing an outer context with the current instance. * parse.y (build_access_to_thisn): Fixed leading comment. (verify_constructor_super): New local `supper_inner'. Skip enclosing context argument in the case of inner class constructors. (patch_method_invocation): Insert proper context as second parameter to pure inner class constructor super invocations. This fixes the Java PR #177. From-SVN: r34332
2000-05-31parse.y (maybe_yank_clinit): New function.Alexandre Petit-Bianco1-442/+498
2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (maybe_yank_clinit): New function. (maybe_generate_pre_expand_clinit): Always link <clinit> at the end of the list of methods belonging to a class. (java_complete_expand_method): Check whether <clinit> is really necessary and expand it accordingly. From-SVN: r34329
2000-05-31parse.y (resolve_field_access): Complete the DECL_INITIAL tree before using ↵Alexandre Petit-Bianco1-165/+231
it as the accessed field. 2000-05-31 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (resolve_field_access): Complete the DECL_INITIAL tree before using it as the accessed field. From-SVN: r34320
2000-05-26parse.y (find_applicable_accessible_methods_list): Don't add an ↵Zack Weinberg1-4/+6
uninitialized value to the list. 2000-05-26 Zack Weinberg <zack@wolery.cumb.org> * java/parse.y (find_applicable_accessible_methods_list): Don't add an uninitialized value to the list. From-SVN: r34196
2000-05-26re GNATS gcj/162 (gcj does not initialize interfaces according to spec)Tom Tromey1-2/+1
* parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC when trying to see if field's class should be initialized. Always initialize field's declaring class, not qualified class. For PR gcj/162. From-SVN: r34182
2000-05-26re GNATS gcj/235 (source parser dies when Primitive.TYPE is used in an array ↵Tom Tromey1-1/+1
declaration) * parse.y (array_constructor_check_entry): Pass `wfl_value', not `wfl_operator', to maybe_build_primttype_type_ref. Fixes PR gcj/235. From-SVN: r34181
2000-05-20parse.y (resolve_package): Correctly set `*next' (was off by one.)Alexandre Petit-Bianco1-2/+5
2000-05-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (resolve_package): Correctly set `*next' (was off by one.) (resolve_qualified_expression_name): Fixed comment. From-SVN: r34060
2000-05-19parse.y (block_end:): If the collected block doesn't feature a statement, ↵Alexandre Petit-Bianco1-273/+275
insert an empty statement. Thu Apr 27 17:25:33 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (block_end:): If the collected block doesn't feature a statement, insert an empty statement. From-SVN: r34038
2000-05-19parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be processed ↵Alexandre Petit-Bianco1-2/+0
by the method's switch statement. 2000-04-17 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (fold_constant_for_init): Let VAR_DECL and FIELD_DECL be processed by the method's switch statement. From-SVN: r34024
2000-05-19Reverted incorrectly applied changeTom Tromey1-0/+2
From-SVN: r34023
2000-05-19java-tree.h (build_instanceof): Declare.Tom Tromey1-243/+164
* java-tree.h (build_instanceof): Declare. (build_get_class): Declare. * parse.y (patch_binop): Use build_instanceof. * expr.c (build_instanceof): New function. If class is final, don't make a function call. (expand_java_INSTANCEOF): Use it. (build_get_class): New function. From-SVN: r34021
2000-05-09top level:Zack Weinberg1-166/+232
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings. (tree.o): Depend on output.h. * c-decl.c (pending_invalid_xref_file, current_function_prototype_file): Constify. (pushdecl): Constify a local char *. (define_label): Constify filename parameter. * c-lex.c (init_parse): Constify parameter and return value. * c-typeck.c (c_expand_asm_operands): Constify filename parameter. * c-tree.h: Update prototypes. * c-parse.in: Constify filename member of %union, and if_stmt_file. * c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y, objc/objc-parse.c: Regenerate. * dwarfout.c (dwarfout_init): Constify main_input_filename parameter. * dwarfout.h: Update prototypes. * expr.c (expand_expr): Constify a local char *. * flags.h: Constify main_input_filename. * function.c (expand_function_end): Constify filename parameter. * genrecog.c (make_insn_sequence): Use a character array for c_test_pos. (main): Remove unused variables. * input.h: Constify input_filename, main_input_filename, and file_stack.name. Update prototypes. * output.h: Declare first_global_object_name and weak_global_object_name here, as const char *. * stmt.c (expand_asm_operands): Constify filename parameter. * toplev.c (compile_file, push_srcloc, debug_start_source_file): Constify filename parameter. (input_filename, main_input_filename): Constify. * toplev.h: Update prototypes. * tree.c: Include output.h. Don't declare first_global_object_name or weak_global_object_name. Clean up string bashing in get_file_function_name_long. * tree.h (struct tree_decl): Constify filename member. (input_filename): Constify. Update prototypes. * varasm.c (first_global_object_name, weak_global_object_name): Constify. (assemble_start_function, assemble_variable): Clean up string bashing. * gcc.c: Constify all spec-related strings initialized, transitively, from string constants. Constify all strings and string variables related to multilibs. (set_spec, read_specs): Cast argument to free to PTR. (used_arg): Do not modify multilib_matches. Use strncmp plus length comparison to compare multilib switches. * genmultilib: Constify everything declared in multilib.h. ch: * ch-tree.h: Update prototypes. Remove prototypes for functions declared elsewhere. * decl.c (define_label): Constify filename parameter. * grant.c (globalize_decl, set_default_grant_file): Constify local char * variables. Don't declare first_global_object_name or asm_out_file. * lang.c (chill_real_input_filename): Constify. * lex.c (init_parse): Constify parameter and return value. * parse.c: Don't declare input_filename. (ch_expand_asm_operands): Constify filename parameter. (parse_multi_dimension_case_action): Constify local char *. * satisfy.c (safe_satisfy_decl): Constify local char *. cp: * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, and pending_inline.filename. Update prototypes. * decl.c (define_label): Constify filename parameter. * decl2.c (warn_if_unknown_interface): Constify local char *. * input.c Constify input_source.filename. Don't declare input_filename or lineno. Constify filename parameter to feed_input. * lex.c (init_parse): Constify parameter and return value. (cp_pragma_interface, cp_pragma_implementation): Constify filename argument. (reinit_parse_for_method, reinit_parse_for_block, reinit_parse_for_expr, feed_defarg, handle_cp_pragma): Constify local char *. * pt.c: Don't declare lineno or input_filename. (print_template_context, tsubst_friend_function, tsubst_decl, tsubst, instantiate_decl): Constify local char *. * semantics.c (expand_body): Constify local char *. * tree.c (build_srcloc): Constify filename parameter. * typeck.c (c_expand_asm_operands): Constify filename parameter. f: * com.c (ffecom_subscript_check_): Constify array_name parameter. Clean up string bashing. (ffecom_arrayref_, ffecom_char_args_x_): Constify array_name parameter. (ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify local char *. (init_parse): Constify parameter and return value. * lex.c: Include dwarfout.h instead of prototyping dwarfout_* functions here. (ffelex_file_pop_, ffelex_file_push_): Constify filename parameter. (ffelex_hash_, ffelex_include_): Constify local char *. * std.c (ffestd_exec_end): Constify local char *. * where.c (ffewhere_file_new): Constify filename parameter. * where.h: Update prototypes. java: * check_init.c (check_init): Constify local char *. * class.c (push_class): Constify local char *. * java_tree.h: Update prototypes. * jcf-io.c (open_class): Constify filename parameter and return value. (find_class): Remove redundant string copy. Cast return from open_class. * jcf-parse.c (read_class, parse_class_file, yyparse): Constify local char *. * jcf-write.c (generate_bytecode_insns, generate_classfile): Constify local char *. * jcf.h (JCF): Constify filename and classname. (JCF_FINISH): Cast args to FREE to char * when appropriate. * lang.c (init_parse): Constify parameter and return value. * lex.c (java_get_line_col): Constify filename parameter. * parse.h: Constify parser_ctxt.filename. Update prototypes. * parse.y (java_parser_context_suspend, issue_warning_error_from_context, safe_layout_class): Constify local char *. * parse.c: Regenerate. From-SVN: r33804
2000-05-02class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE on native ↵Tom Tromey1-233/+176
function. * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE on native function. * jcf-parse.c (parse_class_file): Call build_jni_stub for native JNI methods. * expr.c (build_jni_stub): New function. * lang-specs.h: -fjni and -femit-class-file are incompatible. * parse.c: Rebuilt. * parse.y (java_complete_expand_methods): Expand a native method and call build_jni_stub if -fjni given. * lang-options.h: Document -fjni. * lang.c (flag_jni): New global. (lang_f_options): Added `jni' entry. * java-tree.h (soft_lookupjnimethod_node, soft_getjnienvnewframe_node, soft_jnipopsystemframe_node): Declare. (flag_jni): Declare. (build_jni_stub): Declare. (struct lang_decl): Added `native' flag. (METHOD_NATIVE): Redefined to use `native' field of lang specific structure. * decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node, soft_jnipopsystemframe_node): New globals. (init_decl_processing): Set them. _Jv_InitClass only takes one argument. * java-tree.def: Put into `C' mode. From-SVN: r33615
2000-05-01re GNATS gcj/195: (gcj fail on code to implement an inner interface.)Alexandre Petit-Bianco1-1/+2
(This trying to counter the effect of the PR 195 check in -- this should be right now.) From-SVN: r33602
2000-05-01(The patch contained impurities -- this should fix the situation.)Alexandre Petit-Bianco1-168/+236
From-SVN: r33591
2000-04-28re GNATS gcj/2 (Method call on null instance should throw NullPointerException)Tom Tromey1-238/+214
Fix for PR gcj/2: * expr.c (expand_invoke): Generate check to see if object pointer is null in nonvirtual invocation case. * java-tree.h (soft_nullpointer_node): Declare. * decl.c (soft_nullpointer_node): New global. (init_decl_processing): Initialize soft_nullpointer_node. * parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final' or `private' methods. (patch_invoke): Handle INVOKE_NONVIRTUAL case. From-SVN: r33495
2000-04-25re GNATS gcj/181 (gcj crashes on inner classes/interfaces definition/usage.)Alexandre Petit-Bianco1-0/+7
Mon Apr 24 14:59:36 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (end_class_declaration): Reset the interface number counter. (This fixes the Java PR #181: http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00207.html) From-SVN: r33422
2000-04-24parse.y (lookup_field_wrapper): Search for final local aliases.Alexandre Petit-Bianco1-183/+259
2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (lookup_field_wrapper): Search for final local aliases. (resolve_expression_name): Let lookup_field_wrapper search for final local aliases. Force the value of `name' if one is found. (qualify_ambiguous_name): CONVERT_EXPR is enough to now we have an expression name. Fixed comments. From-SVN: r33400
2000-04-24parse.y (source_start_java_method): Deleted unecessary code.Alexandre Petit-Bianco1-260/+165
2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (source_start_java_method): Deleted unecessary code. (patch_method_invocation): Fixed comment. From-SVN: r33392
2000-04-21[multiple changes]Alexandre Petit-Bianco1-172/+271
Thu Apr 20 17:41:28 2000 Mo DeJong <mdejong@cygnus.com> * parse.h (INTERFACE_INNER_MODIFIERS): New macro. * parse.y (check_class_interface_creation): Fixed comments. Select permitted modifiers for (inner) interfaces. Changed error message to report rejected modifiers used with local classes. 2000-04-20 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Immediate inner classes of directly inherited type considered in scope. * parse.y (do_resolve_class): Search inherited classes for inner classes. (This fixes the PR #194 and #197: http://sourceware.cygnus.com/ml/java-prs/2000-q2/msg00008.html http://sourceware.cygnus.com/ml/java-prs/2000-q2/msg00011.html) From-SVN: r33330
2000-04-21re GNATS gcj/124 (protected constructor for InvocationTargetException still ↵Tom Tromey1-234/+168
visible) * parse.y (not_accessible_p): Use member's class, not current class, when doing inheritance check for protected reference. Fixes PR gcj/124. From-SVN: r33315
2000-04-19parse.y (yyerror): `msg' can be null, don't use it in that case.Alexandre Petit-Bianco1-1/+1
2000-04-19 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (yyerror): `msg' can be null, don't use it in that case. From-SVN: r33270
2000-04-18[multiple changes]Alexandre Petit-Bianco1-172/+254
2000-04-18 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (maybe_make_nested_class_name): Use `obstack_grow0'. 2000-04-14 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (java_expand_classes): Reverse the package list once. (java_complete_lhs): PLUS_EXPR: don't try rhs and lhs at string reduction. (patch_binop): New temp `cn'. Call patch_string on LHS/RHS of the `==' and `!=' operators. From-SVN: r33240
2000-04-06re GNATS gcj/140 (gcj permits assignment to array length)Tom Tromey1-4/+10
Fix for PR gcj/140: * parse.y (check_final_assignment): Recognize assignments to the `length' field of an array when generating class files. From-SVN: r32960
2000-04-06re GNATS gcj/164 (compiler permits "volatile final" variables)Tom Tromey1-8/+20
* parse.h (THIS_MODIFIER_ONLY): Changed meaning of `v' parameter. * parse.y (check_modifiers_consistency): Check for final/volatile clash. Fixes PR gcj/164. From-SVN: r32955
2000-04-05class.c: (java_hash_hash_tree_node): Renamed from `decl_hash', made global.Alexandre Petit-Bianco1-241/+181
2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c: (java_hash_hash_tree_node): Renamed from `decl_hash', made global. (java_hash_compare_tree_node): Renamed from `decl_compare, made global. (add_method_1): Use `java_hash_hash_tree_node' and `java_hash_compare_tree_node'. * java-tree.h: (java_hash_hash_tree_node): Prototyped. (java_hash_compare_tree_node): Likewise. * parse.y (find_applicable_accessible_methods_list): Create, delete and use a hash table to remember already searched interfaces. From-SVN: r32947
2000-04-04boehm.c (mark_reference_fields, set_bit): Prototype.Kaveh R. Ghazi1-430/+431
* boehm.c (mark_reference_fields, set_bit): Prototype. (set_bit): Un-ANSI-fy definition. * class.c (init_test_hash_newfunc, decl_hash, decl_compare): Prototype. * decl.c (emit_init_test_initialization): Likewise. * gjavah.c (jni_print_char): Likewise. * parse.y (create_new_parser_context): Likewise. From-SVN: r32908
2000-03-22[multiple changes]Alexandre Petit-Bianco1-502/+752
2000-03-22 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (check_abstract_method_definitions): New local `end_type_reached'. Make sure we also consider `end_type'. (java_check_abstract_method_definitions): Make sure we also eventually consider `java.lang.Object'. (maybe_use_access_method): Don't use access method if not a pure inner class or if the method's context is right. (find_applicable_accessible_methods_list): New static `object_done'. Don't search abstract classes as interfaces. Fixed indentation. Fixed the `java.lang.Object' only search. Search class' interface(s) first, fully search enclosing contexts. (find_most_specific_methods_list): Pick closest candidates when they're all abstract. 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (check_method_types_complete): New function. (create_class): Reset anonymous class counter only when seeing an non inner classe. (java_complete_class): JDEP_METHOD: Don't recompute signature if incomplete. 2000-03-17 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (build_static_ref): Fixed indentation in comment. * java-tree.def (TRY_EXPR): Fixed typo in name. (CLASS_LITERAL): Likewise. * java-tree.h: (TYPE_DOT_CLASS): New macro. (struct lang_type): New field `dot_class'. * jcf-write.c (generate_bytecode_insns): Fixed error message. (generate_classfile): Method `class$' is synthetic. * parse.y (build_do_class_method): New function. (build_dot_class_method_invocation): Likewise. (java_complete_expand_methods): Expand TYPE_DOT_CLASS if necessary. (resolve_qualified_expression_name): Handle CLASS_LITERAL. (qualify_ambiguous_name): Likewise. (patch_incomplete_class_ref): Invoke synthetic method if necessary. (build_try_statement): Fixed leading comment. 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Disregard anonymous classes. * parse.y (patch_method_invocation): Handle anonymous classes creation in static context. 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.h (INNER_ENCLOSING_SCOPE_CHECK): New macro. * parse.y (resolve_qualified_expression_name): Use it. (patch_method_invocation): Likewise. 2000-03-15 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (register_incomplete_type): JDEP_ENCLOSING set depending on the type of dependency which dictates what the current class is. (unresolved_type_p): Resolved types limited to the current class. (For details, see: http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00790.html) From-SVN: r32701
2000-03-15re GNATS gcj/172 (compiler rejects inner-class argument to inner-class ↵Alexandre Petit-Bianco1-1/+2
constructor) Tue Mar 14 17:15:41 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (register_incomplete_type): Fixed initialization of JDEP_ENCLOSING. (This is a fix to the gcj PR #172: http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00169.html) From-SVN: r32556
2000-03-13parse.y (resolve_package): Set `next' once a type name has been ↵Alexandre Petit-Bianco1-78/+28
progressively discovered. 2000-03-13 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (resolve_package): Set `next' once a type name has been progressively discovered. (resolve_qualified_expression_name): Propagate resolution only if there are remaining qualifiers. Take into account `q' might have been cleared after re-qualification. * parse.y (patch_method_invocation): New local `resolved'. Section dealing with qualified expression rewritten to use resolve_field_access. From-SVN: r32520