Commit Graph

417 Commits

Author SHA1 Message Date
Richard Kenner 13eb1f7f0d expr.c (store_constructor): SIZE now signed.
* expr.c (store_constructor): SIZE now signed.
	For EXPR_SIZE, don't evaluate size; just needed if constant.
	* fold-const.c (fold): Fix a number of cases when folded tree is
	wrong type.
	* function.c (flush_addressof): Reenable.
	* tree.h (flush_addressof): Likewise.
	* toplev.c (independent_decode_option): Look at strings_processed.
	* config/alpha/alpha.h (MINIMUM_ATOMIC_ALIGNMENT): Cast to unsigned.

From-SVN: r32783
2000-03-28 12:01:49 -05:00
Theodore Papadopoulo 2f939d9406 builtin.c (get_pointer_alignment): Use DECL_P and TYPE_P macros.
* builtin.c (get_pointer_alignment): Use DECL_P and TYPE_P macros.
	* c-common.c (decl_attributes,check_format_info,truthvalue_conversion,
	  c_get_alias_set): Likewise.
	* c-decl.c (duplicate_decls): Likewise.
	* c-typeck.c (default_conversion,build_unary_op): Likewise.
	* calls.c (initialize_argument_information): Likewise.
	* dwarf2out.c (decl_class_context,add_abstract_origin_attribute):
	Likewise.
	* dwarfout.c (decl_class_context,output_type): Likewise.
	* expr.c (get_inner_reference): Likewise.
	* fold-const.c (simple_operand_p,fold): Likewise.
	* function.c (aggregate_value_p): Likewise.
	* stmt.c (expand_asm_operands): Likewise.
	* varasm.c (named_section): Likewise.

	* call.c (check_dtor_name,build_new_method_call): Likewise.
	* decl.c (push_class_binding,poplevel,pushtag,lookup_namespace_name,
	make_typename_type,check_initializer,cp_finish_decl,xref_tag): Likewise.
	* decl2.c (grokfield,build_expr_from_tree,build_expr_from_tree,
	decl_namespace,arg_assoc_template_arg,arg_assoc,
	validate_nonmember_using_decl,do_class_using_decl): Likewise.
	* error.c (dump_template_argument,dump_expr,cp_file_of,cp_line_of,
	args_to_string): Likewise.
	* friend.c (is_friend): Likewise.
	* lex.c (note_got_semicolon,note_list_got_semicolon,is_global): Likewise.
	* method.c (build_overload_nested_name,build_overload_value,
	build_qualified_name,build_qualified_name,hack_identifier): Likewise.
	* parse.y (typename_sub,typename_sub1): Likewise.
	* pt.c (push_inline_template_parms_recursive,check_template_shadow,
	process_partial_specialization,convert_template_argument,
	template_args_equal,add_pending_template,lookup_template_class,
	for_each_template_parm_r,maybe_fold_nontype_arg,
	tsubst,instantiate_template,type_unification_real,unify,
	instantiate_pending_templates,set_mangled_name_for_template_decl):
	Likewise.
	* repo.c (repo_get_id,repo_template_used): Likewise.
	* search.c (lookup_field_1): Likewise.
	* tree.c (walk_tree,get_type_decl,cp_tree_equal,member_p): Likewise.
	* xref.c (classname): Likewise.

From-SVN: r32698
2000-03-23 00:41:05 +00:00
Nathan Sidwell d0f062fbb3 tree.h (COMPLETE_TYPE_P): New macro.
gcc
	* tree.h (COMPLETE_TYPE_P): New macro.
	(COMPLETE_OR_VOID_TYPE_P): New macro.
	(COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro.
	* stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE.
	* c-aux-info.c (gen_type): Use them.
	* c-common.c (c_expand_expr_stmt): Likewise.
	* c-decl.c (poplevel, pushdecl, start_decl, finish_decl,
	grokdeclarator, grokparms, finish_struct, start_function,
	store_parm_decls, combine_parm_decls): Likewise.
	* c-parse.y (cast_expr): Likewise.
	* c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn,
	c_size_in_bytes, c_alignof, build_component_ref,
	build_indirect_ref, build_array_ref, convert_arguments,
	build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise.
	* calls.c (initialize_argument_information): Likewise.
	* convert.c (convert_to_integer): Likewise.
	* dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise.
	* dwarfout.c (location_or_const_value_attribute,
	output_enumeration_type_die, output_structure_type_die,
	output_union_type_die, output_type): Likewise.
	* expr.c (safe_from_p, expand_expr): Likewise.
	* function.c (assign_parms): Likewise.
	* sdbout.c (sdbout_symbol, sdbout_one_type): Likewise.
	* tree.c (build_array_type, build_function_type,
	build_method_type, build_offset_type, build_complex_type): Likewise.
	* c-parse.c, c-parse.h: Regenerated.
gcc/cp
	* typeck.c (require_complete_type, complete_type,
	complete_type_or_else, c_sizeof, c_sizeof_nowarn,
	build_array_ref, convert_arguments, pointer_diff,
	build_x_unary_op, build_unary_op, build_c_cast,
	build_modify_expr): Use COMPLETE_TYPE_P etc.
	* call.c (is_complete, convert_like_real,
	build_new_method_call): Likewise.
	* class.c (build_vbase_pointer_fields, check_bases,
	build_base_field, finish_struct_1, pushclass): Likewise.
	* cvt.c (cp_convert_to_pointer, convert_to_void): Likewise.
	* decl.c (maybe_process_template_type_declaration, pushtag,
	pushdecl, redeclaration_error_message, start_decl, start_decl_1,
	layout_var_decl, check_initializer, cp_finish_decl,
	grokdeclarator, require_complete_types_for_parms,
	grok_op_properties, xref_tag, xref_basetypes,
	check_function_type): Likewise.
	* decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise.
	* friend.c (do_friend): Likewise.
	* init.c (build_offset_ref): Likewise.
	* parse.y (structsp): Likewise.
	* pt.c (maybe_process_partial_specialization,
	tsubst_friend_function, instantiate_class_template, tsubst,
	do_type_instantiation, instantiate_pending_templates): Likewise.
	* repo.c (repo_get_id): Likewise.
	* rtti.c (build_typeid, get_typeid, build_dynamic_cast_1,
	synthesize_tinfo_var, emit_support_tinfos): Likewise.
	* search.c (lookup_fnfields_1, lookup_conversions): Likewise.
	* semantics.c (begin_class_definition): Likewise.
	* tree.c (build_cplus_method_type): Likewise.
	* typeck2.c (digest_init, build_functional_cast,
	add_exception_specifier): Likewise.
	* parse.h, parse.c: Regenerated.

From-SVN: r32671
2000-03-21 18:10:48 +00:00
Nathan Sidwell 5add10fd81 * decl2.c (grokfield): Bail out if type is error_mark_node.
From-SVN: r32582
2000-03-16 10:13:28 +00:00
Mark Mitchell 74b846e0de cp-tree.h (scope_kind): New type.
* cp-tree.h (scope_kind): New type.
	(tmpl_spec_kind): Likewise.
	(declare_pseudo_global_level): Remove.
	(pseudo_global_level_p): Rename to template_parm_scope_p.
	(pushlevel): Remove declaration.
	(begin_scope): New function.
	(finish_scope): Likewise.
	(current_tmpl_spec_kind): Likewise.
	* decl.c (struct binding_level): Shorten parm_flag to 2 bits.
	Shorten keep to 2 bits.  Rename pseudo_global to template_parms_p.
	Add template_spec_p.
	(toplevel_bindings_p): Adjust.
	(declare_pseudo_global_level): Remove.
	(pseudo_global_level_p): Rename to template_parm_scope_p.
	(current_tmpl_spec_kind): New function.
	(begin_scope): Likewise.
	(finish_scope): Likewise.
	(maybe_push_to_top_level): Adjust.
	(maybe_process_template_type_declaration): Likewise.
	(pushtag): Likewise.
	(pushdecl_nonclass_level): Likewise.
	(lookup_tag): Likewise.
	(grokfndecl): Handle member template specializations.  Share
	constructor and non-constructor code.
	* decl2.c (check_classfn): Handle member template specializations.
	* pt.c (begin_template_parm_list): Use begin_scope.
	(begin_specialization): Likewise.
	(end_specialization): Likewise.
	(check_explicit_specialization): Use current_tmpl_spec_kind.
	Handle member template specializations.
	(end_template_decl): Use finish_scope.  Remove call to
	get_pending_sizes.
	(push_template_decl_real): Remove bogus error message.
	(tsubst_decl): Fix typo in code contained in comment.
	(instantiate_template): Handle member template specializations.
	(most_general_template): Likewise.

From-SVN: r32494
2000-03-12 18:47:52 +00:00
Jason Merrill 1660cb3ac4 lang-options.h, decl2.c: Add -fno-enforce-eh-specs.
* lang-options.h, decl2.c: Add -fno-enforce-eh-specs.
        * cp-tree.h: Declare flag_enforce_eh_specs.
        * decl.c (store_parm_decls, finish_function): Check it.

        C library functions don't throw.
        * Makefile.in (cfns.h): New target.
        (except.o): Depend on it.
        * Make-lang.in (cc1plus): Depend on cfns.gperf.
        * cfns.gperf: New file.
        * cfns.h: Generated.
        * except.c: Include it.
        (nothrow_libfn_p): New fn.
        * decl.c (grokfndecl): Use it.
        * cp-tree.h: Declare it.

From-SVN: r32469
2000-03-10 06:56:00 -05:00
Kaveh R. Ghazi 3cce094dd9 rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
	(emit_line_note_after, emit_line_note, emit_line_note_force,
	emit_note, decode_asm_operands): Constify.

	* cse.c (canon_hash): Likewise.

	* dbxout.c (dbxout_block): Likewise.

	* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
	v_warning_for_asm): Likewise.

	* dwarfout.c (function_start_label): Likewise.

	* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
	emit_line_note_force): Likewise.

	* final.c (last_filename, asm_insn_count, final_scan_insn,
	output_source_line): Likewise.

	* function.h (struct emit_status): Likewise.

	* gcse.c (hash_expr_1): Likewise.

	* genattr.c (gen_attr, main): Likewise.

	* genattrtab.c (struct function_unit, current_alternative_string,
	write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
	attr_numeral, check_attr_test, check_attr_value,
	convert_set_attr_alternative, convert_set_attr,
	compute_alternative_mask, simplify_by_exploding, gen_attr,
	gen_unit): Likewise.

	* genflags.c (gen_insn): Likewise.

	* gengenrtl.c (type_from_format): Likewise.

	* genopinit.c (gen_insn): Likewise.

	* genoutput.c (n_occurrences, process_template, process_template):
	Likewise.

	* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
	Likewise.

	* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
	Likewise.

	* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
	ggc_set_mark, ggc_get_size): Likewise.

	* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.

	* optabs.c (init_one_libfunc): Likewise.

	* output.h (assemble_start_function): Likewise.

	* recog.c (decode_asm_operands): Likewise.

	* toplev.c (rest_of_compilation): Likewise.

	* tree.h (emit_line_note_after, emit_line_note,
	emit_line_note_force): Likewise.

	* varasm.c (asm_output_bss, asm_output_aligned_bss,
	asm_emit_uninitialised, assemble_start_function,
	assemble_variable, const_hash, compare_constant_1,
	find_pool_constant, mark_constant_pool, assemble_alias): Likewise.

	* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.

	* alpha/alpha.md (call_vms, call_value_vms): Likewise.

	* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.

	* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.

	* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
	arm_dllimport_name_p): Likewise.

	* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
	Likewise.

	* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.

	* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
	arm_mark_dllexport, arm_mark_dllimport,
	arm_pe_encode_section_info): Likewise.

	* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
	ASM_FINISH_DECLARE_OBJECT): Likewise.

	* arm/thumb.c (thumb_function_prologue): Likewise.

	* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.

	* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.

	* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
	ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/i386-protos.h (asm_output_function_prefix): Likewise.

	* i386/i386.c (asm_output_function_prefix): Likewise.

	* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
	ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
	ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.

	* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.

	* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.

	* m32r/m32r.c (m32r_encode_section_info): Likewise.

	* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mcore/mcore.c (mcore_encode_section_info): Likewise.

	* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.

	* mips/mips.md (movdi, movsi): Likewise.

	* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
	ASM_OUTPUT_ASCII): Likewise.

	* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
	output_mi_thunk, output_toc): Likewise.

	* rs6000/rs6000.md (movsi): Likewise.

	* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.

	* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.

	* v850/v850.c (print_operand, print_operand_address,
	v850_encode_data_area): Likewise.

ch:
	* grant.c (globalize_decl): Constify a char*.

cp:
	* decl2.c (finish_objects): Constify a char*.

	* method.c (emit_thunk): Likewise.

From-SVN: r32388
2000-03-07 20:39:10 +00:00
Jason Merrill 6db201439a decl2.c (key_method): Break out from...
* decl2.c (key_method): Break out from...
        (import_export_vtable, import_export_class): ...here.

        * decl.c (finish_function): Don't mess with flag_keep_inline_functions.
        * decl2.c (finish_vtable_vardecl): Don't check decl_function_context.

        * search.c (note_debug_info_needed, dfs_debug_mark,
        dfs_debug_unmarkedp): Uncomment.  Adjust for new scheme.
        * decl2.c (finish_vtable_vardecl): Call note_debug_info_needed.

From-SVN: r32319
2000-03-03 19:45:24 -05:00
Mark Mitchell 834c6dff7b * tree.h (TYPE_ALIGN_UNIT): New macro.
From-SVN: r32302
2000-03-03 02:27:15 +00:00
Mark Mitchell 27d26ee7a7 cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
* cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF.
	(import_export_class): Remove declaration.
	* decl2.c (import_export_class): Make it static.
	* dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR,
	PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR,
	EXPR_WITH_FILE_LOCATION.
	* lex.c (check_newline): Tweak filename/lineno setting.
	* semantics.c (begin_while_stmt): Fix typo in comment.

From-SVN: r32208
2000-02-27 02:46:57 +00:00
Jeff Law d6a8bdff52 Fix copyrights
From-SVN: r32185
2000-02-26 13:16:12 -07:00
Martin v. Löwis cab1f18012 Refer to the standard as an ISO document, not an ANSI one.
* decl.c (grokdeclarator): Change ANSI to ISO.
	* lex.c (consume_string, readescape, do_identifier): Likewise.
	(parse_float, real_yylex): Likewise.
	* parse.y (paren_expr_or_null, paren_cond_or_null): Likewise.
	(unary_expr, new_initializer, cast_expr, primary, primary_no_id,
	new_type_id, maybe_label_decls, simple_stmt,
	for.init.statement): Likewise.
	* pt.c (do_decl_instantiation, do_type_instantiation): Likewise.
	* semantics.c (finish_named_return_value): Likewise.
	* parse.c: Regenerate.

From-SVN: r32100
2000-02-22 07:25:31 +00:00
Gabriel Dos Reis cb9a3ff816 call.c (build_object_call): Compress consecutive calls to cp_error.
2000-02-21  Gabriel Dos Reis  <gdr@codesourcery.com>

        * call.c (build_object_call): Compress consecutive calls to
        cp_error.
        (build_conditional_expr): Say 'ISO C++' not 'ANSI C++'.
        (build_op_delete_call): Adjust message formatting.

        * class.c (check_bases): Compress consecutive calls to
        cp_pedwarn.
        (finish_struct_anon): Say 'ISO C++'.

        * decl.c (start_decl): Same here.
        (grok_reference_init): Likewise.
        (grokfndecl): Correct message formatting.
        (grokfndecl): Improve diagnostic.
        (check_static_variable_definition): Likewise. Say 'ISO C++'
        (compute_array_index_type): Say 'ISO C++'
        (create_array_type_for_decl): Compress consecutive calls to
        cp_error.
        (grokdeclarator): Say 'ISO C++'
        (grok_op_properties): Likewise.

        * decl2.c (delete_sanity): Clairify diagnostic.
        (check_member_template): Same here.
        (grok_function_init): Use consistent terminology.

        * expr.c (do_case): Say 'ISO C++'

        * friend.c (do_friend): Compress consecutive calls to warning.

From-SVN: r32090
2000-02-21 19:51:44 +00:00
Mark Mitchell 930b1f40d0 class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT.
* class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT.
	* decl2.c (grokclassfn): Likewise.

From-SVN: r32044
2000-02-18 06:00:36 +00:00
Mark Mitchell 277576eefc invoke.texi (-fmessage-length=n): Document.
* invoke.texi (-fmessage-length=n): Document.

	* decl2.c (lang_decode_option): Don't set default message length
	here.
	* lex.c (lang_init_options): Set it here.

From-SVN: r32040
2000-02-17 20:38:26 +00:00
Mark Mitchell 4f1c5b7dbf Make DECL_CONTEXT mean the class in which a member function was declared, even for a virtual function.
Make DECL_CONTEXT mean the class in which a member function was
	declared, even for a virtual function.
	* cp-tree.h (DECL_CLASS_CONTEXT): Adjust.
	(DECL_FRIEND_CONTEXT): New macro.
	(DECL_REAL_CONTEXT): Remove.
	(SET_DECL_FRIEND_CONTEXT): Likewise.
	(DECL_VIRTUAL_CONTEXT): Adjust.
	(DECL_CLASS_SCOPE_P): Use TYPE_P.
	(add_friends): Remove.
	(hack_decl_function_context): Likewise.
	* call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with
	CP_DECL_CONTEXT.
	(build_over_call): Fix indentation.  Use DECL_CONTEXT
	instead of DECL_CLASS_CONTEXT.
	* class.c (dfs_build_vcall_offset_vtbl_entries): Likewise.
	(add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
	(strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT.
	(build_base_field): Likewise.
	(finish_struct_1): Likewise.
	(build_self_reference): Likewise.
	* decl.c (push_class_binding): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(pushtag): Use decl_function_context, not
	hack_decl_function_context.
	(decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	(duplicate_decls): Use DECL_VIRTUAL_CONTEXT.
	(pushdecl): Remove bogus code.
	(start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT.
	(cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	(grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	Use decl_function_context, nothack_decl_function_context.
	(grokvardecl): Don't set DECL_CLASS_CONTEXT.
	(grokdeclarator): Likewise.  Use decl_function_context, not
	hack_decl_function_context.
	(copy_args_p): Document.  Don't use DECL_CLASS_CONTEXT.
	(start_function): Use DECL_FRIEND_CONTEXT, not
	DECL_CLASS_CONTEXT.  Use decl_function_context, not
	hack_decl_function_context.
	(finish_function): Use decl_function_context, not
	hack_decl_function_context.
	(maybe_retrofit_in_chrg): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT.
	(finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT.
	(grokfield): Likewise.
	(finish_builtin_type): Likewise.
	(finish_vtable_vardec): Use decl_function_context, not
	hack_decl_function_context.
	(import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(start_static_initialization_or_destruction): Likewise.
	(finish_static_initialization_or_destruction): Likewise.
	(mark_used): Adjust logic for deciding when to synthesize methods.
	* dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	* error.c (dump_function_decl): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* friend.c (is_friend): Likewise.
	(add_friends): Remove.
	(do_friend): Use SET_DECL_FRIEND_CONTEXT.
	* lex.c (begin_definition_of_inclass_inline): Use
	decl_function_context, not hack_decl_function_context.
	(process_next_inline): Likewise.
	(do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT.
	* method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not
	DECL_CLASSS_CONTEXT.
	(hack_identifier): Likewise.
	(synthesize_method):  Use decl_function_context, not
	hack_decl_function_context.
	* pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(is_member_template): Use decl_function_context, not
	hack_decl_function_context.  Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(build_template_decl): Set DECL_VIRTUAL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	(check_default_tmpl_args): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(push_template_decl_real): Likewise.
	(instantiate_class_template): Don't call add_friends.
	(tsubst_default_argument): Use DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT.
	Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(set_meangled_name_for_template_decl): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* repo.c (repo_inline_used): Likewise.
	* search.c (current_scope): Adjust for new _CONTEXT macros.
	(context_for_name_lookup): Use CP_DECL_CONTEXT, not
	DECL_REAL_CONTEXT.
	(friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT.
	(lookup_fnfields_here):Likewise.
	(check_final_overrider): Likewise.
	(init_vbase_pointers): Likewise.
	(virtual_context): Likewise.
	* semantics.c (finish_member_declaration): Just set DECL_CONTEXT.
	(expand_body): Use decl_function_context, not
	hack_decl_function_context.
	* tree.c (hack_decl_function_context): Remove.
	* typeck.c (build_x_function_call): Use DECL_CONTEXT, not
	DECL_CLASS_CONTEXT.
	* typeck2.c (error_not_base_type): Likewise.

From-SVN: r32018
2000-02-16 23:54:23 +00:00
Gabriel Dos Reis 7e05b7aec4 decl2.c (lang_decode_option): Enable automatic line wrapping.
2000-01-16  Gabriel Dos Reis  <gdr@codesourcery.com>

        * decl2.c (lang_decode_option): Enable automatic line wrapping.

From-SVN: r31999
2000-02-16 01:38:11 +00:00
Nathan Sidwell 7267d6924e Compiler side new abi rtti (not enabled).
* cp-tree.h (new_abi_rtti_p): New macro.
	(emit_support_tinfos): Prototype new function.
	(tinfo_decl_p): Likewise.
	(emit_tinfo_decl): Likwise.
	* rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL): New accessor
	macros.
	(doing_runtime): New local static.
	(init_rtti_processing): Add new-abi initializer.
	(get_tinfo_decl): Add new-abi logic.
	(tinfo_from_decl): Likewise.
	(build_dynamic_cast_1): Likewise.
	(qualifier_flags): New static function.
	(tinfo_base_init): Likewise.
	(generic_initializer): Likewise.
	(ptr_ref_initializer): Likewise.
	(ptmd_initializer): Likewise.
	(class_hint_flags): Likewise.
	(class_initializer): Likewise.
	(synthesize_tinfo_var): Likewise.
	(create_real_tinfo_var): Likewise.
	(create_pseudo_type_info): Likewise.
	(get_vmi_pseudo_type_info): Likewise.
	(create_tinfo_types): Likewise.
	(emit_support_tinfos): New global function.
	(tinfo_decl_p): New global predicate.
	(emit_tinfo_decl): New global function.
	* class.c (set_rtti_entry): Generalize for old and new rtti.
	(build_vtbl_initializer): Likewise.
	* decl2.c (finish_file): Likewise.

From-SVN: r31668
2000-01-28 13:30:13 +00:00
Kaveh R. Ghazi 158991b7e5 call.c: PROTO -> PARAMS.
* call.c: PROTO -> PARAMS.
        * class.c: Likewise.
        * cp-tree.h: Likewise.
        * cvt.c: Likewise.
        * decl.c: Likewise.
        * decl.h: Likewise.
        * decl2.c: Likewise.
        * dump.c: Likewise.
        * errfn.c: Likewise.
        * error.c: Likewise.
        * except.c: Likewise.
        * expr.c: Likewise.
        * init.c: Likewise.
        * input.c: Likewise.
        * lex.c: Likewise.
        * lex.h: Likewise.
        * method.c: Likewise.
        * optimize.c: Likewise.
        * parse.y: Likewise.
        * pt.c: Likewise.
        * repo.c: Likewise.
        * rtti.c: Likewise.
        * search.c: Likewise.
        * semantics.c: Likewise.
        * spew.c: Likewise.
        * tree.c: Likewise.
        * typeck.c: Likewise.
        * typeck2.c: Likewise.
        * xref.c: Likewise.

From-SVN: r31632
2000-01-26 20:51:37 +00:00
Jason Merrill 7610f2ce1b pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a template.
* pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a
        template.

        * decl2.c (mark_used): Do instantiate inlines that have been
        explicitly instantiated.

From-SVN: r31601
2000-01-25 00:53:12 -05:00
Nathan Sidwell 1aa4ccd428 cp-tree.h (get_vtable_decl): Prototype new function.
* cp-tree.h (get_vtable_decl): Prototype new function.
	* class.c (get_vtable_decl): New function. Broken out from ...
	(build_vtable): ... here. Use it.
	* decl2.c (finish_vtable_vardecl): Ignore dummy vtables created
	by get_vtable_decl.

From-SVN: r31583
2000-01-24 10:59:02 +00:00
Mark Mitchell bf419747e9 cp-tree.h (register_dtor_fn): New function.
* cp-tree.h (register_dtor_fn): New function.
	* decl.c (destroy_local_static): Rename to ...
	(register_dtor_fn): ... this.  Give it external linkage.
	(expand_static_init): Use it.
	* decl2.c (do_static_initialization): Likewise, if using
	__cxa_atexit.
	(do_static_destruction): Check that __cxa_atexit is not in use.
	(finish_file): Don't call do_static_destruction if using
	__cxa_atexit.

	* typeck.c (convert_arguments): Restore two-message error
	reporting.

From-SVN: r31570
2000-01-23 18:40:20 +00:00
Gabriel Dos Reis 7e4d789838 decl2.c (lang_decode_option): Set default line-wrap length to 72.
2000-01-19  Gabriel Dos Reis  <gdr@codesourcery>

        * decl2.c (lang_decode_option): Set default line-wrap length to 72.

        * typeck.c (composite_pointer_type, common_type,
        comp_target_parms, c_sizeof, expr_sizeof, build_array_ref,
        build_function_call_real, convert_arguments,
        build_binary_op_nodefault, pointer_int_sum, pointer_diff,
        build_unary_op, mark_addressable, build_compound_expr,
        build_static_cast, build_reinterpret_cast, build_const_cast,
        build_c_cast, build_modify_expr, get_delta_difference,
        build_ptrmemfunc, check_return_expr): Replace 'ANSI C++' with
        'ISO C++'.  Fusion consecutive calls to diagnotic message routines
        into a single one.
        * typeck2.c (readonly_error, abstract_virtuals_error,
        process_init_constructor, check_for_new_type): Likewise.

From-SVN: r31502
2000-01-19 11:34:03 +00:00
Nathan Sidwell e5f614d777 cp-tree.h (get_tinfo_fn_dynamic): Remove prototype.
* cp-tree.h (get_tinfo_fn_dynamic): Remove prototype.
	(build_x_typeid): Likewise.
	(get_tinfo_fn): Likewise.
	(get_tinfo_fn_unused): Rename to ...
	(get_tinfo_decl): ... here.
	* rtti.c (build_headof): Replace logic error with assertion.
	(get_tinfo_fn_dynamic): Rename to ...
	(get_tinfo_decl_dynamic): ... here. Make static. Use
	complete_type_or_else.
	(build_x_typeid): Move into ...
	(build_typeid): ... here. Adjust call to
	get_tinfo_decl_dynamic. Use tinfo_from_decl. Simplify
	throw_bad_typeid expression.
	(get_tinfo_fn_unused): Rename to ...
	(get_tinfo_decl): ... here. Adjust comment.
	(get_tinfo_fn): Delete.
	(tinfo_from_decl): New static function.
	(get_typeid_1): Call get_tinfo_decl and tinfo_from_decl.
	(get_typeid): Use complete_type_or_else.
	(build_dynamic_cast_1): Adjust calls to
	get_tinfo_decl_dynamic. Simplify throw_bad_cast expression.
	* parse.y (primary): Adjust call to build_typeid.
	* except.c (build_eh_type_type_ref): Adjust call to
	get_tinfo_decl. Mark as used.
	* class.c (set_rtti_entry): Adjust call to get_tinfo_decl.
	* decl2.c (build_expr_from_tree): Adjust call to build_typeid.
	* parse.c: Regenerated.

From-SVN: r31485
2000-01-18 10:23:31 +00:00
Mark Mitchell 051e6fd745 cp-tree.h (scratchalloc): Remove.
* cp-tree.h (scratchalloc): Remove.
	(build_scratch_list): Likewise.
	* call.c (convert_class_to_reference): Replace build_scratch_list
	and build_expr_list with build_tree_list.
	(add_candidate): Replace scratchalloc with expralloc.  Note memory
	leak.
	(build_user_type_conversion_1):  Replace build_scratch_list
	and build_expr_list with build_tree_list.
	(build_new_op): Likewise.
	(build_op_delete_call): Likewise.
	(convert_like): Likewise.
	* cvt.c (ocp_convert): Likewise.
	* decl.c (start_decl): Likewise.
	(start_function): Likewise.
	(finish_destructor_body): Likewise.
	(maybe_build_cleanup_1): Likewise.
	* decl2.c (reparse_decl_as_expr): Likewise.
	* init.c (perform_member_init): Likewise.
	(expand_cleanup_for_base): Likewise.
	(build_builtin_delete_call): Likewise.
	(build_new_1): Likewise.
	(build_delete): Likewise.
	* method.c (do_build_assign_ref): Likewise.
	* parse.y (already_scoped_stmt): Likewise.
	(nontrivial_exprlist): Likewise.
	(net_initializer): Likewise.
	(initlist): Likewise.
	* parse.c: Regenerated.
	* rtti.c (build_x_typeid): Likewise.
	(build_dynamic_cast_1): Likewise.
	* typeck.c (build_x_compound_expr): Likewise.
	(build_static_cast): Likewise.
	(build_modify_expr): Likewise.

	* cp-tree.h (DECL_VINDEX): Add documentation.
	* class.c (build_vtable_entry): Likewise.
	(start_vtable): Add comment.
	(add_virtual_function): Replace pending_hard_virtuals with
	overridden_virtuals and pending_virtuals with new_virtuals.
	Replace redundant assignments with assertions.
	(check_for_override): Add comment.
	(check_bases_and_members): Replace pending_hard_virtuals with
	overridden_virtuals and pending_virtuals with new_virtuals.
	(create_vtbl_ptr): Likewise.
	(layout_class_type): Likewise.
	(finish_struct_1): Likewise.  Add comments.

From-SVN: r31473
2000-01-17 20:18:43 +00:00
Mark Mitchell bbd15aac6f cp-tree.h (flag_new_abi): Move.
* cp-tree.h (flag_new_abi): Move.
	(flag_use_cxa_atexit): Likewise.
	(flag_honor_std): Likewise.
	(flag_rtti): Likewise.
	(vbase_offsets_in_vtable_p): Define.
	(vptrs_present_everywhere_p): Likewise.
	(TYPE_CONTAINS_VPTR_P): Likewise.
	(dfs_walk_real): Declare.
	* class.c (build_vbase_pointer_fields): Check
	vbase_offsets_in_vtable_p.
	(dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in
	BINFO_VPTR_FIELD.
	(build_vbase_offset_vtbl_entries): Simplify.
	(build_vbase_offset_vtbl_entries): Adjust.
	(build_vbase_pointer): Add ability to look up vbase offsets in
	vtable.
	(start_vtable): New function.
	(add_virtual_function): Use it.
	(determine_primary_base): Use TYPE_CONTAINS_VPTR_P.
	(num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p.
	(build_vtbl_initializer): Take the type of the complete object as
	input.  Use it to correctly calculate vbase offsets.
	(dfs_finish_vtbls): Pass the complete type to
	build_vtbl_initializer.
	(check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
	(create_vtable_ptr): Create a vtable even if there are no
	new virtual functions, under the new ABI.
	(finish_struct_1): Likewise.
	(get_vfield_name): Use TYPE_CONTAINS_VPTR_P.
	* decl.c (exapnd_static_init): Remove call to
	preserve_initializer.
	* decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in
	vtables.
	* init.c (initialize_vtbl_ptrs): Initialize them in pre-order.
	(expand_virtual_init): Use vbase_offsets_in_vtable_p.
	(construct_virtual_bases): Don't initialize virtual base pointers
	under the new ABI.
	(build_aggr_init): Clean up comment.
	(expand_aggr_init_1): Likewise.
	* rtti.c (expand_class_desc): Store the virtual function table
	index where the vbase offset lives in the offset field.
	* search.c (dfs_walk_real): Make it global.
	(dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P.
	* tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD.

	* tinfo.h (USItype): Make it signed under the new ABI.
	* tinfo.cc (convert_to_base): New function.  Encapsulate base
	conversion logic here.
	(__class_type_info::do_upcast): Use it.
	(__class_type_info::do_dyncast): Likewise.
	(__class_type_info::do_find_public_subobj): Likewise.

From-SVN: r31452
2000-01-17 04:08:01 +00:00
Mark Mitchell 84602ee016 decl2.c (lang_decode_option): Don't couple flag_honor_std to flag_new_abi.
* decl2.c (lang_decode_option): Don't couple flag_honor_std to
	flag_new_abi.

From-SVN: r31440
2000-01-16 17:03:49 +00:00
Gabriel Dos Reis eff3ac4619 Commit the change corresponding to the ChangeLog entry:
2000-01-12  Gabriel Dos Reis  <gdr@codesourcery.com>

From-SVN: r31412
2000-01-14 11:51:14 +00:00
Jason Merrill 7c913d336d decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT.
* decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT.
        * pt.c (instantiate_decl): Defer comdat templates that might not be
        needed.

        * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT.
        * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT.
        (finish_file): Likewise.

From-SVN: r31269
2000-01-07 02:06:59 -05:00
Nathan Sidwell f0b9bc6c88 decl2.c (lookup_arg_dependent): Deal with FNS not being a FUNCTION_DECL.
* decl2.c (lookup_arg_dependent): Deal with FNS not being a
	FUNCTION_DECL.

From-SVN: r31238
2000-01-05 11:45:33 +00:00
Mark Mitchell fee7654ec6 cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals.
* cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals.
	(CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ...
	(CLASSTYPE_PURE_VIRTUALS): ... this.
	(lang_decl_flags): Replace abstract_virtual with pure_virtual.
	(DECL_ABSTRACT_VIRTUAL_P): Rename to ...
	(DECL_PURE_VIRTUAL_P): ... this.
	(get_abstract_virtuals): Rename to ...
	(get_pure_virtuals): ... this.
	* call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with
	DECL_ABSTRACT_VIRTUAL_P.  Replace CLASSTYPE_ABSTRACT_VIRTUALS with
	CLASSTYPE_PURE_VIRTUALS.
	* class.c (build_vtable_entry): Likewise.
	(finish_struct_bits): Likewise.  Call get_pure_virtuals, not
	get_abstract_virtuals.
	(build_vtbl_initializer): Likewise.
	(override_one_vtable): Likewise.
	(check_methods): Likewise.
	* decl.c (duplicate_decls): Likewise.
	(redeclaration_error_message): Likewise.
	(lang_mark_tree): Likewise.
	* decl2.c (grok_function_init): Likewise.
	(import_export_vtable): Likewise.
	(import_expor_class): Likewise.
	* typeck2.c (abstract_virtuals_error): Likewise.
	* xref.c (GNU_xref_member): Likewise.
	* search.c (get_abstract_virtuals): Rename to get_pure_virtuals.

From-SVN: r31114
1999-12-29 06:39:42 +00:00
Mark Mitchell 4c6b7393dc cp-tree.h (TYPE_VIRTUAL_P): Rename to ...
* cp-tree.h (TYPE_VIRTUAL_P): Rename to ...
	(TYPE_POLYMORPHIC_P): ... this.
	(TYPE_USES_COMPLEX_INHERITANCE): Rename to ...
	(TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this.
	(TREE_CALLS_NEW): Remove.
	(TREE_MANGLED): Likewise.
	* call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P,
	and TYPE_POLYMORPHIC_P.
	* class.c (check_bases): Likewise.
	(finish_base_struct): Likewise.
	(finish_struct_bits): Likewise.
	(check_for_override): Likewise.
	(finish_struct_1): Likewise.
	(get_vfield_name): Likewise.
	* decl.c (xref_basetypes): Likewise.
	* decl2.c (import_export_class): Likewise.
	(import_export_decl): Likewise.
	* error.c (dump_function_decl): Likewise.
	* pt.c (instantiate_class_template): Likewise.
	* repo.c (repo_inline_used): Likewise.
	* rtti.c (build_headof): Likewise.
	(get_tinfo_fn_dynamic): Likewise.
	(build_x_typeid): Likewise.
	(get_tinfo_var): Likewise.
	(build_dynamic_cast_1): Likewise.
	(synthesize_tinfo_fn): Likewise.
	* search.c (lookup_field_1): Likewise.
	(dfs_debug_mark): Likewise.
	(maybe_suppress_debug_info): Likewise.
	* typeck.c (build_component_ref): Likewise.
	(build_component_addr): Likewise.
	* typeck2.c (process_init_constructor): Likewise.

From-SVN: r31041
1999-12-21 00:19:01 +00:00
Mark Mitchell db4283a074 cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE.
* cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE.
	(dso_handle_node): New macro.
	(flag_use_cxa_atexit): New variable.
	(declare_global_var): New function.
	(start_anon_func): Remove declaration.
	(end_anon_func): Likewise.
	* decl.c (get_atexit_node): New function, split out from
	destroy_local_static.  Handle flag_use_cxa_atexit.
	(get_dso_handle_node): Likewise.
	(start_cleanup_fn): Renamed from start_anon_func.  Moved here from
	except.c.  Handle flag_use_cxa_atexit.
	(end_cleanup_fn): Renamed from end_anon_func.  Moved here from
	except.c.
	(declare_global_var): New variable.
	(destroy_local_static): Handle flag_use_cxa_atexit.
	* decl2.c (flag_use_cxa_atexit): New variable.
	(lang_f_options): Likewise.
	* except.c (start_anon_func): Remove.
	(end_anon_func): Liekwise.
	* lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit.
	* rtti.c (get_tinfo_var): Use declare_global_var.

From-SVN: r30990
1999-12-17 07:40:08 +00:00
Mark Mitchell 58010b57a6 class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS out of the class...
* class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS
	out of the class, rather than taking them as parameters.
	(build_vbase_pointer_fields): Move here from tree.c.
	(build_vtbl_or_vbase_field): New function.
	(check_methods): Likewise.
	(remove_zero_width_bitfields): Likewise.
	(add_virtual_function): Use tree_cons instead of temp_tree_cons.
	(delete_duplicate_fields_1): Tidy.  Don't delete duplicate
	USING_DECLs here.
	(finish_struct_methods): Handle the case where there are no
	methods here.
	(get_basefndecls): Use tree_cons instead of temp_tree_cons.
	(check_field_decls): Call delete_duplicate_fields here.
	(finish_struct_1): Tidy.  Use check_methods and
	remove_zero_width_bitfields.
	* cp-tree.h (build_vbase_pointer_fields): Remove.
	* decl.c (grokdeclarator): Use tree_cons instead of
	temp_tree_cons.
	* decl2.c (qualified_lookup_using_namespace): Use tree_cons
	instead of temp_tree_cons.
	* lex.c (cons_up_default_function): Remove dead code.
	* method.c (fixup_pending_inline): New function, split out from	...
	(do_inline_function_hair): ... here.
	* tree.c (build_vbase_pointer_fields): Remove.

From-SVN: r30966
1999-12-16 03:10:12 +00: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 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
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
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
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
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
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
Martin v. Löwis 7c355bca10 cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
* cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro.
	(DECL_TEMPLATE_INFO): Use it.
	* decl.c (warn_extern_redeclared_static): Do nothing for
	TEMPLATE_DECLs.
	* decl2.c (mark_used): Explicitly check for function or variable.
	* semantics.c (finish_unary_op_expr): Check whether result is also
	an INTEGER_CST.

From-SVN: r30426
1999-11-05 23:11:58 +00:00
Scott Snyder f5733617e3 decl2.c (build_expr_from_tree): Handle REALPART_EXPR and IMAGPART_EXPR.
1999-11-02  Scott Snyder  <snyder@fnal.gov>

        * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and
        IMAGPART_EXPR.
	* pt.c (tsubst_copy): Likewise.

From-SVN: r30366
1999-11-03 06:52:46 +00:00
Jason Merrill b78121f657 decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too.
* decl2.c (maybe_make_one_only): Always make things comdat on
	ELF targets, too.

From-SVN: r30341
1999-11-02 02:33:05 -05:00
Mark Mitchell 13ef1ec581 decl2.c (start_static_storage_duration_function): Push the function declaration so it ends up in namespace scope.
* decl2.c (start_static_storage_duration_function): Push the
	function declaration so it ends up in namespace scope.

From-SVN: r29838
1999-10-06 06:18:18 +00:00
Nathan Sidwell ce7695e001 decl2.c (grok_alignof): Don't decay lvalues.
* decl2.c (grok_alignof): Don't decay lvalues.

	* init.c (build_new): Remove unused variable.

From-SVN: r29805
1999-10-04 15:13:26 +00:00