Commit Graph

178 Commits

Author SHA1 Message Date
Andrew Haley
e6b7893e34 re PR libgcj/26858 (NullPointerException not generated for large classes...)
2006-03-30  Andrew Haley  <aph@redhat.com>

        PR java/26858
        * lang.c (java_attribute_table): New.
        (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
        * expr.c (build_field_ref): Add a null pointer check for all
        fields of offset > 4k.  Don't do so for accesses via the this
        pointer, which we know can never be null.
        * class.c (build_java_method_type): Mark arg 1 of all nonstatic
        methods nonnull.

From-SVN: r112574
2006-03-31 11:43:43 +00:00
David Daney
dba370a829 lang.opt (-freduced-reflection): New option.
* lang.opt (-freduced-reflection): New option.
	* lang.c (java_post_options): Generate an error if
	-freduced-reflection used with -fjni or -findirect-dispatch.
	* java-tree.h (flag_reduced_reflection): Declare new variable.
	* boehm.c (get_boehm_type_descriptor): Indicate all pointers
	if bitmap overflows and flag_reduced_reflection set.
	* class.c (uses_jv_markobj_p): New function.
	(make_class_data): Moved generation of vtable to before
	reflection data, generate less reflection data if
	flag_reduced_reflection set.
	* gcj.texi: Document -freduced-reflection.

From-SVN: r112095
2006-03-15 19:10:23 +00:00
Ben Elliston
ab184b2a8f java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
* java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
	* typeck.c: Likewise.
	* verify-impl.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* jcf-parse.c: Likewise.
	* constants.c: Likewise.
	* check-init.c: Likewise.
	* jcf-write.c: Likewise.
	* verify-glue.c: Likewise.
	* mangle.c: Likewise.
	* expr.c: Likewise.
	* lang.c: Likewise.
	* boehm.c: Likewise.

From-SVN: r110541
2006-02-03 22:56:58 +11:00
Jan Hubicka
46fd0f8c24 opts.c (no_unit_at_a_time_default): New global variable.
2006-02-01  Jan Hubicka  <jh@suse.cz>

	* opts.c (no_unit_at_a_time_default): New global variable.
	(decode_options): Use it.
	* opts.h (no_unit_at_a_time_default): Declare.

java/
	* decl.c (end_java_method): Kill hack disabling unit-at-a-time.
	* lang.c (java_init_options): Set no_unit_at_a_time_default.

From-SVN: r110479
2006-02-01 20:31:29 +00:00
Marcin Dalecki
5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

	* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
	* regrename.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-dump.c: Ditto.
	* tree-complex.c: Ditto.
	* genrecog.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tracer.c: Ditto.
	* java/class.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.
	* java/except.c: Ditto.
	* java/jvspec.c: Ditto.
	* java/jcf-write.c: Ditto.
	* java/jcf-path.c: Ditto.
	* java/gjavah.c: Ditto.
	* java/zextract.c: Ditto.
	* java/jcf-io.c: Ditto.
	* java/jcf.h: Ditto.
	* java/buffer.c: Ditto.
	* java/lang.c: Ditto.
	* java/parse-scan.y: Ditto.
	* java/lex.c: Ditto.
	* java/lex.h: Ditto.
	* cfgloopmanip.c: Ditto.
	* postreload-gcse.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* postreload.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* loop.c: Ditto.
	* ipa-cp.c: Ditto.
	* cppspec.c: Ditto.
	* diagnostic.c: Ditto.
	* final.c: Ditto.
	* genoutput.c: Ditto.
	* gcc.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloopanal.c: Ditto.
	* objc/objc-act.c: Ditto.
	* gcov.c: Ditto.
	* genextract.c: Ditto.
	* genautomata.c: Ditto.
	* pretty-print.c: Ditto.
	* genemit.c: Ditto.
	* cgraphunit.c: Ditto.
	* flow.c: Ditto.
	* df-scan.c: Ditto.
	* haifa-sched.c: Ditto.
	* dominance.c: Ditto.
	* dbxout.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* df-core.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* graph.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* cse.c: Ditto.
	* fix-header.c: Ditto.
	* web.c: Ditto.
	* tree-stdarg.c: Ditto.
	* ipa-utils.c: Ditto.
	* loop-init.c: Ditto.
	* ipa-inline.c: Ditto.
	* cfganal.c: Ditto.
	* global.c: Ditto.
	* alloc-pool.c: Ditto.
	* dwarf2out.c: Ditto.
	* opts.c: Ditto.
	* genattrtab.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* predict.c: Ditto.
	* timevar.c: Ditto.
	* lcm.c: Ditto.
	* fortran/gfortranspec.c: Ditto.
	* regmove.c: Ditto.
	* local-alloc.c: Ditto.
	* langhooks.c: Ditto.
	* function.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* gcse.c: Ditto.
	* ipa-type-escape.c: Ditto.
	* alias.c: Ditto.
	* tree-if-conv.c: Ditto.
	* profile.c: Ditto.
	* ipa.c: Ditto.
	* tree-data-ref.c: Ditto.
	* loop-unroll.c: Ditto.
	* treelang/treetree.c: Ditto.
	* calls.c: Ditto.
	* bt-load.c: Ditto.
	* ggc-common.c: Ditto.
	* except.c: Ditto.
	* coverage.c: Ditto.
	* cselib.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* cfgcleanup.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* ipa-prop.c: Ditto.
	* print-tree.c: Ditto.
	* conflict.c: Ditto.
	* ggc-page.c: Ditto.
	* sched-deps.c: Ditto.
	* regclass.c: Ditto.
	* tree-object-size.c: Ditto.
	* combine.c: Ditto.
	* bb-reorder.c: Ditto.
	* resource.c: Ditto.
	* var-tracking.c: Ditto.
	* cfgloop.c: Ditto.
	* df-problems.c: Ditto.
	* reg-stack.c: Ditto.
	* tlink.c: Ditto.
	* gccspec.c: Ditto.
	* sched-rgn.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/arm/arm.c: Ditto.
	* cfgrtl.c: Ditto.
	* collect2.c: Ditto.
	* reload1.c: Ditto.

From-SVN: r110446
2006-01-31 20:56:55 +01:00
Tom Tromey
65e8066b7b Make-lang.in (JAVA_OBJS): Removed verify.o
* Make-lang.in (JAVA_OBJS): Removed verify.o
	(java/verify.o): Removed.
	* verify.c: Removed.
	* lang.c (flag_new_verifier): Removed.
	(java_post_options): Updated.
	* java-tree.h (flag_new_verifier): Removed.
	(verify_jvm_instructions): Removed.
	* expr.c (pop_type_0): Assume flag_new_verifier is true.
	(build_java_check_indexed_type): Likewise.
	(expand_java_arraystore): Likewise.
	(expand_java_arrayload): Likewise.
	(pop_arguments): Likewise.
	(expand_byte_code): Likewise.
	(process_jvm_instruction): Likewise.

From-SVN: r103126
2005-08-15 21:26:35 +00:00
Kelley Cook
f12c30a8f1 Update FSF address.
From-SVN: r101309
2005-06-25 00:33:05 +00:00
Richard Henderson
6de33afa78 re PR libgcj/21692 (unexpected java.lang.NoClassDefFoundError)
PR libgcj/21692
cp/
        * cp-tree.h (make_alias_for): Declare.
        * decl2.c (build_java_method_aliases): New.
        (cp_finish_file): Call it.
        * method.c (make_alias_for): Split out from ...
        (make_alias_for_thunk): ... here.

java/
        * Make-lang.in (java/mangle.o): Depend on LANGHOOKS_DEF_H.
        * class.c (build_class_ref): Set DECL_CLASS_FIELD_P and
        DECL_CONTEXT; avoid pushdecl_top_level.
        (build_dtable_decl): Set DECL_VTABLE_P and DECL_CONTEXT.
        (layout_class): Don't SET_DECL_ASSEMBLER_NAME.
        (layout_class_method): Likewise.
        * decl.c (java_mark_cni_decl_local): New.
        (java_mark_class_local): Use it.
        * java-tree.h (DECL_LOCAL_CNI_METHOD_P): New.
        (DECL_CLASS_FIELD_P, DECL_VTABLE_P): New.
        (struct lang_decl_func): Add local_cni;
        (struct lang_decl_var): Add class_field, vtable.
        (java_mangle_decl): Declare.
        * lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): New.
        * mangle.c: Remove dup obstack.h; include langhooks-def.h.
        (mangle_obstack_1): New.
        (java_mangle_decl): Remove obstack argument.  Call mangle_class_field,
        mangle_vtable, and mangle_local_cni_method_decl.  Fall back to
        lhd_set_decl_assembler_name for things that don't need mangling.
        (mangle_class_field): Rename from java_mangle_class_field, make
        static, don't call init_mangling or finish_mangling.
        (mangle_vtable): Similarly.
        (mangle_local_cni_method_decl): New.
        (init_mangling): Remove obstack argument.  Use &mangle_obstack_1,
        gcc_assert, and MANGLE_RAW_STRING.
        (finish_mangling): Use gcc_assert, remove if 0 debugging code.

From-SVN: r100171
2005-05-25 15:08:31 -07:00
Kazu Hirata
df04438806 gcj.texi: Fix a typo.
* gcj.texi: Fix a typo.
	* lang.c: Fix a comment typo.

From-SVN: r97551
2005-04-04 15:29:52 +00:00
Joseph Myers
d101034cd8 langhooks.h (truthvalue_conversion): Remove.
* langhooks.h (truthvalue_conversion): Remove.
	* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
	LANG_HOOKS_TRUTHVALUE_CONVERSION.
	* system.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Poison.
	* gimplify.c (gimple_boolify): Don't use truthvalue_conversion.
	* c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

ada:
	* misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

cp:
	* cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

fortran:
	* f95-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

java:
	* lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.

treelang:
	* treetree.c (LANG_HOOKS_TRUTHVALUE_CONVERSION,
	tree_lang_truthvalue_conversion): Remove.
	* tree-convert.c: Don't call truthvalue_conversion.

From-SVN: r96947
2005-03-23 19:47:09 +00:00
Bryce McKinlay
a2da2c9a68 [multiple changes]
2005-03-04  Bryce McKinlay  <mckinlay@redhat.com>

	* verify-glue.c (vfy_is_assignable_from): Perform static check using
	can_widen_reference_to if the C++ ABI is in use.
	(vfy_get_interface_count, vfy_get_interface): Remove unused functions.
	* verify-impl.c (debug_print, make_utf8_const, init_type, copy_type,
	type_isresolved, init_state, set_pc, state_get_pc,
	_Jv_BytecodeVerifier): Clean up unused and disabled functions.
	(verify_fail): Report the current PC from the verifier context.
	(free_state): Remove #if 0 block to enable this function.
	(free_verifier_context): Call free_state on state_list iterator
	values before freeing them.
	* expr.c (pop_type_0): Pop correct type for error message when stack
	contains a multi-word type.

2005-03-04  Ranjit Mathew  <rmathew@hotmail.com>

	* expr.c (build_java_array_length_access): Remove !flag_new_verifier
	for known NULL array length access.

From-SVN: r96044
2005-03-07 21:10:49 +00:00
Kazu Hirata
1ddc032813 jcf-dump.c, [...]: Update copyright.
* jcf-dump.c, jcf-io.c, jcf-reader.c, lang.c, parse.h,
	typeck.c: Update copyright.

From-SVN: r95967
2005-03-06 12:57:57 +00:00
Ranjit Mathew
ecf713657e Remove xref code.
* xref.c, xref.h: Remove file.
	* Make-lang.in (java/xref.o): Remove.
	* java-tree.h (flag_emit_xref, do_not_fold): Remove declaration.
	* lang.c (flag_emit_xref): Remove definition.
	* parse.h (DECL_END_SOURCE_LINE, DECL_INHERITED_SOURCE_LINE): Remove.
	* typeck.c (convert): Remove use of do_not_fold.
	* parse.y (do_not_fold): Remove definition.
	(parser grammar): Remove xref code.
	(maybe_create_class_interface_decl, create_class): Likewise.
	(register_fields, method_header, finish_method_declaration): Likewise.
	(declare_local_variables, source_end_java_method): Likewise.
	(java_complete_expand_classes): Do not set do_not_fold.
	(java_complete_expand_method): Remove xref code.
	(java_expand_classes, resolve_field_access, patch_invoke): Likewise.
	(java_complete_tree, java_complete_lhs, patch_assignment): Likewise.
	(patch_binop, build_string_concatenation, patch_array_ref): Likewise.
	(patch_synchronized_statement, patch_throw_statement): Likewise.
	(maybe_build_class_init_for_field): Likewise.

From-SVN: r95965
2005-03-06 08:42:33 +00:00
Tom Tromey
c56c2878f7 lang.c (flag_new_verifier): Define.
* lang.c (flag_new_verifier): Define.
	(java_post_options): Set flag_new_verifier if indirect dispatch
	is being used.
	* lang.opt (fnew-verifier): Removed.

From-SVN: r91693
2004-12-03 19:43:52 +00:00
Tom Tromey
367390404d * Merged gcj-abi-2-dev-branch to trunk.
(Actual changes too large to list in the commit message;
see ChangeLog.)

From-SVN: r91270
2004-11-25 03:47:08 +00:00
Steven Bosscher
39afeb1aad c-opts.c (c_common_post_options): Don't clear flag_inline_functions.
gcc/
	* c-opts.c (c_common_post_options): Don't clear
	flag_inline_functions.
	* dojump.c (clear_pending_stack_adjust): Remove check on
	flag_inline_functions, it's always true.
	* config/alpha/alpha.md (movdi_er_maybe_g): Remove splitter
	that can never trigger.
	* config/c4x/c4x.h (TARGET_CPU_CPP_BUILTINS): Don't look at
	flag_inline_trees, now that flag_inline_functions is never
	cleared.
	* config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Don't set
	flag_inline_functions at optimization levels greater than
	or equal to 3.  This is already done by default.

ada/
	* misc.c (gnat_post_options): Don't clear
	flag_inline_functions.

cp/
	* decl.c (cxx_init_decl_processing): Don't clear
	flag_inline_functions.

fortran/
	* options.c (gfc_post_options): Don't clear flag_inline_functions.

java/
	* class.c (make_class_data): Don't check flag_inline_functions.
	* lang.c (flag_really_inline): Remove unused flag.
	(java_handle_option): Don't set it here.  Remove special handling
	of flag_inline_functions for Java.
	(java_init): Don't set flag_inline_trees here.  Already done...
	(java_post_options): ...here.  Don't clear flag_inline_functions.

From-SVN: r91190
2004-11-24 19:45:32 +00:00
Steven Bosscher
16df8078b8 expr.c (expand_expr_real_1): Remove cases for EXIT_BLOCK_EXPR and LABELED_BLOCK_EXPR.
gcc/
	* expr.c (expand_expr_real_1): Remove cases for EXIT_BLOCK_EXPR
	and LABELED_BLOCK_EXPR.
	* gimplify.c (gimplify_labeled_block_expr): Remove.
	(gimplify_exit_block_expr): Remove.
	(gimplify_expr): Don't call them.
	* tree-inline.c (copy_body_r): Don't handle EXIT_BLOCK_EXPR
	and LABELED_BLOCK_EXPR.
	(estimate_num_insns_1): Likewise.
	(walk_tree): Likewise.
	* tree-pretty-print.c (dump_generic_node): Don't handle
	EXIT_BLOCK_EXPR and LABELED_BLOCK_EXPR.
	* tree.def (EXIT_BLOCK_EXPR): Moved to java-tree.def.
	(LABELED_BLOCK_EXPR): Likewise.
	* tree.h (LABELED_BLOCK_LABEL): Moved to java-tree.h.
	(LABELED_BLOCK_BODY): Likewise.
	(EXIT_BLOCK_LABELED_BLOCK): Likewise.
	(EXIT_BLOCK_RETURN): Removed.

java/
	* java-gimplify.c (java_gimplify_labeled_block_expr): New function.
	(java_gimplify_exit_block_expr): New function.
	(java_gimplify_expr): Use them to gimplify EXIT_BLOCK_EXPR and
	LABELED_BLOCK_EXPR.
	* java-tree.def (LABELED_BLOCK_EXPR): Moved from tree.def.
	(EXIT_BLOCK_EXPR): Likewise.
	* java-tree.h (LABELED_BLOCK_LABEL): Moved from tree.h.
	(LABELED_BLOCK_BODY): Likewise.
	(EXIT_BLOCK_LABELED_BLOCK): Likewise.
	* jcf-write.c (generate_bytecode_insns): Don't handle the unused
	EXIT_BLOCK_RETURN operand.  Use EXIT_BLOCK_LABELED_BLOCK instead of
	TREE_OPERAND.
	* lang.c (java_tree_inlining_walk_subtrees): Handle EXIT_BLOCK_EXPR.
	(java_dump_tree): Use LABELED_BLOCK_LABEL, LABELED_BLOCK_BODY, and
	EXIT_BLOCK_LABELED_BLOCK instead of TREE_OPERAND.  Don't handle the
	second operand of EXIT_BLOCK_EXPR.
	* parse.y (find_expr_with_wfl): Use LABELED_BLOCK_BODY instead of
	TREE_OPERAND.
	(build_bc_statement): Use build1 to build EXIT_BLOCK_EXPR nodes.

From-SVN: r91149
2004-11-24 11:41:38 +00:00
Ranjit Mathew
a1402da35c parse.y (parse_warning_context): Remove ATTRIBUTE_PRINTF_2 and rename parameter 'msg' to 'msgid' in function...
* parse.y (parse_warning_context): Remove ATTRIBUTE_PRINTF_2 and
	rename parameter 'msg' to 'msgid' in function declaration.
	(issue_warning_error_from_context): Likewise.
	(yyerror): Rename parameter 'msg' to 'msgid'.
	(all over): Use new quoting style for diagnostics.

	* check-init.c: Use %<, %> and %q for quoting in diagnostics,
	if possible, else convert `foo' to 'foo'.
	* class.c: Likewise.
	* decl.c: Likewise.
	* expr.c: Likewise.
	* jcf-io.c: Likewise.
	* jcf-parse.c: Likewise.
	* lang.c: Likewise.
	* lex.c: Likewise.
	* parse.h: Likewise.

From-SVN: r89110
2004-10-15 18:43:10 +00:00
Matt Austern
0c58f841a5 Speed up walk_tree by introducing a special-purpose hash table.
* pointer-set.c: New file, special-purpose hash table.
	* pointer-set.h: New file.
	* tree.h (struct pointer_set_t): Declare as opaque type.
	(tree_walk): Last argument is pointer_set_t* now.
	* tree-inline.c (WALK_SUBTREE): Convert from htab to pset.
	(walk_type_fields):
	(walk_tree): Convert from htab_t to pointer_set_t for keeping
	track of which nodes have already been visited.
	(walk_tree_without_duplicates): Convert from htab_t to pointer_set_t.
	* cgraphunit.c (cgraph_create_edges): Likewise.
	(cgraph_characterize_statics_local): Likewise.
	* tree-dfa.c (collect_dfa_stats): Likewise.
	* langhooks-def.h (lhd_tree_inlining_walk_subtrees): Last arg is
	pointer_set_t* now.
	* langhooks.c (lhd_tree_inlining_walk_subtrees): Likewise.
	* langhooks.h (struct lang_hooks_for_tree_inlining): Last arg type
	of walk_subtrees is pointer_set_t* now.
	* Makefile.in (OBJS-common): add pointer-set.o
	(tree-inline.o): Depends on pointer-set.h
	(tree-dfa.o): Likewise
	(cgraphunit.o): Likewise
	* cp/Make-lang.in (pt.o): depends on pointer-set.h
	* cp/cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
	* cp/pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
	(for_each_template_parm): Convert from htab_t to pointer_set_t.
	* cp/tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
	* java/lang.c (java_tree_inlining_walk_subtrees): Last arg is struct
	pointer_set_t* now.

From-SVN: r89062
2004-10-14 23:15:29 +00:00
Per Bothner
de39930392 check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
* check-init.c (check_init): Handle USE_MAPPED_LOCATION case.
	* decl.c (finish_method, java_add_stmt): Likewise.
	* java-gimplify.c (java-gimplify.c):  Likewise.
	* jcf-write.c (generate_bytecode_insns):  Likewise.
	* lang.c (java_post_options): Likewise - call linemap_add.

From-SVN: r88324
2004-09-29 19:16:46 -07:00
Jeffrey D. Oldham
6615c44615 alias.c (find_base_decl): Remove unreachable case '3' block.
2004-09-17  Jeffrey D. Oldham  <oldham@codesourcery.com>
	    Zack Weinberg  <zack@codesourcery.com>

	* alias.c (find_base_decl): Remove unreachable case '3' block.
	* expr.c (safe_from_p): Abort if passed a type.
	* tree-gimple.c (recalculate_side_effects): Abort if passed
	anything other than an expression.
	* tree-ssa-pre.c (phi_translate): Return expr immediately if
	is_gimple_min_invariant is true for it.  Reorder cases for clarity.
	Abort on un-handled tree classes.
	(valid_in_set): Likewise.
	* tree.c (tree_code_class_strings): New static data.

	* tree.h (enum tree_code_class): New.
	(tree_code_class_strings): Declare.
	(TREE_CODE_CLASS_STRING, EXCEPTIONAL_CLASS_P, CONSTANT_CLASS_P)
	(REFERENCE_CLASS_P, COMPARISON_CLASS_P, UNARY_CLASS_P, BINARY_CLASS_P)
	(STATEMENT_CLASS_P, EXPRESSION_CLASS_P, IS_TYPE_OR_DECL_P): New macros.
	(TYPE_P, DECL_P, IS_NON_TYPE_CODE_CLASS, IS_EXPR_CODE_CLASS)
	(checking macros, EXPR_LOCATION, SET_EXPR_LOCATION, EXPR_LOCUS): Update.

	* tree.def, c-common.def, objc/objc-tree.def: Use
	tree_code_class enumeration constants instead of code letters.

	* alias.c, builtins.c, c-common.c, c-format.c, c-lang.c, c-pragma.c
	* c-typeck.c, cgraphunit.c, convert.c, dbxout.c, dwarf2out.c
	* emit-rtl.c expr.c, fold-const.c, gimplify.c, lambda-code.c
	* langhooks.c, langhooks.h, predict.c, print-tree.c, reload1.c, stmt.c
	* tree-browser.c, tree-cfg.c, tree-chrec.c, tree-complex.c, tree-dfa.c
	* tree-dump.c, tree-eh.c, tree-gimple.c, tree-inline.c, tree-nested.c
	* tree-outof-ssa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-ccp.c
	* tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-forwprop.c, tree-ssa-live.c
	* tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-operands.c
	* tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-propagate.c
	* tree-ssa.c, tree-ssanames.c, tree-tailcall.c, tree.c, varasm.c
	* config/sol2-c.c, config/arm/arm.c, config/i386/winnt.c
	* config/pa/pa.c, config/pa/pa.h, config/sh/sh.c, objc/objc-lang.c
	Update to match.

	* LANGUAGES: Add note about change.

ada:
	* ada-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* ada-tree.h, decl.c, misc.c, trans.c, utils.c, utils2.c:
	Update for new tree-class enumeration constants.

cp:
	* cp-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c
	* mangle.c, pt.c, semantics.c, tree.c, typeck.c:
	Update for new tree-class enumeration constants.

fortran:
	* f95-lang.c, trans-expr.c, trans.c: Update for new tree-class
	enumeration constants.

java:
	* java-tree.def: Use tree_code_class enumeration constants
	instead of code letters.
	* java-gimplify.c, jcf-write.c, lang.c, parse.y: Update for
	new tree-class enumeration constants.

treelang:
	* treetree.c: Update for new tree-class enumeration constants.

From-SVN: r87675
2004-09-17 21:55:02 +00:00
Andrew Haley
1b9deeb46e lang.c (lang_printable_name): Obey verbose flag.
2004-08-17  Andrew Haley  <aph@redhat.com>

	* lang.c (lang_printable_name): Obey verbose flag.
	* parse.y (constructor_circularity_msg): Set VERBOSE arg for
	lang_printable_name().
	(verify_constructor_circularity, get_printable_method_name,
	check_abstract_method_definitions, java_check_regular_methods,
	java_check_abstract_methods, check_inner_class_access,
	fix_constructors, patch_method_invocation, patch_return):
	Likewise.
	* expr.c (pop_type_0): Likewise.

	* java-tree.h (lang_printable_name_wls): Delete.

From-SVN: r86118
2004-08-17 12:51:01 +00:00
Kelley Cook
9ddfe26ede lang.c (flag_emit_class_files, [...]): Remove explicit declarations.
2004-08-06  Kelley Cook  <kcook@gcc.gnu.org>

	* lang.c (flag_emit_class_files, flag_filelist_file, flag_redundant,
	flag_use_divide_subroutine, flag_use_boehm_gc, flag_store_check,
	flag_hash_synchronization, flag_assert, flag_jni, flag_newer,
	flag_check_references, flag_extraneous_semicolon, flag_deprecated,
	flag_force_classes_archive_check, flag_optimize_sci,
	flag_indirect_dispatch): Remove explicit declarations.
	* lang.opt: Add implicit declare/define/assign.  Remove obsolete
	final comment.

From-SVN: r85622
2004-08-06 02:03:47 +00:00
Eric Christopher
9f63daea37 c-common.c (c_common_unsafe_for_reeval): Delete.
2004-07-28  Eric Christopher  <echristo@redhat.com>

	* c-common.c (c_common_unsafe_for_reeval): Delete.
	* c-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete use.
	* c-pretty-print.c (pp_c_expression): Delete UNSAVE_EXPR case.
	* calls.c (fix_unsafe_tree): Delete.
	(expand_call): Delete code which used above.
	* dojump.c (do_jump): Delete UNSAVE_EXPR case.
	* expr.c (expand_expr_real_1): Ditto.
	* fold-const.c (non_lvalue): Ditto.
	* langhooks-def.h (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
	(lhd_unsafe_for_reeval): Ditto.
	* langhooks.c (lhd_unsafe_for_reeval): Ditto.
	* langhooks.h (unsafe_for_reeval): Ditto.
	(unsave_expr_now): Adjust comment.
	* tree-inline.c (copy_body_r): Delete UNSAVE_EXPR bits.
	(estimate_num_insns_1): Ditto.
	* tree-pretty-print.c (dump_generic_node): Ditto.
	* tree.c (expr_align): Ditto.
	(unsave_expr): Delete.
	(unsafe_for_reeval): Ditto.
	* tree.h (unsafe_for_reeval, unsave_expr): Ditto.
	* tree.def (UNSAVE_EXPR): Delete.
	* objc/objc-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.

2004-07-28  Eric Christopher  <echristo@redhat.com>

	* cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.

2004-07-28  Eric Christopher  <echristo@redhat.com>

	* lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
	(java_unsafe_for_reeval): Ditto.

From-SVN: r85276
2004-07-28 23:44:56 +00:00
Joseph Myers
9dcf6e7366 langhooks.h (estimate_num_insns, [...]): Remove hooks.
* langhooks.h (estimate_num_insns, pushlevel, poplevel, set_block,
	maybe_build_cleanup, update_decl_after_saving): Remove hooks.
	* langhooks.c (lhd_clear_binding_stack): Remove.
	* langhooks-def.h (lhd_clear_binding_stack,
	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING,
	LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define to lhd_do_nothing.
	* system.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_SET_BLOCK,
	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING, LANG_HOOKS_POPLEVEL): Poison.
	* tree.h (poplevel): Don't declare.
	* c-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
	* objc/objc-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK,
	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK):
	Remove.

ada:
	* misc.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.

cp:
	* cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
	* cp-tree.h (poplevel): Declare.
	(set_block): Remove.
	* decl.c (set_block): Remove.

fortran:
	* f95-lang.c (set_block): Remove.
	(gfc_clear_binding_stack): New.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
	(struct binding_level): Remove block_created_by_back_end.
	(clear_binding_level): Likewise.
	(poplevel): Don't handle block_created_by_back_end.

java:
	* java-tree.h (set_block): Remove.
	* lang.c (java_clear_binding_stack): New.
	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
	* decl.c (struct binding_level): Remove this_block.
	(clear_binding_level): Likewise.
	(poplevel): Don't handle this_block.
	(set_block): Remove.

treelang:
	* treetree.c (set_block): Remove.
	(struct binding_level): Remove block_created_by_back_end.
	(clear_binding_level): Likewise.
	(tree_code_create_function_initial,
	tree_code_create_function_wrapup): Call pushlevel and poplevel
	directly rather than through hooks.
	(poplevel): Don't handle block_created_by_back_end.

From-SVN: r84499
2004-07-11 10:53:06 +01:00
Richard Henderson
ac45df5dba except.c (expand_eh_region_start, [...]): Remove.
* except.c (expand_eh_region_start, expand_eh_region_end,
	expand_eh_handler, expand_eh_region_end_cleanup,
	expand_start_all_catch, expand_start_catch, expand_end_catch,
	expand_end_all_catch, expand_eh_region_end_allowed,
	expand_eh_region_end_must_not_throw, expand_eh_region_end_throw,
	expand_eh_region_end_fixup): Remove.
	* stmt.c (struct nesting): Remove stack_level, innermost_stack_block,
	cleanups, outer_cleanups, label_chain, exception_region.
	(struct goto_fixup): Remove stack_level, cleanup_list_list.
	(struct label_chain): Remove.
	(struct stmt_status): Remove x_stack_block_stack.
	(stack_block_stack, expand_goto_internal, expand_fixup, expand_fixups,
	fixup_gotos, save_stack_pointer, expand_decl_cleanup,
	expand_decl_cleanup_eh, expand_cleanups, start_cleanup_deferral,
	end_cleanup_deferral, last_cleanup_this_contour,
	containing_blocks_have_cleanups_or_stack_level,
	any_pending_cleanups): Remove.
	(expand_null_return_1): Take no arguments.
	(expand_label, expand_naked_return, expand_return,
	expand_start_bindings_and_block, expand_end_bindings, expand_decl,
	expand_anon_union_decl, expand_start_case, pushcase, pushcase_range,
	expand_end_case_type): Don't use any of them.
	* calls.c (expand_call): Likewise.
	* dojump.c (do_jump): Likewise.
	* function.c (expand_function_end): Likewise.
	* expr.c (store_expr, expand_expr_real_1): Likewise.
	(safe_from_p): Don't handle WITH_CLEANUP_EXPR, CLEANUP_POINT_EXPR.
	(expand_expr_real_1): Don't handle WITH_CLEANUP_EXPR,
	CLEANUP_POINT_EXPR, TARGET_EXPR, TRY_CATCH_EXPR, CATCH_EXPR,
	EH_FILTER_EXPR, TRY_FINALLY_EXPR, GOTO_SUBROUTINE_EXPR.
	* fold-const.c (fold_checksum_tree): Use first_rtl_op.
	* gengtype.c (adjust_field_tree_exp): Remove rtl op handling.
	* gimplify.c (gimplify_cleanup_point_expr): Renumber operands
	for WITH_CLEANUP_EXPR.
	(gimple_push_cleanup): Likewise.
	* integrate.c (copy_decl_for_inlining): Don't DECL_TOO_LATE.
	* print-tree.c (print_node): Likewise.
	* tree-pretty-print.c (dump_generic_node): Remove GOTO_SUBROUTINE_EXPR.
	* tree.c (first_rtl_op): Always just TREE_CODE_LENGTH.
	(has_cleanups): Remove GOTO_SUBROUTINE_EXPR.
	* tree.def (WITH_CLEANUP_EXPR): Remove op1 and op2.
	(GOTO_SUBROUTINE_EXPR): Remove.
	* tree.h (WITH_CLEANUP_EXPR_RTL): Remove.
	(DECL_TOO_LATE): Remove.
	* except.h, tree.h: Update decls.
ada/
	* trans.c (gnat_to_gnu <N_Handled_Sequence_Of_Statements>): Update
	commentary.
cp/
	* cp-tree.h (expand_eh_spec_block): Remove.
java/
	* expr.c (case_identity, get_primitive_array_vtable,
	java_expand_expr, emit_init_test_initialization): Remove.
	* java-tree.h (java_expand_expr): Remove.
	* lang.c (LANG_HOOKS_EXPAND_EXPR): Remove.

From-SVN: r84275
2004-07-08 00:46:07 -07:00
Ranjit Mathew
fe0b9fb522 Formatting fixes.
* expr.c (class_has_finalize_method): Fix method name indentation.
        (expand_java_call): Remove K&R style parameter declaration.
        (expand_invoke): Fix statement indentation.
        (expand_java_field_op): Likewise.
        * parse-scan.y: Fix typo.
        (reset_report): Fix method name indentation.
        * parse.y (unresolved_type_p, build_expr_block): Remove extra blank
        line. Fix typos.
        * verify.c (verify_jvm_instructions): Document parameters, insert
        page break.
        * lang.c (lang_init_source): Fix method name indentation.
        * class.c (common_enclosing_context_p): Likewise.
        (emit_symbol_table): Fix parameter list indentation.
        * decl.c (add_stmt_to_compound, java_add_stmt): Remove K&R style
        parameter declaration.
        * constants.c: Fix copyright notice indentation.
        * typeck.c (find_method_in_superclasses): Fix parameter list
        indentation.
        (find_method_in_interfaces): Likewise.
        * zextract.c (makelong): Fix method name indentation.

From-SVN: r83738
2004-06-27 18:16:49 +00:00
Diego Novillo
6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Kazu Hirata
c048d56d7e class.c, [...]: Fix comment typos.
* class.c, gjavah.c, lang.c: Fix comment typos.
	* gcj.texi: Fix typos.

From-SVN: r79744
2004-03-20 14:03:34 +00:00
Per Bothner
24d82bce7a class.c (assume_compiled_node_struct): Rename type to class_flag_node_struct, as it is now also used for enable_assertions.
* class.c (assume_compiled_node_struct):  Rename type to
	class_flag_node_struct, as it is now also used for enable_assertions.
	Rename assume_compiled_node typedef.  Rename excludep field to value.
	(find_assume_compiled_node):  Rename function to find_class_flag_node.
	Minor optimization - avoid needless strlen.
	(add_assume_compiled):  Some tweaking and optimization.
	Rename and generalize to add_class_flag takem an extra parameter.
	(add_assume_compled):  New just calls add_class_flag.
	(add_enable_assert, enable_assertions):  New functions.
	(enable_assert_tree):  New static.
	* java-tree.h (add_enable_assert, enable_assertions): New declarations.
	* lang.opt (fenable-assertions, fenable-assertions=,
	fdisable-assertions, fdisable-assertions=):  New options.
	* lang.c (java_handle_option):  Handle new options.
	* parse.y (build_incomplete_class_ref):  Handle class$ in an inner
	class in an interface - create helper class nested in outer interface.
        (build_assertion):  Short-circuit if enable_assertions is false.

From-SVN: r79710
2004-03-19 15:10:55 -08:00
Jan Hubicka
4b589eab01 lang.c (java_estimate_num_insns_1): Fix bug in MODIFY_EXPR cost estimation.
* lang.c (java_estimate_num_insns_1): Fix bug in MODIFY_EXPR cost
	estimation.
	* c-common.c (c_estimate_num_insns_1):  Fix bug in MODIFY_EXPR
	cost estimation.
	* expr.c (MOVE_RATIO, CLEAR_RATIO): Move to ...
	* expr.h (MOVE_RATIO, CLEAR_RATIO): ... here.

From-SVN: r75821
2004-01-13 23:14:04 +00:00
Andrew Haley
85194ee94a re PR java/12755 (Binary Compatibility: Resolving static methods and classes is not thread safe)
2004-01-09  Andrew Haley  <aph@redhat.com>

	PR java/12755:
	* parse.y (java_fix_constructors):  Set output_class.
	(java_reorder_fields): Likewise.
	(java_layout_classes): Likewise.
	(java_expand_classes): Generate indirect dispatch tables.
	(java_expand_classes): Set output_class.
	(java_finish_classes): Likewise.
	* lang.c (java_init): Turn on always_initialize_class_p if we're
	using indirect dis[atch.
	(java_decl_ok_for_sibcall): Use output_class, not current_class.
	(java_get_callee_fndecl): Use class local atable.
	* jcf-parse.c
	(always_initialize_class_p): Decl moved to java-tree.h.
	(HANDLE_CLASS_INFO): Set output_class.
	(read_class): Likewise.
	(parse_class_file): Call gen_indirect_dispatch_tables.
	(parse_zip_file_entries): Set output_class.
	(java_parse_file): Set output_class.  Don't emit symbol tables.
	* java-tree.h (output_class): New.
	Remove global declarations for otable, atable, and ctable.
	(always_initialize_class_p): moved here from decl.c.
	(DECL_OWNER): New.
	(TYPE_ATABLE_METHODS, TYPE_ATABLE_SYMS_DECL, TYPE_ATABLE_DECL,
	TYPE_OTABLE_METHODS, TYPE_OTABLE_SYMS_DECL, TYPE_OTABLE_DECL,
	TYPE_CTABLE_DECL, TYPE_CATCH_CLASSES): New.
	(struct lang_type): Add otable_methods, otable_decl,
	otable_syms_decl, atable_methods, atable_decl, atable_syms_decl,
	ctable_decl, catch_classes, type_to_runtime_map.
	* expr.c (build_field_ref): Make otable, atable, and ctable class
	local rather than global.
	(build_known_method_ref): Likewise.
	(build_invokeinterface): Likewise.
	(java_expand_expr): Pass runtime type (rather than actual type) to
	expand_start_catch.
	* except.c (prepare_eh_table_type): Create TYPE_TO_RUNTIME_MAP for
	this class.  Look up each class in that map to delete duplicates.
	(expand_end_java_handler): Pass runtime type (rather than actual
	type) to expand_start_catch.
	* decl.c: (always_initialize_class_p): Decl moved to java-tree.h.
	(do_nothing): New.
	(java_init_decl_processing): Rearrange things.  Remove global
	declarations of otable, atable, and ctable.
	(java_init_decl_processing): Make lang_eh_runtime_type do_nothing.
	(java_expand_body): Set output_class.
	* constants.c (build_constant_data_ref): Use output_class, not
	current_class.
	(alloc_name_constant): Likewise.
	* class.c (gen_indirect_dispatch_tables): New.
	(build_class_ref): Generate hard reference to superclass, even if
	using indirect dispatch.
	(build_static_field_ref): Use class local atable.
	(make_class_data): Generate hard reference to superclass, even if
	using indirect dispatch.
	Generate symbolic references to interfaces when using indirect
	dispatch.
	(make_class_data): Emit otable, atable, and ctable.
	Make otable, atable, and ctable class local rather than global.
	(emit_catch_table): Make otable, atable, and ctable class local
	rather than global.

From-SVN: r75590
2004-01-09 17:08:44 +00:00
Jason Merrill
1b2b8ee7a9 re PR rtl-optimization/12547 ([tree-ssa] simple java code with -fcheck-references causes gimplification failed)
PR optimization/12547
        * lang.c (java_tree_inlining_walk_subtrees): Just walk
        BLOCK_EXPR_BODY directly.

From-SVN: r73530
2003-11-12 20:25:24 -05:00
Andrew Haley
7304c6cfe9 re PR java/11533 (Inlining drops static initialization of inner class)
2003-11-12  Andrew Haley  <aph@redhat.com>

        PR java/11533
        * lang.c (merge_init_test_initialization): Clear DECL_INITIAL for
        init_test_decls being inlined.

        PR java/12890:
        * parse.y (do_resolve_class): Check return value from
        breakdown_qualified().

From-SVN: r73494
2003-11-12 15:24:42 +00:00
Andrew Haley
904715853c lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
2003-10-22  Andrew Haley  <aph@redhat.com>

        * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): New.
        (java_get_callee_fndecl): New.

        * jcf-parse.c (java_parse_file): Call emit_catch_table().

        * java-tree.h (ctable_decl): New.
        (catch_classes):  New.
        (java_tree_index): Add JTI_CTABLE_DECL, JTI_CATCH_CLASSES.

        * decl.c (java_init_decl_processing): Add catch_class_type.
        Add ctable_decl.
        Add catch_classes field.

        * class.c (build_indirect_class_ref): Break out from
        build_class_ref.
        (make_field_value): Check flag_indirect_dispatch.
        (make_class_data): Ditto.
        Tidy uses of PUSH_FIELD_VALUE.
        Add field catch_classes.
        (make_catch_class_record): New.

        * java-tree.h (PUSH_FIELD_VALUE): Tidy.

2003-10-22  Andrew Haley  <aph@redhat.com>

        * java/lang/natClass.cc (initializeClass): Call
        _Jv_linkExceptionClassTable.
        (_Jv_LinkSymbolTable): Call )_Jv_ThrowNoSuchMethodError.  Call
        _Jv_Defer_Resolution on a method whose ncode is NULL.
        (_Jv_linkExceptionClassTable): New function.
        (_Jv_LayoutVTableMethods): If superclass looks like a constant pool
        entry, look it up.
        * java/lang/Class.h (struct _Jv_CatchClass): New.
        (_Jv_linkExceptionClassTable): New friend.
        (_Jv_Defer_Resolution): New friend.
        (class Class.catch_classes): New field.
        * include/java-interp.h (Jv_Defer_Resolution): New method.
        (_Jv_PrepareClass): Make a friend of _Jv_MethodBase.
        (_Jv_MethodBase.deferred): New field.
        (_Jv_Defer_Resolution): New function.
        * resolve.cc (_Jv_PrepareClass): Resolve deferred handlers.
        * exception.cc (get_ttype_entry): Change return type to void**.
        (PERSONALITY_FUNCTION): Remove all code related to using a
        Utf8Const* for a match type.  Change match type to be a pointer to
        a pointer, rather than a pointer to a Class.
        * defineclass.cc (handleCodeAttribute): Initialize
        method->deferred.
        (handleMethodsEnd): Likewise.

From-SVN: r72886
2003-10-24 09:29:43 +00:00
Kazu Hirata
67264b4fe2 ChangeLog: Fix typos.
* ChangeLog: Fix typos.
	* expr.c: Fix comment typos.
	* jcf-write.c: Likewise.
	* lang.c: Likewise.
	* lex.c: Likewise.
	* mangle.c: Likewise.
	* parse-scan.y: Likewise.
	* parse.y: Likewise.

From-SVN: r72809
2003-10-22 18:00:06 +00:00
Roger Sayle
c67e6e1492 toplev.c (flag_evaluation_order): New global variable.
* toplev.c (flag_evaluation_order): New global variable.
	* flags.h (flag_evaluation_order): Prototype here.
	* expr.c (expand_operands): If we need to preserve observable
	evaluation order, protect exp1 from clobbering exp0's result.

	* java/lang.c (java_init_options): Set flag_evaluation_order.
	* java/expr.c (force_evaluation_order): Don't attempt to force
	evaluation order of binary operations using save_expr.
	* java/parse.y (java_complete_lhs): No longer need to call
	force_evaluation_order when constructing binary operators.

From-SVN: r71873
2003-09-28 04:56:35 +00:00
Jeff Sturm
916b57ceda decl.c (java_expand_body): New function.
* decl.c (java_expand_body): New function.
* expr.c (build_class_init): Set DECL_IGNORED_P.
* java-tree.h (start_complete_expand_method,
java_expand_body): Declare.
* jcf-parse.c (cgraph.h): Include.
(java_parse_file): Handle flag_unit_at_a_time.
* lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING,
LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
(java_estimate_num_insns): Use walk_tree_without_duplicates.
(java_start_inlining): New function.
* parse.h (java_finish_classes): Declare.
* parse.y: Include cgraph.h.
(block): Don't special-case empty block production.
(craft_constructor): Set DECL_INLINE.
(source_end_java_method): Handle flag_unit_at_a_time.
Replace inline code with call to java_expand_body.
(start_complete_expand_method): Remove static modifier.
(java_expand_method_bodies): Patch function tree for
class initialization and/or synchronization as needed.
Don't begin RTL expansion yet.
(java_expand_classes): Check flag_unit_at_a_time before
calling finish_class.
(java_finish_classes): New function.
(java_complete_lhs): Ensure COMPOUND_EXPR has non-NULL type.
(patch_assignment): Set DECL_CONTEXT on temporary variable.
(emit_test_initialization): Set DECL_IGNORED_P.

From-SVN: r71024
2003-09-03 13:44:43 +00:00
Steven Bosscher
d944c82dce c-common.c (c_estimate_num_insns_1): Don't handle METHOD_CALL_EXPR.
2003-07-17  Steven Bosscher  <steven@gcc.gnu.org>

	* c-common.c (c_estimate_num_insns_1): Don't handle
	METHOD_CALL_EXPR.
	* expr.c (safe_from_p): Likewise.
	* gengtype.c (adjust_field_tree_exp): Likewise.
	* stmt.c (warn_if_unused_value): Likewise
	* tree.c (first_rtl_op): Likewise.
	* tree.def: Don't define METHOD_CALL_EXPR.
	* java/lang.c (java_estimate_num_insns_1): Don't handle
	METHOD_CALL_EXPR.

From-SVN: r69511
2003-07-17 13:25:21 +00:00
Jan Hubicka
084c177908 java-tree.h (DECL_NUM_STMTS): Rename to...
* java-tree.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	* lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
	New static functions.
	(LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
	* parser.y (add_stmt_to_compound): Do not account statements.

	* cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	(start_function): Use DECL_ESTIMATED_INSNS.
	* optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS.

	* decl2.c (maybe_emit_vtables): Fix marking vtables as needed in
	unit-at-a-time

	* c-common.c (c_estimate_num_insns_1): New static function.
	(c_estimate_num_insns): New global function.
	* c-common.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	(c_estimate_num_insns): Declare.
	* c-decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* c-semantics.c (add_stmt): Do not account statements.
	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS):
	New.
	* langhooks.h (lang_hooks_for_tree_inlining): Add
	estimate_num_insns
	* params.def (max-inline-insns-auto, max-inline-insns-auto): set
	to 100.
	(max-inline-insns): set to 300.
	(min-inline-insns): set to 10.
	* tree-inline.c (struct inline_data): Rename inlined_stmts to
	inlined-insns.
	(INSNS_PER_STMT): Kill.
	(inlinable_function_p): Compute and store body size.
	(expand_call_inline): Likewise.
	(optimize_inline_calls): Likewise.

From-SVN: r69113
2003-07-09 00:31:20 +00:00
Neil Booth
cb66e38590 c-common.h (c_comon_handle_filename, [...]): New.
* c-common.h (c_comon_handle_filename,
	c_common_missing_arguement): New.
	* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
	* c-opts.c (missing_arg): Rename c_common_missing_argument,
	update to be an appropriate langhook.
	(c_common_handle_option): Don't handle filenames.
	(c_common_handle_filename): New.
	* hooks.c (hook_void_constcharptr,
	hook_bool_constcharptr_size_t_false): New.
	* hooks.h (hook_void_constcharptr,
	hook_bool_constcharptr_size_t_false): New.
	* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct lang_hooks): Add handle_filename and
	missing_argument.
	* opts.c (handle_option): Don't handle filenames here, but ...
	(handle_options): ... here.
	(common_handle_option): Don't handle missing arguments here.
	* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
ada:
	* misc.c (gnat_handle_option): Don't handle filenames.
cp:
	* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): Override.
f:
	* top.c (ffe_handle_option): Don't handle filenames.
java:
	* lang.c (java_handle_option): Don't handle filenames.

From-SVN: r69011
2003-07-06 19:01:21 +00:00
Neil Booth
b86f6cd9ab c-common.h (c_common_init_options): New prototype.
* c-common.h (c_common_init_options): New prototype.
	* c-opts.c (deferred_size): Remove.
	(defer_opt): Array is now pre-allocated.
	(c_common_init_options): Pre-allocate deferred_opts.  Make
	lang_flags unsigned.
	(push_command_line_options): Free deferred_opts.
	* hooks.c (hook_uint_uint_constcharptrptr_0): New.
	* hooks.h (hook_uint_uint_constcharptrptr_0): New.
	* langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): Update.
	* langhooks.h (struct lang_hooks): New prototype for init_options.
	* main.c (main): Cast argv.
	* opts.c (handle_option, handle_options): Update prototypes.
	(decode_options): save_argc, save_argv are not global.  Constify.
	* opts.h (decode_options): New prototype.
	* toplev.c (general_init): New protoype.
	(save_argv): Make static.
	(save_argc): Remove.
	(print_switch_values, general_init): Constify.
	(toplev_main): Save argv.
	* toplev.h (toplev_main): Update prototype.
	(save_argc, save_argv): Remove.
ada:
	* misc.c (save_argc, save_argv): Make static.
	(gnat_init_options): New prototype.
	(gnat_init_options): Update.
f:
	* top.c (ffe_init_options): Update prototype.
	* top.h (ffe_init_options): Update prototype.
java:
	* lang.c (java_init_options): Update prototype.
treelang:
	* tree1.c (treelang_init_options): Update prototype.
	* treelang.h (treelang_init_options): Update prototype.

From-SVN: r68850
2003-07-02 20:15:46 +00:00
Neil Booth
9eee5e726d c-opts.c (missing_arg): Make non-static.
* c-opts.c (missing_arg): Make non-static.
	(c_common_handle_option): Don't check for missing arguments.
	* opts.c (handle_option): Check for missing arguments.
ada:
	* misc.c (gnat_handle_option): Don't check for missing arguments.
f:
	* top.c (ffe_handle_option): Don't check for missing arguments.
java:
	* lang.c (java_handle_option): Don't check for missing arguments.
testsuite:
	* const-str-2.m: Update.

From-SVN: r68517
2003-06-26 06:05:36 +00:00
Robert Abeles
f3f735eb70 re PR debug/4252 (cc1: Invalid option `-fdump-translation-unit')
PR debug/4252
	* c-opts.c (c_common_handle_option): Pass -fdump argument suffix
	to dump_switch_p().
	* tree-dump.c (dump_switch_p): Remove redundant 'dump-' prefix
	from static strings in dump_files.
cp:
	* optimize.c (dump_function): Form complete flag name by
	prefixing 'fdump-' to string returned by dump_flag_name().
java:
	* lang.c (java_handle_option): Likewise.

From-SVN: r68137
2003-06-18 05:58:55 +00:00
Neil Booth
7b086b11df c-opts.c (c_common_handle_option): s/on/value/.
* c-opts.c (c_common_handle_option): s/on/value/.
	(OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value
	directly rather than converting the argument.
	* c.opt: Update docs.  Use UInteger where appropriate.
	* common.opt: Use UInteger where appropriate.
	* opts.c (integral_argument): New.
	(handle_argument): Handle integral arguments, and optional
	joined arguments.
	(common_handle_option): Update.
	* opts.h (CL_MISSING_OK, CL_UINTEGER): New.
	* opts.sh: Handle JoinedOrMissing and UInteger flags.
java:
	* lang.c (java_handle_option): Special-casing of optional
	joined arguments no longer needed.
	* lang.opt: Update switches that take optional argument.

From-SVN: r67999
2003-06-16 05:47:07 +00:00
Neil Booth
be43ab4e01 c-opts.c (lang_flags): Update for new spelling of flags.
* c-opts.c (lang_flags): Update for new spelling of flags.
	(write_langs): Similarly.
	* c.opt: Specify languages.
	* opts.h: Remove languages.
	* opts.sh: Recognise front-end defined languages.
ada:
	* lang.opt: Declare Ada.
	* misc.c (gnat_init_options): Update.
doc:
	* sourcebuild.texi: Update.
f:
	* lang.opt: Declare F77.
java:
	* lang.opt: Declare Java.
	* lang.c (java_init_options): Update.
treelang:
	* lang.opt: Declare Treelang.  Update.
	* tree1.c (treelang_init_options): Update.

From-SVN: r67976
2003-06-15 14:56:32 +00:00
Neil Booth
d185d26881 c-pch.c (asm_file_name): Remove.
* c-pch.c (asm_file_name): Remove.
	* common.opt: Add more switches.
	* flags.h (g_switch_set): Boolify.
	* opts.c (g_switch_value, g_switch_set, exit_after_options,
	version_flag): Move from toplev.c.
	(common_handle_option): Handle more switches from toplev.c.
	* toplev.c (display_help, display_target_options, decode_d_option,
	print_version): Make non-static, remove prototypes.
	(aux_base_name, asm_file_name, aux_info_file_name): Constify.
	(version_flag, g_switch_value, g_switch_set, exit_after_options):
	Remove.
	(independent_decode_option): Move some handlers to opts.c.
	* toplev.h (aux_info_file_name, aux_base_name, asm_file_name,
	exit_after_options, version_flag, display_help, display_target_options,
	print_version, decode_d_option): New.
java:
	* lang.c (version_flag): Rename to v_flag to avoid clash w/ toplev.h.

From-SVN: r67971
2003-06-15 08:30:02 +00:00
Neil Booth
cef67dcecf lang-specs.h: Rewrite -MD and -MMD to append an underscore.
* lang-specs.h: Rewrite -MD and -MMD to append an underscore.
	* lang.c (java_handle_option): -MD and -MMD have an underscore.
	* lang.opt: -MD and -MMD have an underscore.

From-SVN: r67958
2003-06-14 22:25:50 +00:00
Neil Booth
d7b4261875 Makefile.in: Update to use common.opt and lang_opt_files.
* Makefile.in: Update to use common.opt and lang_opt_files.
	(c-options.c, c-options.h): Remove.
	(options.c, options.h): Add.
	* c-opts.c: Include options.h not c-options.h.
	* common.opt: New file.
	* configure, configure.in: Add lang_opt_files.
	* opts.c: Include flags.h and diagnostic.h.
	(common_handle_option): New.
	(handle_option): Update to recognize common options and all
	language-dependent options.
	* opts.h (CL_F77, CL_JAVA, CL_ADA, CL_COMMON, CL_TREELANG): New.
	(struct cl_option): Make flags of type int.
	* opts.h: Flag option with front ends to which it applies.
	Handle duplicate options.
	* toplev.c (filename): Remove.
	(independent_decode_option): Don't handle filenames and -quiet.
	(process_options, do_compile): Update.
ada:
	* Make-lang.in: Update to use options.c and options.h.
	* misc.c: Include options.h not aoptions.h.
	(gnat_handle_option): Abort on unrecognized switch.
	(gnat_init_options): Request Ada switches.
cp:
	* Make-lang.in: Remove c-options.o.
f:
	* Make-lang.in: Update to use options.c and options.h.
	* top.c: Include options.h not f-options.h.
	(gnat_handle_option): Abort on unrecognized switch.
	(ffe_init_options): From com.c.  Request F77 options.
	(ffe_handle_options): Abort on unrecognized switch.
	* com.c (ffe_init_options): Move to top.c.
	* top.h (fee_init_options): New.
java:
	* Make-lang.in: Update to use options.c and options.h.
	* lang.c: Include options.h not j-options.h.
	(java_handle_option): Abort on unrecognized option.
	(java_init_options): Request Java switches.
treelang:
	* Make-lang.in: Update to use options.c and options.h.
	* tree1.c: Include options.h not t-options.h.
	(treelang_init_options): New.
	(treelang_handle_option): Abort on unrecognized switch.
	* treetree.c (LANG_HOOKS_INIT_OPTIONS): Override.
	* treetree.h (treelang_init_options): New.

From-SVN: r67941
2003-06-14 12:26:36 +00:00
Tom Tromey
4a09cbac25 lang.c (java_handle_option): Update dependency_tracking for OPT_MF case.
* lang.c (java_handle_option): Update dependency_tracking for
	OPT_MF case.

From-SVN: r67779
2003-06-11 15:58:05 +00:00