Commit Graph

1971 Commits

Author SHA1 Message Date
Jason Merrill 5afb79e7f8 function.c (retrofit_block): Abort if we don't find a suitable insn.
* function.c (retrofit_block): Abort if we don't find a suitable insn.
        (insert_block_after_note): Abort if we don't have a previous block.
        Remove FN parameter.
        * function.h: Adjust.

        * tree.c (walk_tree): Walk operand subtrees in forward order.
        * optimize.c (expand_call_inline): Likewise.
        (optimize_function): Initialize id->scope_stmt to something useful.
        (remap_block): Assume id->scope_stmt has a useful value.

From-SVN: r30965
1999-12-15 19:09:35 -05:00
Jason Merrill 8890f3d8df tweak comments
From-SVN: r30961
1999-12-15 14:33:38 -05:00
Nathan Sidwell 8be7ab5d48 typeck.c (build_c_cast): Expand warning message.
* typeck.c (build_c_cast): Expand warning message. Move pointer
	alignment warning to after the cast. Don't warn about pointer
	alignment when given a pointer to incomplete.
fix cut-n-paste error on 1999-12-09  Andreas Jaeger and
1999-12-09  Mark Mitchell (was 11999 & 999)

From-SVN: r30952
1999-12-15 12:39:02 +00:00
Richard Henderson 33848bb028 cp-tree.h (make_aggr_type): Declare.
* cp-tree.h (make_aggr_type): Declare.
        * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE.
        (make_aggr_type): New.

        * decl.c (build_typename_type, init_decl_processing): Use it.
        (build_ptrmemfunc_type, xref_tag): Likewise.
        * except.c (call_eh_info): Likewise.
        * init.c (init_init_processing): Likewise.
        * pt.c (process_template_parm, lookup_template_class): Likewise.
        * rtti.c (expand_class_desc): Likewise.
        * semantics.c (begin_class_definition, finish_typeof): Likewise.
        * tree.c (copy_template_template_parm): Likewise.

From-SVN: r30951
1999-12-15 01:51:24 -08:00
Jason Merrill 04a2ecf780 cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using sizeof (struct tree_common).
* cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using
	sizeof (struct tree_common).

From-SVN: r30949
1999-12-15 04:18:21 -05:00
Jason Merrill 8cb360d3a2 optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the outermost block to point to the inlined...
* optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the
        outermost block to point to the inlined function decl.

From-SVN: r30945
1999-12-15 04:03:06 -05:00
Jason Merrill d67cdbc3fd error.c (dump_decl): operator==, not operator ==.
* error.c (dump_decl): operator==, not operator ==.
        (op_to_string): Likewise.

        * decl.c (compute_array_index_type): Handle null name.

        * decl2.c (ambiguous_decl): Fix to match comment.
        (lookup_using_namespace): Adjust.

        * decl2.c (import_export_class): Don't ignore dllimport.

From-SVN: r30935
1999-12-14 20:34:16 -05:00
Mark Mitchell 08b962b08b class.c (check_field_decls): Split out from ...
* class.c (check_field_decls): Split out from ...
	(finish_struct_1): ... here.  Use it.  Tidy.

From-SVN: r30934
1999-12-15 00:36:57 +00:00
Mark Mitchell d7d5e42f2d cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
* cp-tree.h (remap_save_expr): Add walk_subtrees parameter.
	* optimize.c (copy_body_r): Pass it.
	* tree.c (remap_save_expr): Clear walk_subtrees for an
	already-handled SAVE_EXPR.
	(cp_unsave_r): Pass walk_subtrees to remap_save_expr.

From-SVN: r30926
1999-12-14 18:52:40 +00:00
Mark Mitchell 89c6e7ac34 dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
* dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS.
	* ir.texi (DECL_NAMESPACE_ALIAS): Document it.

	* error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION.

From-SVN: r30925
1999-12-14 18:11:32 +00:00
Mumit Khan 5574ac398a class.c (finish_base_struct): Allow multiple COM base classes as well as non-COM bases as long as it's not...
1999-12-14  Mumit Khan  <khan@xraylith.wisc.edu>

	* class.c (finish_base_struct): Allow multiple COM base classes
	as well as non-COM bases as long as it's not the leftmost.

From-SVN: r30901
1999-12-14 07:00:22 +00:00
Mumit Khan 0b807ad843 lex.c (saving_parse_to_obstack): New global.
1999-12-13  Mumit Khan  <khan@xraylith.wisc.edu>

	* lex.c (saving_parse_to_obstack): New global.
	(reinit_parse_for_block): Use.
	(reinit_parse_for_expr): Use.
	(check_newline): Use.

From-SVN: r30896
1999-12-14 05:33:22 +00:00
Mark Mitchell 92e8164f76 optimize.c (initialize_inlined_parameters): Take FN to which the parameters belong as an argument.
* optimize.c (initialize_inlined_parameters): Take FN to which the
	parameters belong as an argument.
	(expand_call_inline): Expand calls into the parameter
	initializations before pushing the function onto the list of
	functions we are presently expanding.

From-SVN: r30888
1999-12-13 08:40:04 +00:00
Kaveh R. Ghazi 486837a79c class.c (get_vtable_name): Use a literal format string and VTABLE_NAME_PREFIX macro instead of...
* class.c (get_vtable_name): Use a literal format string and
	VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT.
	(prepare_fresh_vtable): Likewise.

	* cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of
	VTABLE_NAME_FORMAT.

	* decl.c (make_rtl_for_local_static): Remove unused variable `type'.

	* init.c (build_vec_init): Initialize variable `try_body'.

	* lex.c (yyerror): Don't call a variadic function with a
	non-literal format string.

	* optimize.c (optimize_function): Call memset, not bzero.

	* pt.c (for_each_template_parm_r): Add static prototype.

From-SVN: r30868
1999-12-11 19:02:10 +00:00
Andreas Jaeger 225ff11985 except.c (expand_throw): Add static attribute to match prototype.
* except.c (expand_throw): Add static attribute to match
	prototype.

	* Makefile.in (semantics.o): Add dependency on output.h.
	* semantics.c: Include output.h for declaration of
	make_function_rtl.

From-SVN: r30850
1999-12-09 23:24:58 +00:00
Mark Mitchell 3eb24f739e decl.c (init_decl_processing): Reenable inlining on trees.
* decl.c (init_decl_processing): Reenable inlining on trees.
	(finish_function): Likewise.
	* expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here.
	* semantics.c (simplify_aggr_init_exprs): New function.
	(expand_body): Use it.
	* tree.c (walk_tree): Special-case TARGET_EXPRs since they
	sometimes present the same sub-tree twice.

From-SVN: r30849
1999-12-09 19:13:33 +00:00
Mark Mitchell 373eb3b3b1 dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not `csl'.
* dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not
	`csl'.

	* semantics.c (finish_switch_cond): Do conversions here, not ...
	* typeck.c (c_expand_start_case): Here.

	* semantics.c (do_poplevel): Remove unused variable.

From-SVN: r30840
1999-12-09 09:07:29 +00:00
Mark Mitchell b3a44a4c9f tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE unless...
* tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE
	unless we're declaring the variable in question.

From-SVN: r30816
1999-12-07 07:49:33 +00:00
Mark Mitchell 883298a5e7 decl.c (init_decl_processing): #if 0 last patch.
* decl.c (init_decl_processing): #if 0 last patch.
	(finish_function): Likewise.

From-SVN: r30797
1999-12-06 10:36:16 +00:00
Mark Mitchell bccd95ae77 decl.c (init_decl_processing): Set flag_inline_trees if !flag_no_inline.
* decl.c (init_decl_processing): Set flag_inline_trees if
	!flag_no_inline.

From-SVN: r30792
1999-12-05 20:04:37 +00:00
Mark Mitchell 95fabfd362 cp-tree.h (calls_setjmp_p): Declare.
* cp-tree.h (calls_setjmp_p): Declare.
	* decl.c (finish_function): Mark functions that call setjmp as
	uninlinable.
	* optimize.c (calls_setjmp_r): New function.
	(calls_setjmp_p): Likewise.

From-SVN: r30789
1999-12-05 17:58:46 +00:00
Mark Mitchell 5679f67863 optimize.c (expand_call_inline): Wrap the expanded call in an EXPR_WITH_FILE_LOCATION node to get correct line...
* optimize.c (expand_call_inline): Wrap the expanded call in an
	EXPR_WITH_FILE_LOCATION node to get correct line numbers for
	inlined functions.

From-SVN: r30784
1999-12-05 02:46:48 +00:00
Mark Mitchell 390f4e9a7d optimize.c (inline_data): Remove fns_top.
* optimize.c (inline_data): Remove fns_top.  Add scope_stmt.  Add
	in_target_cleanup_p.
	(remap_decl): New function.
	(remap_block): Likewise.
	(copy_scope_stmt): Likewise.
	(copy_body_r): Use remap_decl and copy_scope_stmt.
	(copy_body): Use VARRAY_TOP_TREE.
	(initialize_inlined_parameters): Likewise.
	(declare_return_variable): Likewise.
	(inlinable_function_p): Check flag_inline_trees.
	(expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs
	specially.  Use VARRAY_PUSH_TREE.  Create a BLOCK for the
	parameters of the inlined function.
	(optimize_function): Prevent recursion into partially complete
	functions.

From-SVN: r30781
1999-12-05 01:00:28 +00:00
Mark Mitchell 5a586e5083 cp-tree.def (SCOPE_STMT): Take one operand.
* cp-tree.def (SCOPE_STMT): Take one operand.
	* cp-tree.h (SCOPE_STMT_BLOCK): New macro.
	(SCOPE_NULLIFIED_P): Redefine.
	(SCOPE_NO_CLEANUPS_P): New macro.
	(add_scope_stmt): Change prototype.
	* decl.c (poplevel): Tidy.  Warn about unused variables here.
	Record SCOPE_STMT_BLOCKs.
	(finish_function): Keep DECL_INITIAL for functions that might be
	inlined.
	* ir.texi: Document SCOPE_NO_CLEANUPS_P.
	* semantics.c: Include rtl.h.
	(add_scope_stmt): Return the new scope statement and, for an
	end-of-scope statement, its matching begin statement.  Don't set
	SCOPE_NULLIFIED_P.
	(do_pushlevel): Simplify, now that we are always
	function-at-a-time.
	(do_poplevel): Likewise.  Record SCOPE_STMT_BLOCKs.
	(expand_stmt): Don't call expand_start_bindings or
	expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
	* tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
	SCOPE_NULLIFIED_P.
	* Makefile.in (semantics.o): Depend on RTL_H.

From-SVN: r30780
1999-12-05 00:51:38 +00:00
Mark Mitchell d9b2d9da75 cp-tree.def (SCOPE_STMT): Take one operand.
* cp-tree.def (SCOPE_STMT): Take one operand.
	* cp-tree.h (SCOPE_STMT_BLOCK): New macro.
	(SCOPE_NULLIFIED_P): Redefine.
	(SCOPE_NO_CLEANUPS_P): New macro.
	(add_scope_stmt): Change prototype.
	* decl.c (poplevel): Tidy.  Warn about unused variables here.
	Record SCOPE_STMT_BLOCKs.
	(finish_function): Keep DECL_INITIAL for functions that might be
	inlined.
	* ir.texi: Document SCOPE_NO_CLEANUPS_P.
	* semantics.c: Include rtl.h.
	(add_scope_stmt): Return the new scope statement and, for an
	end-of-scope statement, its matching begin statement.  Don't set
	SCOPE_NULLIFIED_P.
	(do_pushlevel): Simplify, now that we are always
	function-at-a-time.
	(do_poplevel): Likewise.  Record SCOPE_STMT_BLOCKs.
	(expand_stmt): Don't call expand_start_bindings or
	expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set.
	* tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting
	SCOPE_NULLIFIED_P.

From-SVN: r30779
1999-12-05 00:49:26 +00:00
Mark Mitchell 2c0f17dc4f decl2.c (pending_statics_used): Make it a macro.
* decl2.c (pending_statics_used): Make it a macro.
	(saved_inlines_used): Likewise.
	(finish_static_data_member_decl): Use VARRAY_PUSH_TREE.
	(mark_inline_for_output): Likewise.
	(ssdf_decls_used): Remove.
	(start_static_storage_duration_function): Use VARRAY_PUSH_TREE.
	(generate_ctor_or_dtor_function): Adjust accordingly.

From-SVN: r30778
1999-12-05 00:37:56 +00:00
Geoff Keating a157febd0c c-common.c (enum attrs): Add A_NO_LIMIT_STACK.
* c-common.c (enum attrs): Add A_NO_LIMIT_STACK.
(init_attributes): Add A_NO_LIMIT_STACK.
(decl_attributes): Handle A_NO_LIMIT_STACK.
* c-decl.c (duplicate_decls): Handle DECL_NO_LIMIT_STACK.
* explow.c (allocate_dynamic_stack_space) [!HAVE_allocate_stack]:
Handle stack bounds checking.
* flags.h (flag_stack_check): Use the word 'probe' rather than
'check', because the flag doesn't actually cause any checking to
be done.
* function.c (expand_function_start): Set
current_function_limit_stack.
* function.h (struct function): Add limit_stack.
(current_function_limit_stack): Define.
* invoke.texi (Code Gen Options): Document new options.
* rtl.h: Declare stack_limit_rtx.
* toplev.c (stack_limit_rtx): New variable.
(decode_f_option): Handle new options -fstack-limit-register=REG,
-fstack-limit-symbol=IDENT, -fno-stack-limit.
(main): Add stack_limit_rtx as GC root.
* tree.h (DECL_NO_LIMIT_STACK): New macro.
(struct tree_decl): New member no_limit_stack.

* config/rs6000/rs6000.c (rs6000_allocate_stack_space): Handle
stack_limit_rtx.
* config/rs6000/rs6000.md (allocate_stack): Handle stack_limit_rtx.
(conditional_trap+1): Get new mnemonic correct.
(conditional_trap+2): New pattern for DImode traps.

* config/m68k/m68k.c (output_function_prologue): Handle
stack_limit_rtx.
* config/m68k/m68k.md (trap): New insn.
(conditional_trap): New insn.
* md.texi (Standard Names): Document `trap' and
`conditional_trap'.
* optabs.c (gen_cond_trap): Use start_sequence()/end_sequence()
so a cc0 setter doesn't get emitted at some random place in the
function.

* config/i960/i960.md (trap): New insn.
(conditional_trap): New expander.
(conditional_trap+1, conditional_trap+2): New insns for signed
and unsigned cases.
* config/i960/i960.c (i960_function_prologue): Use
STARTING_FRAME_OFFSET.  Handle stack_limit_rtx.

Co-Authored-By: Greg McGary <gkm@gnu.org>

From-SVN: r30771
1999-12-04 03:00:04 +00:00
Mike Stump 2fbfe9b812 Fix p24939.
From-SVN: r30765
1999-12-03 03:31:44 +00:00
Mark Mitchell a09ba2e041 cp-tree.h (min_tree_cons): Remove.
* cp-tree.h (min_tree_cons): Remove.
	(scratch_ovl_cons): Likewise.
	* decl.c (saveable_obstack): Don't declare.
	(duplicate_decls): Tweak error-message.
	(initialize_local_var): Explicitly mark the definition as static.
	(finish_function): Call permanent_allocation, just so
	that the middle-end sees the obstacks it expects.
	(mark_cp_function_context): Likewise.
	* init.c (build_new): Don't use min_tree_cons.
	* lex.c (permanent_obstack): Don't declare.
	(current_obstack, saveable_obstack): Likewise.
	* spew.c (current_obstack, saveable_obstack): Likewise.
	* tree.c (current_obstack, saveable_obstack): Likewise.
	(scratch_ovl_cons): Remove.
	(build_min_nt): Don't mess with obstacks.
	(build_min): Likewise.
	(min_tree_cons): Remove
	* typeck.c (build_component_ref): Don't use scratch_ovl_cons.
	(build_x_function_call): Likewise.
	(build_c_cast): Don't use min_tree_cons.

From-SVN: r30743
1999-12-01 18:09:09 +00:00
Mark Mitchell de96bf571d * pt.c (tsubst_decl): Robustify.
From-SVN: r30716
1999-11-29 23:39:29 +00:00
Mark Mitchell 1c1c0761d8 Fix typo
From-SVN: r30679
1999-11-27 18:04:50 +00:00
Mark Mitchell 21b0c6dc7c decl2.c (finish_file): Call expand_body for inline functions that will be written out but that do not...
* decl2.c (finish_file): Call expand_body for inline functions
	that will be written out but that do not yet have RTL.
	* semantics.c (expand_body): Do not generate RTL For inline
	functions that do not yet need to be written out.

From-SVN: r30678
1999-11-27 18:01:48 +00:00
Mark Mitchell 46e8c075d0 Make-lang.in (CXX_SRCS): Add optimize.c.
1999-11-25  Mark Mitchell  <mark@codesourcery.com>

	* Make-lang.in (CXX_SRCS): Add optimize.c.
	* Makefile.in (CXX_OBJS): Add optimize.o.
	(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
	(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
	(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
	(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
	(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
	(dump.o): Likewise.
	(optimize.o): New target.
	* class.c: Don't include splay-tree.h.
	* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
	* cp-tree.h: Include splay-tree.h.
	(DECL_UNINLINABLE): New macro.
	(CTOR_BEGIN_P, CTOR_END_P): New macros.
	(flag_inline_trees): New variable.
	(local_variable_p): New function.
	(nonstatic_local_decl_p): Likewise.
	(optimize_function): Likewise.
	(cplus_unsave_expr_now): Remove.
	(copy_tree_r): Declare.
	(remap_save_expr): Likewise.
	* decl.c (local_variable_p): Don't
	make it static.
	(local_variable_p_walkfn): New function.
	(make_rtl_for_local_static): Remove code to try to avoid writing
	out static constants.
	(emit_local_var): Fix indentation.
	(nonstatic_local_decl_p): New function.
	(check_default_argument): Use local_variable_p_walkfn, not
	local_variable_p, when walking the tree.
	(start_function): Set the DECL_CONTEXT for automatically generated
	labels.
	(finish_constructor_body): Use CTOR_STMT to mark the end of a
	constructor.
	* decl2.c: Don't include splay-tree.h.
	(flag_inline_trees): Define.
	* dump.c: Don't include
	splay-tree.h.
	* except.c (expand_end_catch_block): Fix comment formatting.
	(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
	(expand_throw): Tidy comment.
	* init.c (build_vec_delete_1): Use create_temporary_var.
	* lex.c (cplus_tree_code_type): Make it static.
	(cplus_tree_code_length): Likewise.
	(cplus_tree_code_name): Likewise.
	* optimize.c: New file.
	* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
	with computed gotos.
	(setup_vtbl_ptr): Mark the beginnings of constructors with
	CTOR_STMT.
	(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
	(expand_body): Call optimize_function.  Save bodies if we're doing
	inlining on trees.
	* tree.c: Don't include splay-tree.h.  Include insn-config.h and
	integrate.h.
	(copy_tree_r): Make it public.
	(statement_code_p): New function.
	(mark_local_for_remap_r): Likewise.
	(cp_usave_r): Likewise.
	(cp_unsave): Likewise.
	(build_cplus_new): Set DECL_CONTEXT for temporary variables.
	(walk_tree): Walk into `s' class nodes.  Walk statement chains.
	(copy_tree_r): Handle 's' class nodes.  Restore chains for
	statements.  Nullify scopes.  Don't copy types.
	(init_tree): Set lang_unsave to cp_unsave.
	(remap_save_expr): Define.
	* ir.texi: Document CTOR_STMT.

From-SVN: r30669
1999-11-25 20:32:04 +00:00
Jason Merrill 50e159f655 search.c (note_debug_info_needed): Do perform this optimization for dwarf2.
* search.c (note_debug_info_needed): Do perform this optimization
        for dwarf2.
        (maybe_suppress_debug_info): Likewise.  Start by clearing
        TYPE_DECL_SUPPRESS_DEBUG.

From-SVN: r30658
1999-11-24 21:33:31 -05:00
Mark Mitchell f0adc63709 pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.
* pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs.

	* decl2.c (finish_vtable_vardecl): Don't prune vtables here.

From-SVN: r30656
1999-11-25 01:56:13 +00:00
Kaveh R. Ghazi b9d1251954 decl.c (pushdecl, [...]): Don't call a variadic function with a non-literal format string.
* decl.c (pushdecl, grokdeclarator): Don't call a variadic
        function with a non-literal format string.

        * lex.c (do_identifier): Likewise.

        * typeck.c (build_unary_op): Likewise.

From-SVN: r30641
1999-11-23 16:17:52 +00:00
Mark Mitchell 10f82b957f * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
From-SVN: r30635
1999-11-23 08:08:53 +00:00
Mark Mitchell a93dcbc53a cp-tree.def (CTOR_COMPLETE): New tree node.
* cp-tree.def (CTOR_COMPLETE): New tree node.
	* decl.c (finish_constructor_body): Add it, to mark the end of the
	constructor.
	(finish_function): Don't call end_protect_partials here.
	* ir.texi (CTOR_COMPLETE): Document it.
	* semantics.c (expand_stmt): Handle it.

From-SVN: r30634
1999-11-23 08:07:09 +00:00
Mark Mitchell 083eb5756f cp-tree.def (CTOR_COMPLETE): New tree node.
* cp-tree.def (CTOR_COMPLETE): New tree node.
	(finish_constructor_body): Add it, to mark the end of the
	constructor.
	(finish_function): Don't call end_protect_partials here.
	* ir.texi (CTOR_COMPLETE): Document it.
	* semantics.c (expand_stmt): Handle it.

From-SVN: r30630
1999-11-23 07:31:07 +00:00
Mark Mitchell f981720185 cp-tree.def (FUNCTION_NAME): New tree node.
* cp-tree.def (FUNCTION_NAME): New tree node.
	* cp-tree.h (current_function_name_declared): Tweak documentation.
	(lang_decl_flags): Add pretty_function_p, adjust dummy.
	(DECL_PRETTY_FUNCTION_P): New macro.
	* decl.c (cp_finish_decl): Handle declarations of __FUNCTION__,
	etc., in a template function.  Use at_function_scope_p instead of
	expanding it inline.
	* pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations
	specially.
	(tsubst): Handle FUNCTION_NAME.
	(tsubst_copy): Likewise.
	(instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__,
	etc. in instantiation.
	* semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc.,
	even in template functions.
	(setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the
	conditional scope at the top of a destructor.

	* error.c (dump_function_decl): Use `[ with ... ]' syntax for
	specializations too.

From-SVN: r30625
1999-11-23 02:49:41 +00:00
Nathan Sidwell 88b4335f8a semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT when actually negative.
* semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT
	when actually negative.

	* typeck.c (convert_for_assignment): Expand comment about
	strange NULL check, moved from ...
	(convert_for_initialization): ... here. Remove unneeded
	code.

From-SVN: r30616
1999-11-22 16:08:14 +00:00
Alexandre Oliva c7edeea32a cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
* cp-tree.h (build_vec_delete): Remove `auto_delete' argument.
* init.c (build_vec_delete, build_vec_delete_1): Likewise.
Always destruct virtual bases of array components, but never
delete them.
(build_vec_init): Adjust invocations.
(build_delete): Likewise.
* decl2.c (delete_sanity): Likewise.

From-SVN: r30606
1999-11-21 17:44:34 +00:00
Nathan Sidwell 535233a89f extend.texi: Document C++ restricted pointers and references.
* extend.texi: Document C++ restricted pointers and references.

	* cp-tree.h (grok_method_quals): Return this pointer qualifiers.
	* decl.c (grokdeclarator): Adjust calls to grok_method_quals.
	* decl2.c (grok_method_quals): Accept `restrict' as applying to
	the object pointer. Return such qualifiers.
	(grokclassfn): Apply this pointer qualifiers. Cleanup unused
	variables.

From-SVN: r30587
1999-11-19 13:03:00 +00:00
Mark Mitchell 4a6ef811c8 except.c (expand_end_catch_block): Fix typo.
* except.c (expand_end_catch_block): Fix typo.
	(expand_exception_blocks): Simplify.  Don't call
	expand_leftover_cleanups.

From-SVN: r30577
1999-11-18 17:52:27 +00:00
Jason Merrill c95cd22e91 cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
* cp-tree.h, decl.c (compute_array_index_type): Make nonstatic.
        * pt.c (tsubst, case INTEGER_TYPE): Call it.
        Check uses_template_parms.

From-SVN: r30548
1999-11-16 00:58:53 -05:00
Mark Mitchell 58595203f2 cp-tree.h (build_enumerator): Change prototype.
* cp-tree.h (build_enumerator): Change prototype.
	* decl.c (enum_next_value): Remove.
	(enum_overflow): Likewise.
	(init_decl_processing): Don't register enum_next_value as a root.
	(start_enum): Clear TYPE_VALUES for a redefined enum.
	(finish_enum): Reset the type of enumeration constants.
	(build_enumerator): Fix indentation.  Don't copy CONST_DECLs when
	we don't need to.  Maintain the TYPE_VALUES list and look there
	for the previously defined enumeration constant.  Let enumeration
	constants have the type of their values until the enumeration type
	is complete.
	* parse.y (enumlist_opt, enumlist, enumerator): Don't return a value.
	(structsp): Adjust.
	* parse.c: Regenerated.
	* pt.c (tsubst_enum): Adjust according to build_enumerator changes.

From-SVN: r30544
1999-11-16 03:42:28 +00:00
Jason Merrill ae673f1403 class.c (finish_struct): If we're a local class in a template function, add a TAG_DEFN.
* class.c (finish_struct): If we're a local class in a template
        function, add a TAG_DEFN.
        * pt.c (lookup_template_class): If this is a local class in a
        template function, call pushtag.
        (tsubst_expr, case TAG_DEFN): Handle classes, too.

        Emit debug info with the vtable.
        * search.c (maybe_suppress_debug_info): New function...
        * class.c (finish_struct_1): ...split out from here.
        * cp-tree.h: Declare it.
        * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG
        if we're writing out the vtable.
        * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p,
        note_debug_info_needed): #if 0 out.

From-SVN: r30541
1999-11-15 20:37:39 -05:00
Mark Mitchell cd9f6678b3 cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
* cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro.
	* call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not
	TREE_PERMANENT.
	* decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P.
	* decl2.c (lookup_arg_dependent): Use it.

	* cp-tree.h (cp_finish_decl): Change prototype.
	(finish_static_data_member_decl): Likewise.
	(push_permanent_obstack): Remove declaration.
	(push_expression_obstack): Likewise.
	(push_scratch_obstack): Likewise.
	(DECL_TEMPLATE_PARM_P): Robustify.
	(SET_DECL_TEMPLATE_PARM_P): New macro.
	* class.c (add_method): Don't manipulate obstacks.
	(finish_vtbls): Likewise.
	* cvt.c (build_up_reference): Adjust calls to cp_finish_decl.
	* decl.c (binding_for_name): Don't manipulate obstacks.
	(maybe_push_to_top_level): Likewise.
	(pop_from_top_level): Likewise.
	(duplicate_decls): Likewise.
	(pushdecl): Likewise.
	(implicitly_declare): Likewise.
	(build_typename_type): Likewise.
	(start_decl): Likewise.
	(cp_finish_decl): Likewise.
	(finish_decl): Likewise.
	(destroy_local_static): Likewise.
	(expand_static_init): Likewise.
	(complete_array_type): Likewise.
	(grokvardecl): Likewise.
	(build_ptrmemfnc_type): Likewise.
	(grokdeclarator): Likewise.
	(xref_tag): Likewise.
	(xref_basetypes): Likewise.
	(start_enum): Likewise.
	(finish_enum): Likewise.
	(start_function): Likewise.
	(finish_function): Likewise.
	(start_method): Adjust call to cp_finish_decl.
	* decl2.c (finish_static_data_member_decl): Don't manipulate
	obstacks.
	(grokfield): Likewise.
	(grokbitfield): Likewise.
	(get_temp_name): Likewise.
	(get_sentry): Likewise.
	(fnish_file): Likewise.
	(lookup_arg_dependent): Likewise.
	* except.c (call_eh_info): Likewise.
	(push_eh_info): Likewise.
	(do_pop_exception): Likewise.
	(initialize_handler_parm): Likewise.
	(expand_end_eh_spec): Likewise.
	(alloc_eh_object): Likewise.
	(expand_throw): Likewise.
	* expr.c (extract_scalar_init): Likewise.
	* init.c (build_java_class_ref): Likewise.
	* lex.c (get_time_identifier): Likewise.
	(snarf_defarg): Likewise.
	(add_defarg_fn): Likewise.
	(is_global): Simplify.
	(do_identifier): Don't check TREE_PERMANENT.
	* method.c (emit_thunk): Don't manipulate obstacks.
	* parse.y (condition): Adjust call to cp_finish_decl.
	(primary): Likewise.
	(initdcl): Likewise.
	(initdcl0_innards): Likewise.
	(nomods_initdcl0): Likewise.
	* pt.c (push_inline_template_parms_recursive): Use
	SET_DECL_TEMPLATE_PARM_P.
	(process_template_parm): Likewise.
	(lookup_template_class): Don't manipulate obstacks.
	(instantiate_class_template): Adjust call to
	finish_static_data_member_decl.
	(tsubst_decl): Don't manipulate obstacks.
	(tsubst_expr): Likewise.
	(instantiate_template): Likewise.
	(instantiate_decl): Adjust calls to cp_finish_decl.
	* rtti.c (call_void_fn): Don't manipulate obstacks.
	(get_tinfo_var): Likewise.
	(get_tinfo_fn_unused): Likewise.
	(build_dynamic_cast_1): Likewise.
	(expand_si_desc): Likewise.
	(expand_class_desc): Likewise.
	(expand_ptr_desc): Likewise.
	(expand_attr_desc): Likewise.
	(expand_generic_desc): Likewise.
	(synthesize_tinfo_fn): Likewise.
	* search.c (expand_upcast_fixups): Likewise.
	* semantics.c (finish_asm_stmt): Likewise.
	(finish_named_return_value): Likewise.
	(begin_class_definition): Likewise.
	(finish_class_definition): Likewise.
	(finish_typeof): Likewise.
	* tree.c (build_cplus_method_type): Likewise.
	(reverse_path): Likewise.
	(copy_template_template_parm): Likewise.
	(build_expr_ptr_wrapper): Likewise.
	(push_expression_obstack): Remove.
	(push_permanent_obstack): Likewise.
	* typeck.c (mark_addressable): Likewise.

From-SVN: r30527
1999-11-14 20:29:06 +00:00
Mark Mitchell c506ca222b call.c (build_conditional_expr): Use build_target_expr_with_type.
* call.c (build_conditional_expr): Use build_target_expr_with_type.
	(convert_like): Likewise.
	(build_over_call): Likewise.
	* cp-tree.h (build_target_expr): Remove.
	(build_target_expr_with_type): New function.
	* cvt.c (build_up_reference): Use get_target_expr.
	* decl.c (build_target_expr): Move to ...
	* tree.c (build_target_expr): Here.  Make it static.
	(build_target_expr_with_type): New function.  Set DECL_CONTEXT on
	the temporary VAR_DECLs.
	(get_target_expr): Use it.

From-SVN: r30524
1999-11-14 05:04:19 +00:00
Jason Merrill 794d4a61f8 decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
* decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT.
	* decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT.
	* rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn.
	* class.c (set_rtti_entry): Use it.

From-SVN: r30523
1999-11-13 04:39:11 -05:00