1. 07 Apr, 2003 1 commit
    • tree.c (tree_size): For all 'c' and 'x' nodes... · d78e771d
              * tree.c (tree_size): For all 'c' and 'x' nodes, look directly
              at the sizes of the relevant structures, rather than relying
              on TREE_CODE_LENGTH.  Call lang_hooks.tree_size to get the
              sizes of any such we don't know about.  Use
              lang_hooks.identifier_size for IDENTIFIER_NODE.
      
              (initializer_zerop): Use CONSTRUCTOR_ELTS.
              * tree.def: Update commentary.  Make fourth element of
              the definition for all 'c' and 'x' nodes zero.
      
              * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE.
              * langhooks-def.h: Update to match.
              * langhooks.c: New default, lhd_tree_size.
      
              * c-common.def (SRCLOC): Kill.
              * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]):
              Remove entirely - was already #if-ed out.
      
      ada:
              * ada-tree.def: Make fourth element for GNAT_LOOP_ID zero.
              * misc.c (gnat_tree_size): New function.
              (LANG_HOOKS_TREE_SIZE): Override.
      cp:
              * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero.
              * cp-lang.c (cp_tree_size): New function.
              (LANG_HOOKS_TREE_SIZE): Override.
      
              * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct
              tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill.
              (union lang_tree_node): Remove common and srcloc members.
              (build_srcloc_here): Don't prototype.
              * decl.c (cp_tree_node_structure): Kill SRCLOC case.
              * pt.c (pending_templates): Correct comment.
              * tree.c (build_srcloc, build_srcloc_here): Kill.
      
      From-SVN: r65323
      Zack Weinberg committed
  2. 15 Mar, 2003 1 commit
    • Compile-time improvement: 2/n. · af6fd53f
      	* cp-tree.h (struct cxx_binding): New datatype;
      	(struct lang_identifier): Use it.
      	(LOCAL_BINDING_P): Adjust definition.
      	(INHERITED_VALUE_BINDING_P): Likewise.
      	(BINDING_SCOPE): Likewise.
      	(BINDING_HAS_LEVEL_P): Likewise.
      	(BINDING_VALUE): Likewise.
      	(BINDING_TYPE): Likewise.
      	(IDENTIFIER_VALUE): Likewise.
      	(struct tree_binding): Remove.
      	(TS_CP_BINDING): Likewise.
      	((union lang_tree_node): Remove field "binding".
      	(cxx_binding_clear): New macro.
      	(binding_for_name): Adjust return type.
      	(qualified_lookup_using_namespace): Adjust prototype.
      	(lookup_using_namespace): Adjust prototype.
      	(cxx_scope_find_binding_for_name): Declare.
      	* cp-tree.def: Remove CPLUS_BINDING definition.
      	* parse.y (parse_scoped_id): Don't type-abuse of 'id'.  Allocate
      	temporary cxx_binding on stack.  Simplify.
      	* decl.c (push_binding): Adjust local variable type.
      	(add_binding): Likewise.
      	(push_class_binding): Likewise.
      	(pop_binding): Likewise.
      	(poplevel): Likewise.
      	(poplevel_class): Likewise.
      	(free_bindings):  Adjust type.
      	(find_binding): Adjust return type, add a third parameter. Remove
      	non-useful assertion now that we use static typing.
      	(cxx_scope_find_binding_for_name): New function.
      	(binding_for_name): Use it.  Adjust local variable type. Simplify.
      	(namespace_binding):  Simplify.
      	(set_namespace_binding): Likewise.
      	(set_identifier_type_value_with_scope): Adjust local variable type.
      	(lookup_tag): Don't type-abuse of local variable 'old'.
      	(lookup_namespace_name): Likewise.  Allocate binding on stack.
      	(select_decl): Adjust prototype.
      	(unqualified_namespace_lookup):  Allocate binding on stack.
      	Don't type-abuse of local variable 'val'.
      	(lookup_name_real): Likewise.
      	(maybe_inject_for_scope_var): Adjust local variable type.
      	(cp_tree_node_structure): Remove CPLUS_BINDING case label.
      	(namespace_binding): Adjust logic, simplify.
      	(BINDING_LEVEL): Adjust definition.
      	(push_class_level_binding): Adjust local variable type.
      	(struct cxx_saved_binding): Adjust field 'binding' type.
      	* decl2.c (ambiguous_decl): Adjust prototype.
      	(lookup_using_namespace): Adjust local variable type.
      	(qualified_lookup_using_namespace): Catch type error and correct
      	ensueing logic error.
      	(do_nonmember_using_decl): Adjust local variable type.  Allocate
      	temporary cxx_binding on stack.
      	(do_toplevel_using_decl): Adjust local variable type.
      	* ptree.c (cxx_print_cxx_binding): New function.
      	(cxx_print_identifier): Use it.
      	(cxx_print_xnode): Delete CPLUS_BINDING case label.
      
      From-SVN: r64405
      Gabriel Dos Reis committed
  3. 07 Mar, 2003 1 commit
    • call.c (merge_conversion_sequences): New function. · 3d938426
      	* call.c (merge_conversion_sequences): New function.
      	(build_conv): Set ICS_USER_FLAG for USER_CONVs.
      	(convert_class_to_reference): Correct handling of second
      	standard conversion sequence in a user-defined conversion
      	sequence.
      	(build_user_type_conversion_1): Use merge_conversion_sequences.
      	* cp-tree.def: Add comments for CONV nodes.
      
      	* g++.dg/init/ref3.C: New test.
      
      From-SVN: r63930
      Mark Mitchell committed
  4. 17 Jan, 2003 1 commit
    • re PR c++/9294 ([new parser] parser enters infinite loop) · 5dae1114
      	PR c++/9294
      	* cp-tree.def (BASELINK): Make it class 'x', not class 'e'.
      	* cp-tree.h (BASELINK_BINFO): Adjust.
      	(BASELINK_FUNCTIONS): Likewise.
      	(BASELINK_ACCESS_BINFO): Likewise.
      	(tree_baselink): New structure.
      	(cp_tree_node_structure_enum): Add TS_CP_BASELINK.
      	(lang_tree_node): Add baselink.
      	* decl.c (cp_tree_node_structure): Add BASELINK case.
      	* search.c (build_baselink): Adjust.
      	* tree.c (cp_walk_subtrees): Add BASELINK case.  Remove BASELINK_P
      	test from TREE_LIST case.
      
      	PR c++/9272
      	* parser.c (cp_parser_constructor_declarator_p): Do not assume
      	that a constructor cannot be declared outside of its own class.
      
      	* parser.c (cp_parser_resolve_typename_type): If the scope cannot
      	be resolved, neither can the qualified name.
      
      	* rtti.c (get_pseudo_ti_desc): Fix thinko.
      
      	PR c++/9272
      	* g++.dg/parse/ctor1.C: New test.
      
      	PR c++/9294:
      	* g++.dg/parse/qualified1.C: New test.
      
      	* g++.dg/parse/typename3.C: New test.
      
      From-SVN: r61456
      Mark Mitchell committed
  5. 31 Dec, 2002 1 commit
    • cp-tree.def (RETURN_INIT): Remove. · 92bc1323
      	* cp-tree.def (RETURN_INIT): Remove.
      	* cp-tree.h (DECL_IN_MEMORY_P): Remove.
      	(scope_kind): Add sk_block, sk_try, sk_catch, sk_for.
      	(note_level_for_for): Remove.
      	(note_level_for_try): Likewise.
      	(note_level_for_catch): Likewise.
      	(finish_named_return_value): Likewise.
      	(do_pushlevel): Change prototype.
      	(pending_lang_change): Remove.
      	* decl.c (begin_scope): Handle sk_block, sk_try, sk_catch,
      	sk_for.
      	(note_level_for_for): Remove.
      	(note_level_for_try): Likewise.
      	(note_level_for_catch): Likewise.
      	(maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P.
      	* parser.c (cp_parser_context_free_list): Make it "deletable".
      	(cp_parser_template_argument): Remove misleading comment.
      	* pt.c (tsubst_expr): Remove RETURN_INIT code.
      	* semantics.c (genrtl_named_return_value): Remove.
      	(do_pushlevel): Take a scope kind as an argument.
      	(begin_if_stmt): Adjust.
      	(begin_while_stmt): Likewise.
      	(begin_for_stmt): Likewise.
      	(finish_for_init_stmt): Likewise.
      	(begin_switch_stmt): Likewise.
      	(begin_handler): Likewise.
      	(begin_compound_stmt): Likewise.
      	(finish_named_return_value): Remove.
      	(cp_expand_stmt): Remove RETURN_INIT case.
      	* tree.c (cp_statement_code_p): Remove RETURN_INIT case.
      
      	* g++.dg/init/array9.C: New test.
      
      From-SVN: r60707
      Mark Mitchell committed
  6. 30 Dec, 2002 1 commit
  7. 19 Dec, 2002 1 commit
    • Handle anonymous unions at the tree level. · 0ca7178c
              C++ ABI change: Mangle anonymous unions using the name of their
              first named field (by depth-first search).  Should not cause
              binary compatibility problems, though, as the compiler previously
              didn't emit anything for affected unions.
              * cp-tree.def (ALIAS_DECL): New tree code.
              * decl2.c (build_anon_union_vars): Build ALIAS_DECLs.  Return the
              first field, not the largest.
              (finish_anon_union): Don't mess with RTL.  Do set DECL_ASSEMBLER_NAME,
              push the decl, and write it out at namespace scope.
              * decl.c (lookup_name_real): See through an ALIAS_DECL.
              (pushdecl): Add namespace bindings for ALIAS_DECLs.
              * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
              of a decl which doesn't have one.
              * typeck.c (build_class_member_access_expr): Don't recurse if
              we already have the type we want.
      
      From-SVN: r60314
      Jason Merrill committed
  8. 02 Oct, 2002 1 commit
    • re PR c++/7188 (Segfault with template class and recursive (incorrect) initalizer list.) · 2282d28d
      	PR c++/7188.
      	* cp-tree.def (CTOR_INITIALIZER): Use one slot, not two.
      	* cp-tree.h (emit_base_init): Rename to ....
      	(emit_mem_initializers): ... this.
      	(expand_member_init): Change prototype.
      	* init.c (perform_member_init): Compute explicit, rather than
      	requiring it as a parameter.
      	(sort_member_init): Rename to ...
      	(sort_mem_initializers): ... this.  Process bases and data members
      	together.
      	(sort_base_init): Remove.
      	(emit_base_init): Rename to ...
      	(emit_mem_initializers): ... this.
      	(expand_aggr_vbase_init_1): Remove.
      	(construct_virtual_bases): Rename to ...
      	(construct_virtual_base): ... this.
      	(expand_member_init): Rework handling of base initializers.
      	* method.c (do_build_copy_constructor): Use
      	finish_mem_initializers.
      	* parse.y (member_init): Adjust calls to expand_member_init.
      	* pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case.
      	(tsubst_initializer_list): Use expand_member_init.
      	* semantics.c (finish_mem_intiailizers): Simplify.
      
      	PR c++/7188.
      	* g++.dg/template/meminit1.C: New test.
      	* g++.dg/warn/Wreorder-1.C: Likewise.
      	* g++.old-deja/g++.mike/warn3.C: Tweak.
      	* lib/prune.exp: Ingore "in copy constructor".
      
      From-SVN: r57748
      Mark Mitchell committed
  9. 08 Aug, 2002 1 commit
    • Rework build_component_ref. · 50ad9642
      	* call.c (build_vfield_ref): Do not go through build_component_ref.
      	(build_field_call): Use build_class_member_access_expr.
      	(build_user_type_conversion_1): Use BASELINK_FUNCTIONS.
      	(build_object_call): Likewise.
      	* class.c (convert_to_base): New function.
      	(type_requires_array_cookie): Use BASELINK_FUNCTIONS.
      	(instantiate_type): Handle BASELINKs.
      	* cp-tree.def (BASELINK): New tree code.
      	* cp-tree.h (BASELINK_P): Reimplement.
      	(SET_BASELINK_P): Remove.
      	(BASELINK_BINFO): Reimplement.
      	(BASELINK_FUNCTIONS): Likewise.
      	(BASELINK_ACCESS_BINFO): Likewise.
      	(BASELINK_OPTYPE): Likewise.
      	(convert_to_base): New function.
      	(name_p): Likewise.
      	(build_object_ref): Remove.
      	(build_component_ref_1): Likewise.
      	(build_component_ref): Likewise.
      	(build_x_component_ref): Likewise.
      	(build_class_member_access_expr): New function.
      	(finish_class_member_access_expr): Likewise.
      	(build_ptrmemfunc_access_expr): Likewise.
      	* decl.c (grokdeclarator): Handle BASELINKs.
      	* decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using
      	finish_class_member_access_expr.
      	(arg_assoc): Handle BASELINKs.
      	(do_class_using_decl): Likewise.
      	* error.c (dump_decl): Likewise.
      	(dump_expr): Use build_ptrmemfunc_access_expr.
      	* except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find
      	destructors.
      	(build_throw): Use BASELINK_FUNCTIONS.
      	* init.c (perform_member_init): Use
      	build_class_member_access_expr.
      	(build_offset_ref): Handle BASELINKs.  Use
      	build_class_member_access_expr.
      	* method.c (hack_identifier): Likewise.
      	* parse.y (do_id): Use BASELINK, not TREE_LIST.
      	(primary): Remove uses of build_object_ref.
      	* pt.c (lookup_template_function): Handle BASELINKs.
      	(resolve_overloaded_unification): Likewise.
      	* search.c (build_baselink): Build a BASELINK, not a TREE_LIST.
      	(lookup_field): Use BASELINK, not TREE_LIST.
      	(lookup_fnfiels): Likewise.
      	(setup_class_bindings): Likewise.
      	* semantics.c (finish_object_call_expr): Do not use
      	build_method_call when we already know what function is being
      	called.
      	* spew.c (identifier_type): Use BASELINK, not TREE_LIST.
      	* tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not
      	TREE_CHAIN.
      	(name_p): New function.
      	* typeck.c (build_object_ref): Remove.
      	(build_component_ref_1): Likewise.
      	(build_x_component_ref): Likewise.
      	(build_class_member_access_expr): New function.
      	(finish_class_member_access_expr): Likewise.
      	(build_ptrmemfunc_access_expr): Likewise.
      	(get_member_function_from_ptrfunc): Use
      	build_ptrmemfunc_access_expr.
      	(build_binary_op): Likewise.
      	(build_unary_op): Likewise.
      	(build_ptrmemfunc): Likewise.
      	(pfn_from_ptrmemfunc): Likewise.
      	* typeck2.c (build_m_component_ref): Adjust comment.
      
      	* g++.dg/abi/offsetof.C: Tweak error messages.
      	* g++.old-deja/g++.mike/p10769a.C: Likewise.
      
      From-SVN: r56117
      Mark Mitchell committed
  10. 01 Aug, 2002 1 commit
    • call.c (build_field_call): Do not look up the field by name. · 4ba126e4
      	* call.c (build_field_call): Do not look up the field by name.
      	(build_method_call): Simplify.
      	(struct z_candidate): Add access_path and conversion_path.  Remove
      	basetype_path.
      	(convert_class_to_reference): Adjust use of
      	add_function_candidate.
      	(add_candidate): Add conversion_path argument.
      	(add_function_candidate): Use it.
      	(add_conv_dndidate): Likewise.
      	(build_builtin_candidate): Likewise.
      	(add_template_candidate_real): Add conversion_path argument.
      	(add_template_conv_candidate): Likewise.
      	(add_template_candidate): Likewise.
      	(build_user_type_conversion_1): Use it.
      	(build_new_function_call): Remove name lookup code.  Adjust use of
      	add_template_candidate and add_function_candidate.
      	(build_new_op): Likewise.
      	(convert_like_real): Use build_special_member_call.
      	(build_over_call): Use cand->conversion_path.
      	(build_special_member_call): New method.
      	(build_new_method_call): Remove name lookup code.
      	* cp-tree.def (OFFSET_REF): Update documentation.
      	(TEMPLATE_ID_EXPR): Likewise.
      	* cp-tree.h (BASELINK_ACCESS_BINFO): New macro.
      	(BASELINK_OPTYPE): Likewise.
      	(build_new_method_call): Adjust prototype.
      	(build_special_member_call): New method.
      	(build_baselink): New method.
      	(build_offset_ref_call_from_tree): Likewise.
      	(build_call_from_tree): Likewise.
      	(finish_qualified_call_expr): Remove.
      	(finish_call_expr): Adjust prototype.
      	(build_x_function_call): Remove.
      	* cvt.c (ocp_convert): Use build_special_member_call.
      	* decl2.c (reparse_absdcl_as_expr): Use finish_call_expr.
      	(build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and
      	CALL_EXPR.
      	(build_offset_ref_call_from_tree): New function.
      	(build_call_from_tree): Likewise.
      	* init.c (expand_cleanup): Use build_special_member_call.
      	(expand_default_init): Likewise.
      	(build_member_call): Use finish_call_expr.
      	(build_new_1): Use build_special_member_call.
      	(push_base_cleanups): Likewise.
      	* method.c (do_build_assign_ref): Likewise.
      	* parse.y (template_id): Do not pass a COMPONENT_REF to
      	lookup_template_function.
      	(primary): Use parse_finish_call_epxr, not finish_call_expr.
      	(parse_finish_call_expr): New function.
      	* pt.c (lookup_template_function): Add assertions.
      	* search.c (lookup_base): Allow T to be a binfo.
      	(build_baselink): New function.
      	(lookup_member): Use it.
      	* semantics.c (finish_call_expr): Do not do name lookup.
      	(finish_object_call_expr): Remove #if 0'd code.
      	(finish_qualified_call_expr): Remove.
      	* typeck.c (build_x_function_call): Remove.
      	(build_static_case): Use build_special_member_call.
      	* typeck2.c (build_functional_cast): Likewise.
      
      	* g++.dg/inherit/operator1.C: New test.
      	* g++.dg/lookup/disamb1.C: Fix typo in comment.
      	* g++.dg/other/error1.C: Change expected error message.
      	* g++.dg/template/conv4.C: Likewise.
      
      From-SVN: r55920
      Mark Mitchell committed
  11. 04 Apr, 2002 1 commit
    • re PR c++/5636 (gcc-3.0.3, memory leakage: function that take a string as… · 659e5a7a
      re PR c++/5636 (gcc-3.0.3, memory leakage: function that take a string as parameter will not call local variable destructors if exception is thrown.)
      
              PR c++/5636
              * tree.h (CLEANUP_EH_ONLY): New macro.
              * stmt.c (expand_decl_cleanup_eh): New fn.
              (expand_cleanups): Check CLEANUP_EH_ONLY.
              * c-semantics.c (genrtl_decl_cleanup): Just take the CLEANUP_STMT.
              Use expand_decl_cleanup_eh.
              (expand_stmt): Adjust.
              * c-common.h: Adjust prototype.
              * cp/semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on
              cleanup for nrv.
      
              * except.c (struct eh_status): Remove protect_list.
              (begin_protect_partials, end_protect_partials): Remove.
              (add_partial_entry): Remove.
              * except.h: Remove prototypes.
      
              * expr.c (expand_expr) [WITH_CLEANUP_EXPR, TARGET_EXPR]: Use
              expand_decl_cleanup_eh.
      
      cp/:
              * semantics.c (finish_eh_cleanup): New fn.
              * cp-tree.h: Add prototype.
              * init.c (perform_member_init, expand_cleanup_for_base): Use
              finish_eh_cleanup.
              * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove.
              * cp-tree.h: Remove references.
              * decl.c (begin_constructor_body, end_constructor_body): Likewise.
              * dump.c (cp_dump_tree): Likewise.
              * pt.c (tsubst_expr): Likewise.
              * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove.
              (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT.
              * tree.c (cp_statement_code_p): Likewise.
      
              * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup.
      
      From-SVN: r51827
      Jason Merrill committed
  12. 15 Mar, 2002 1 commit
    • c-common.c (statement_code_p): Handle CLEANUP_STMT. · 6e4ae815
      	* c-common.c (statement_code_p): Handle CLEANUP_STMT.
      	* c-common.def (CLEANUP_STMT): New tree node.
      	* c-common.h (CLEANUP_DECL): New macro.
      	(CLEANUP_EXPR): Likewise.
      	* c-semantics.c (expand_stmt): Handle CLEANUP_STMT.
      	* tree-dump.c (dequeue_and_dump): Handle CLEANUP_STMT.
      	* tree-inline.c (initialize_inlined_parameters): Clean up
      	new local variables.
      
      	* cp-tree.h (CLEANUP_DECL): Remove.
      	(CLEANUP_EXPR): Likewise.
      	* decl.c (destroy_local_var): Simplify.
      	(maybe_build_cleanup): Tidy.
      	* dump.c (cp_dump_tree): Remove handling of CLEANUP_STMT.
      	* semantics.c (cp_expand_stmt): Likewise.
      	* cp/tree.c (cp_statement_code_p): Likewise.
      
      	* g++.dg/opt/dtor1.C: New test.
      
      From-SVN: r50830
      Mark Mitchell committed
  13. 14 Dec, 2001 1 commit
    • c-common.h (COMPOUND_STMT_BODY_BLOCK): New macro. · ade3dc07
              * c-common.h (COMPOUND_STMT_BODY_BLOCK): New macro.
      
              * Make-lang.in (parse.h): Separate rule, just depend on parse.c.
      
              Use cleanups to run base and member destructors.
              * init.c (push_base_cleanups): New function, split out from...
              (build_delete): ...here.  Lose !TYPE_HAS_DESTRUCTOR code.
              * decl.c (finish_destructor_body): Move vbase destruction code to
              push_base_cleanups.
              (begin_function_body, finish_function_body): New fns.
              (finish_function): Move [cd]tor handling and call_poplevel to
              finish_function_body.
              (pushdecl): Skip the new level.
              * semantics.c (genrtl_try_block): Don't call end_protect_partials.
              (setup_vtbl_ptr): Call push_base_cleanups.
              * method.c (synthesize_method): Call {begin,end}_function_body.
              * pt.c (tsubst_expr): Handle COMPOUND_STMT_BODY_BLOCK.
              * cp-tree.h: Declare new fns.
              * parse.y (function_body, .begin_function_body): New nonterminals.
              (fndef, pending_inline, function_try_block): Use function_body.
              (ctor_initializer_opt, function_try_block): No longer has a value.
              (base_init): Remove .set_base_init token.
              (.set_base_init, compstmt_or_error): Remove.
              * Make-lang.in (parse.c): Expect two fewer s/r conflicts.
      
      From-SVN: r47987
      Jason Merrill committed
  14. 23 Oct, 2001 1 commit
    • cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node. · b8c6534b
      	* cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node.
      	* cp-tree.h (make_unbound_class_template): Prototype new function.
      	* decl.c (make_unbound_class_template): New function.
      	* decl2.c (arg_assoc_template_arg): Handle UNBOUND_CLASS_TEMPLATE.
      	* error.c (dump_type): Likewise.
      	* mangle.c (write_type): Likewise.
      	* parse.y (template_parm): Likewise.
      	(template_argument): Use make_unbound_class_template.
      	* pt.c (convert_template_argument): Handle UNBOUND_CLASS_TEMPLATE.
      	(tsubst): Likewise.
      	(tsubst_copy): Likewise.
      	(unify): Likewise.
      	* tree.c (walk_tree): Likewise.
      	* typeck.c (comptypes): Likewise.
      
      From-SVN: r46430
      Kriang Lerdsuwanakij committed
  15. 06 Jul, 2001 1 commit
  16. 21 May, 2001 1 commit
    • cp-tree.def (START_CATCH_STMT): Lose. · 1a6025b4
              * cp-tree.def (START_CATCH_STMT): Lose.
              * dump.c (cp_dump_tree): Don't dump it.  Do dump HANDLER_PARMS.
              * tree.c (cp_statement_code_p): Don't case it.
              * semantics.c (cp_expand_stmt): Likewise.
              * except.c (expand_start_catch_block): Don't start any blocks.
              Return the type.
              (expand_end_catch_block): Don't end any blocks.
              * parse.y (handler): Don't pass anything from finish_handler_parms
              to finish_handler.
              * pt.c (tsubst_expr): Likewise.
              * semantics.c (begin_handler): Call note_level_for_catch here.
              (finish_handler_parms): Don't return anything.
              (genrtl_catch_block, begin_catch_block): Lose.
              (genrtl_handler): Call expand_start_catch here.
              * cp-tree.h (START_CATCH_TYPE): Lose.
              (HANDLER_TYPE): New.
      
      From-SVN: r42388
      Jason Merrill committed
  17. 01 May, 2001 1 commit
    • cp-tree.def (USING_STMT): New statement node. · 9da99f7d
      cp:
      	* cp-tree.def (USING_STMT): New statement node.
      	* cp-tree.h (USING_STMT_NAMESPACE): New macro.
      	* decl2.c (do_using_directive): Add USING_STMT to statement
      	tree. Don't emit errors when processing template decl.
      	* pt.c (tsubst_expr, USING_STMT case): New case.
      	* semantics.c (cp_expand_stmt, USING_STMT case): New case.
      testsuite:
      	* g++.old-deja/g++.ns/template17.C: New test.
      
      From-SVN: r41724
      Nathan Sidwell committed
  18. 24 Apr, 2001 1 commit
    • Lazy __FUNCTION__ generation. · 0ba8a114
      gcc:
      	Lazy __FUNCTION__ generation.
      	* c-common.h (RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME,
      	RID_C99_FUNCTION_NAME): New _RIDs.
      	(CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, CTI_FUNC_ID): Remove.
      	(CTI_FUNCTION_NAME_DECL, CTI_PRETTY_FUNCTION_NAME_DECL,
      	CTI_C99_FUNCTION_NAME_DECL, CTI_SAVED_FUNCTION_NAME_DECLS): New
      	global tree slots.
      	(function_id_node, pretty_function_id_node, func_id_node): Remove.
      	(c99_function_name_decl_node, function_name_decl_node,
      	pretty_function_name_decl_node, saved_function_name_decls):
      	Declare.
      	(struct language_function): Remove x_function_name_declared_p.
      	(make_fname_decl): Remove a parameter.
      	(declare_function_names): Remove prototype.
      	(start_fname_decls, finish_fname_decls): Prototype.
      	(fname_as_string): Likewise.
      	(fname_string, fname_decl): Likewise.
      	* c-common.c (make_fname_decl): Adjust.
      	(struct fname_var_t): New struct.
      	(fname_vars): New static array.
      	(declare_function_name): Remove.
      	(start_fname_decls, finish_fname_decls): New functions.
      	(fname_as_string): New function from remnants of
      	declare_function_name.
      	(fname_string, fname_decl): New functions.
      
      	* c-decl.c (c_function_name_declared_p): Remove.
      	(init_decl_processing): Don't generate __FUNCTION__ et al ids,
      	don't call declare_function_name. Call start_fname_decls.
      	(c_make_fname_decl): Adjust parameters. Generate the name. Don't
      	clobber the line number. Call finish_decl.
      	(start_function): Call start_fname_decls.
      	(finish_function): Call finish_fname_decls.
      	Remove c_function_name_declared_p.
      	(push_c_function_context): Don't push c_function_name_declared_p.
      	(pop_c_function_context): Don't pop c_function_name_declared_p.
      	(c_begin_compound_stmt): Don't check c_function_name_declared_p.
      	* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): New tokens.
      	(program): Call finish_fname_decls for C.
      	(primary): Add VAR_FUNC_NAME.
      	(reswords): Add slots for __FUNCTION__ et al.
      	(rid_to_yy): Add mappings for __FUNCTION__ et al.
      	(yylexname): If it's a STRING_FUNC_NAME generate the function name
      	now. Don't look for VAR_DECLs containing __FUNCTION__ et al.
      	* c-semantics.c (prune_unused_decls): Remove.
      	(finish_stmt_tree): Don't call prune_unused_decls.
      	(genrtl_decl_stmt): Don't prune unused decls here.
      cp:
      	Lazy __FUNCTION__ generation.
      	* cp-tree.def (FUNCTION_NAME): Remove.
      	* cp-tree.h (function_name_declared_p): Remove.
      	(cp_fname_init): Prototype.
      	* decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids,
      	don't call declare_function_name. Call start_fname_decls.
      	(cp_make_fname_decl): Adjust parameters. Generate the name. Don't
      	clobber the line number.
      	(cp_fname_init): New function.
      	(start_function): Call start_fname_decls.
      	(finish_function): Call finish_fname_decls.
      	* lex.c (reswords): Add slots for __FUNCTION__ et al.
      	(rid_to_yy): Add mappings for __FUNCTION__ et al.
      	* optimize.c (maybe_clone_body): Remove function_name_declared_p.
      	* parse.y (VAR_FUNC_NAME): New token.
      	(primary): Add VAR_FUNC_NAME.
      	* pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's
      	generation.
      	(tsubst, FUNCTION_NAME case): Remove.
      	(tsubst_copy, FUNCTION_NAME case): Remove.
      	(tsubst_expr, DECL_STMT case): Be careful with a
      	DECL_PRETTY_FUNCTION_P.
      	(instantiate_decl): Remove function_name_declared_p.
      	* semantics.c (begin_compound_statement): Don't call
      	declare_function_name here.
      	(setup_vtbl_ptr). Don't save & restore function_name_declared_p.
      	(finish_translation_unit): Call finish_fname_decls.
      	(expand_body): Remove function_name_declared_p.
      	* typeck2.c (digest_init): Allow any ERROR_MARK.
      testsuite:
      	* gcc.dg/c99-func-2.c: Remove xfail.
      	* gcc.dg/c99-func-3.c: Remove xfail.
      	* gcc.dg/c99-func-4.c: Remove xfail.
      
      From-SVN: r41520
      Nathan Sidwell committed
  19. 28 Mar, 2001 1 commit
  20. 05 Jan, 2001 1 commit
  21. 05 Sep, 2000 1 commit
    • cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. · a1281f45
              * cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code.
              (TEMPLATE_TEMPLATE_PARM): Adjust comment.
              * cp-tree.h (TYPE_BINFO): Adjust comment.
              (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise.
              (TEMPLATE_TYPE_PARM_INDEX): Likewise.
              (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead.
              (TYPE_TEMPLATE_INFO): Likewise.
              (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise.
              * class.c (push_nested_class): Likewise.
              * decl.c (lookup_name_real): Likewise.
              (grokdeclarator): Likewise.
              (grok_op_properties): Likewise.
              (xref_tag): Likewise.
              (xref_basetypes): Likewise.
              * decl2.c (constructor_name_full): Likewise.
              (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case.
              (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead.
              * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case.
              (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              (dump_type_suffix): Likewise.
              * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM
              instead.
              (get_aggr_from_typedef): Likewise.
              * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case.
              (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              (write_template_parm): Likewise.
              (write_template_template_parm): Check tree code instead of
              using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
              * method.c (build_overload_nested_name): Add
              BOUND_TEMPLATE_TEMPLATE_PARM.
              (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case.
              * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              * pt.c (convert_template_argument): Check tree code instead of
              using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
              (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case.
              (for_each_template_parm): Adjust comment.
              (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM.  Reorganize.
              (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM.  Reorganize.  Use
              template_args_equal to compare template template parameter cases.
              * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM
              instead.
              * tree.c (copy_template_template_parm): Decide whether to create
              a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node.
              (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM.
              (copy_tree_r): Likewise.
              * typeck.c (comptypes): Likewise.  Check tree code instead of
              using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
      
      From-SVN: r36149
      Kriang Lerdsuwanakij committed
  22. 30 Aug, 2000 1 commit
  23. 12 Aug, 2000 1 commit
  24. 23 Jun, 2000 1 commit
    • parse.y (template_arg): Convert TEMPLATE_DECL that is a template template paramter to... · 1899c3a4
              * parse.y (template_arg): Convert TEMPLATE_DECL
              that is a template template paramter to
              TEMPLATE_TEMPLATE_PARM here.
      
              * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Adjust comment.
              * cp-tree.h (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): New macro.
              (copy_template_template_parm): Adjust prototype.
              * decl.c (grokdeclarator): Remove dead code.
              * pt.c (process_template_parm): Tidy.
              (lookup_template_class): Construct nodes in
              copy_template_template_parm.
              (tsubst): Pass TEMPLATE_DECL rather than IDENTIFIER_NODE to
              lookup_template_class.  Use TYPE_TI_TEMPLATE.
              * tree.c (copy_template_template_parm): Add NEWARGS
              parameter.
              (mapcar): Adjust call to copy_template_template_parm.
              * typeck.c (comptypes): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL.
              * method.c (build_template_template_parm_names): Change error
              code to avoid compilation warning.
      
              * gxxint.texi: Document template template parameter
              name mangling.
      
      From-SVN: r34659
      Kriang Lerdsuwanakij committed
  25. 14 Jun, 2000 1 commit
    • c-common.h (IF_COND): Moved here from cp/cp-tree.h. · d7e7759d
      	* c-common.h (IF_COND): Moved here from cp/cp-tree.h.
      	(THEN_CLAUSE): Likewise.
      	(ELSE_CLAUSE): Likewise.
      	(WHILE_COND): Likewise.
      	(WHILE_BODY): Likewise.
      	(DO_COND): Likewise.
      	(DO_BODY): Likewise.
      	(RETURN_EXPR): Likewise.
      	(EXPR_STMT_EXPR): Likewise.
      	(FOR_INIT_STMT): Likewise.
      	(FOR_COND): Likewise.
      	(FOR_EXPR): Likewise.
      	(FOR_BODY): Likewise.
      	(SWITCH_COND): Likewise.
      	(SWITCH_BODY): Likewise.
      	(CASE_LOW): Likewise.
      	(CASE_HIGH): Likewise.
      	(GOTO_DESTINATION): Likewise.
      	(COMPOUND_BODY): Likewise.
      	(ASM_CV_QUAL): Likewise.
      	(ASM_STRING): Likewise.
      	(ASM_OUTPUTS): Likewise.
      	(ASM_INPUTS): Likewise.
      	(ASM_CLOBBERS): Likewise.
      	(DECL_STMT_DECL): Likewise.
      	(STMT_EXPR_STMT): Likewise.
      	(LABEL_STMT_LABEL): Likewise.
      	(SCOPE_BEGIN_P): Likewise.
      	(SCOPE_END_P): Likewise.
      	(SCOPE_STMT_BLOCK): Likewise.
      	(SCOPE_NULLIFIED_P): Likewise.
      	(SCOPE_NO_CLEANUPS_P): Likewise.
      	(SCOPE_PARTIAL_P): Likewise.
      	(ASM_VOLATILE_P): Likewise.
      	(STMT_LINENO): Likewise.
      	(STMT_LINENO_FOR_FN_P): Likewise.
      
      	* c-common.def: Added SRCLOC, SIZEOF_EXPR, ARROW_EXPR,
      	ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT,
      	FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT,
      	CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT,
      	SCOPE_STMT, CASE_LABEL, STMT_EXPR.
      
      	* gencheck.c (tree_codes[]): Added '#include "c-common.def"'.
      
      	* cp/cp-tree.h (IF_COND): Move to c-common.h.
      	(THEN_CLAUSE): Likewise.
      	(ELSE_CLAUSE): Likewise.
      	(WHILE_COND): Likewise.
      	(WHILE_BODY): Likewise.
      	(DO_COND): Likewise.
      	(DO_BODY): Likewise.
      	(RETURN_EXPR): Likewise.
      	(EXPR_STMT_EXPR): Likewise.
      	(FOR_INIT_STMT): Likewise.
      	(FOR_COND): Likewise.
      	(FOR_EXPR): Likewise.
      	(FOR_BODY): Likewise.
      	(SWITCH_COND): Likewise.
      	(SWITCH_BODY): Likewise.
      	(CASE_LOW): Likewise.
      	(CASE_HIGH): Likewise.
      	(GOTO_DESTINATION): Likewise.
      	(COMPOUND_BODY): Likewise.
      	(ASM_CV_QUAL): Likewise.
      	(ASM_STRING): Likewise.
      	(ASM_OUTPUTS): Likewise.
      	(ASM_INPUTS): Likewise.
      	(ASM_CLOBBERS): Likewise.
      	(DECL_STMT_DECL): Likewise.
      	(STMT_EXPR_STMT): Likewise.
      	(LABEL_STMT_LABEL): Likewise.
      	(SCOPE_BEGIN_P): Likewise.
      	(SCOPE_END_P): Likewise.
      	(SCOPE_STMT_BLOCK): Likewise.
      	(SCOPE_NULLIFIED_P): Likewise.
      	(SCOPE_NO_CLEANUPS_P): Likewise.
      	(SCOPE_PARTIAL_P): Likewise.
      	(ASM_VOLATILE_P): Likewise.
      	(STMT_LINENO): Likewise.
      	(STMT_LINENO_FOR_FN_P): Likewise.
      
      	* cp/cp-tree.def: Removed SRCLOC, SIZEOF_EXPR, ARROW_EXPR,
      	ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT,
      	FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT,
      	CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT,
      	SCOPE_STMT, CASE_LABEL, STMT_EXPR.
      
      	* cp/Makefile.in (CXX_TREE_H): Added $(srcdir)/../c-common.def.
      
      	* cp/Make-lang.in (CXX_SRCS): Added $(srcdir)/c-common.def.
      	(cc1plus$(exeext)): Added $(srcdir)/c-common.def.
      
      	* cp/lex.c (cplus_tree_code_type[]): Added '#include "c-common.def"'.
      	(cplus_tree_code_length[]): Added '#include "c-common.def"'.
      	(cplus_tree_code_name[]): Added '#include "c-common.def"'.
      
      From-SVN: r34552
      Benjamin Chelf committed
  26. 03 May, 2000 1 commit
    • cp-tree.def (THUNK_DECL): Remove. · eb68cb58
      	* cp-tree.def (THUNK_DECL): Remove.
      	* cp-tree.h (DECL_THUNK_P): New macro.
      	(DECL_NON_THUNK_FUNCTION_P): Likewise.
      	(DECL_EXTERN_C_FUNCTION_P): Likewise.
      	(SET_DECL_THUNK_P): Likewise.
      	(DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P.
      	(FNADDR_FROM_VTABLE_ENTRY): Likewise.
      	(DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P.
      	* decl.c (decls_match): Use DECL_EXTERN_C_P.
      	(duplicate_decls): Likewise.
      	(pushdecl): Likewise.  Adjust thunk handling.
      	(grokfndecl): Use DECL_EXTERN_C_P.
      	* decl2.c (mark_vtable_entries): Use DECL_THUNK_P.
      	* dump.c (dequeue_and_dump): Remove THUNK_DECL handling.
      	* except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P.
      	* expr.c (cplus_expand_expr): Remove THUNK_DECL handling.
      	* method.c (make_thunk): Use SET_DECL_THUNK_P.  Set
      	DECL_NO_STATIC_CHAIN.
      	(emit_thunk): Don't play games with TREE_CODE on thunks.  Don't
      	set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk.
      	* search.c (covariant_return_p): Remove THUNK_DECL handling.
      	* ir.texi: Update.
      
      From-SVN: r33647
      Mark Mitchell committed
  27. 16 Apr, 2000 1 commit
    • cp-tree.def (THUNK_DECL): Add to documentation. · 4e7512c9
      	* cp-tree.def (THUNK_DECL): Add to documentation.
      	* cp-tree.h (flag_huge_objects): Declare.
      	* class.c (modify_vtable_entry): Tidy.
      	(update_vtable_entry_for_fn): Split out from dfs_modify_vtables.
      	Calculate delta appropriately for the new ABI.
      	(dfs_modify_vtables): Use it.
      	(modify_all_vtables): Fix thinko in code to add overriding copies
      	of functions to primary vtables.
      	(build_clone): Fix typo in comment.
      	(clone_function_decl): Correct order of destructors in vtable.
      	(build_vbase_offset_vtbl_entries): Adjust comment.
      	(dfs_vcall_offset_queue_p): Remove.
      	(dfs_build_vcall_offset_vtbl_entries): Update BV_VCALL_INDEX.
      	(build_vcall_offset_vtbl_entries): Juse use dfs_skip_vbases.
      	(build_vtable_entry): Correct check for pure virtual functions.
      	Don't declare flag_huge_objects.
      	* decl.c (flag_huge_objects): Remove declaration.
      	* method.c (make_thunk): Tweak mangling for vcall offset thunks.
      	Use int_size_in_bytes.
      	(emit_thunk): Handle vcall offset thunks.
      
      From-SVN: r33185
      Mark Mitchell committed
  28. 26 Feb, 2000 1 commit
  29. 29 Jan, 2000 1 commit
    • cp-tree.def (THUNK_DECL): Discuss vcall indices. · c0bbf652
      	* cp-tree.def (THUNK_DECL): Discuss vcall indices.
      	* cp-tree.h (BINFO_VIRTUALS): Update documentation.
      	(BF_DELTA): New macro.
      	(BF_VCALL_INDEX): Likewise.
      	(BF_FN): Likewise.
      	(THUNK_VCALL_OFFSET): Likewise.
      	(make_thunk): Change prototype.
      	* class.c (build_vtable_entry): Integrate
      	build_vtable_entry_for_fn.  Handle vcall indices.
      	(build_vtable_entry_for_fn): Remove.
      	(set_rtti_entry): Handle vcall indices.  Use BF_DELTA,
      	BF_VCALL_INDEX, BF_FN.
      	(modify_vtable_entry): Integrate common code from
      	modify_one_vtable and dfs_fixup_vtable_deltas.
      	(add_virtual_function): Set BF_VCALL_INDEX.
      	(build_vtbl_initializer): Simplify.  Use BF_DELTA, BF_VCALL_INDEX,
      	and BF_FN.
      	(modify_one_vtable): Simplify.
      	(dfs_fixup_vtable_deltas): Likewise.
      	(override_one_vtable): Use BF_DELTA, BF_VCALL_INDEX, BF_FN.
      	* method.c (make_thunk): Handle vcall indices.
      
      From-SVN: r31684
      Mark Mitchell committed
  30. 15 Dec, 1999 1 commit
  31. 05 Dec, 1999 1 commit
    • cp-tree.def (SCOPE_STMT): Take one operand. · d9b2d9da
      	* 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
      Mark Mitchell committed
  32. 25 Nov, 1999 1 commit
    • Make-lang.in (CXX_SRCS): Add optimize.c. · 46e8c075
      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
      Mark Mitchell committed
  33. 23 Nov, 1999 2 commits
    • cp-tree.def (CTOR_COMPLETE): New tree node. · 083eb575
      	* 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
      Mark Mitchell committed
    • cp-tree.def (FUNCTION_NAME): New tree node. · f9817201
      	* 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
      Mark Mitchell committed
  34. 21 Oct, 1999 1 commit
  35. 03 Oct, 1999 1 commit
    • cp-tree.def (VEC_INIT_EXPR): Remove. · 6f80451c
      	* cp-tree.def (VEC_INIT_EXPR): Remove.
      	* cp-tree.h (struct stmt_tree): New type.
      	(struct saved_scope): Remove firstobj.  Add x_saved_tree,
      	x_stmt_tree.
      	(class_cache_firstobj): Remove.
      	(struct language_function): Remove stmts_are_full_exprs_p,
      	x_last_tree, and x_last_expr_type.  Add x_stmt_tree.
      	(current_stmt_tree): New macro.
      	(last_tree): Adjust.
      	(last_expr_type): Likewise.
      	(doing_semantic_analysis_p): Simplify.
      	(stmts_are_full_exprs_p): Adjust.
      	(begin_tree): Remove prototype.
      	(end_tree): Likewise.
      	(begin_stmt_tree): Change prototype.
      	(finish_stmt_tree): Likewise.
      	(building_stmt_tree): Simplify.
      	* decl.c (mark_stmt_tree): New function.
      	(mark_saved_scope): Use it.
      	(start_function): Rearrange slightly to call begin_stmt_tree
      	earlier.
      	(save_function_data): Tweak.
      	(finish_function): Adjust call to finish_stmt_tree.
      	(mark_lang_function): Use mark_stmt_tree.
      	* expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR.
      	* init.c (build_new_1): Remove creation of VEC_INIT_EXPR.
      	(build_vec_init): Remove creation of stand-in intializer.
      	* pt.c (begin_tree): Remove.
      	(end_tree): Likewise.
      	* semantics.c (SET_LAST_STMT): New macro.  Use it throughout.
      	(begin_compound_stmt): Handle a compound-statement outside of a
      	function.
      	(begin_stmt_expr): Handle a statement-expression outsidef of a
      	function.
      	(finish_stmt_expr): Likewise.
      	(begin_class_definition): Don't call begin_tree.
      	(finish_inline_definitions): Don't call end_tree.
      	(begin_stmt_tree): Take a pointer to tree, not a function as input.
      	(finish_stmt_tree): Likewise.
      	* tree.c (search_tree): Don't handle VEC_INIT_EXPR.
      	(mapcar): Likewise.
      
      	* parse.y (simple_stmt): Don't call finish_stmt unnecessarily.
      	* parse.c: Regenerated.
      
      	* dump.c (dqueue_and_dump): Dump bitfieldness.
      
      From-SVN: r29786
      Mark Mitchell committed
  36. 17 Sep, 1999 1 commit
    • cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. · 59026e79
      	* cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
      	(TRY_BLOCK): Likewise.
      	(HANDLER): Likewise.
      	(START_CATCH_STMT): New tree node.
      	(SCOPE_STMT): Likewise.
      	* cp-tree.h (SCOPE_BEGIN_P): New macro.
      	(SCOPE_NULLIFIED_P): Likewise.
      	(struct lang_decl_flags): Add pending_inline_p.  Adjust dummy.
      	(struct lang_decl): Add saved_language_function.
      	(DECL_PENDING_INLINE_INFO): Adjust documentation.
      	(DECL_PENDING_INLINE_P): New macro.
      	(TYPE_TI_ARGS): Fix typo in comment.
      	(DECL_SAVED_TREE): Add to documentation.
      	(DECL_SAVED_FUNCTION_DATA): New macro.
      	(START_CATCH_TYPE): Likewise.
      	(SCOPE_END_P): New macro.
      	(declare_parm_level): Don't declare.
      	* decl.c (mark_lang_function): New function, split out from
      	mark_cp_function_context.
      	(save_function_data): New function.
      	(declare_parm_level): Remove.
      	(finish_function): Use save_function_data to squirrel away
      	important stuff for later use.
      	(mark_cp_function_context): Use mark_function_data.
      	(lang_mark_tree): Likewise.
      	* lex.c (begin_definition_of_inclass_inline): Set
      	DECL_PENDING_INLINE_P.
      	(store_pending_inline): Clear it.
      	* pt.c (tsubst_decl): Likewise.
      
      From-SVN: r29488
      Mark Mitchell committed
  37. 12 Sep, 1999 1 commit
    • cp-tree.def (CLEANUP_STMT): New node. · 24bef158
      	* cp-tree.def (CLEANUP_STMT): New node.
      	* cp-tree.h (language_function): Add name_declared.
      	(current_function_name_declared): New macro.
      	(CLEANUP_DECL): New macro.
      	(CLEANUP_EXPR): Likewise.
      	(emit_local_var): Likewise.
      	(finish_decl_cleanup): New function.
      	* cvt.c (build_up_reference): Simplify.
      	(ocp_convert): Remove dead code.
      	* decl.c (start_decl): Remove call to add_decl_stmt.
      	(grok_reference_init): Adjust, to handle bindings temporaries to
      	references.  Remove dead code.
      	(initialize_local_var): Don't generate RTL for
      	declarations here, or build cleanups here.  Don't fuss with
      	obstacks.  Replace expand_start_target_temps calls with explicit
      	setting of stms_are_full_exprs_p.
      	(destroy_local_var): New function.
      	(emit_local_var): Likewise.
      	(cp_finish_decl): Use them, as appropriate.
      	(start_function): Announce template functions.
      	(store_parm_decls): Don't call declare_function_name here.
      	(finish_stmt): Don't start emit base-initialization code when just
      	building the statement-tree.
      	* init.c (create_temporary_var): Move add_decl_stmt call ...
      	(get_temp_regvar): Here.
      	* pt.c (tsubst_expr): Make DECL_INITIAL look like what
      	cp_finish_decl would expect.  Don't call add_decl_stmt.
      	* semantics.c (begin_compound_stmt): Call declare_function_name,
      	if appropriate.
      	(finish_decl_cleanup): New function.
      	(expand_stmt): Use emit_local_var to output variables.
      	(expand_body): Set current_funtion_name_declared.
      
      From-SVN: r29348
      Mark Mitchell committed
  38. 07 Sep, 1999 1 commit
    • Makefile.in (tree.o): Depend on ggc.h. · 87e3dbc9
      	* Makefile.in (tree.o): Depend on ggc.h.
      	* class.c (make_method_vec): Remove.
      	(free_method_vec): Likewise.
      	(free_method_vecs): Remove.
      	(add_method): Don't use them.
      	* cp-tree.def (PTRMEM_CST): Make it longer.
      	(TEMPLATE_PARM_INDEX): Make it shorter.
      	* cp-tree.h (BINDING_HAS_LEVEL_P): New macro.
      	(template_parm_index): Remove RTL field.
      	(ptrmem_cst): Add RTL field.
      	(finish_function): Removed parameter.
      	(process_next_inline): Change prototype.
      	(init_cplus_unsave): Rename to init_tree.
      	(binding_init): Remove.
      	* decl.c (free_binding_nodes): Remove.
      	(push_binding): Don't use them.  Set BINDING_HAS_LEVEL_P.
      	(pop_binding): Don't use free_binding_nodes.
      	(free_binding_vecs): Remove.
      	(store_bindings): Don't use them.
      	(pop_from_top_level): Likewise.
      	(lookup_namespace_name): Simplify.
      	(build_typename_type): Don't use obstack_free.
      	(unqualified_namespace_lookup): Simplify.
      	(lookup_name_real): Simplify.
      	(start_function): Remove comment about leaks.
      	(finish_function): Removed nested parameter.  Call
      	expand_end_bindings even when building_stmt_tree.
      	Call ggc_push_context and ggc_pop_context around
      	rest_of_compilation, if necessary.
      	(mark_cp_function_context): Handle a NULL language-context.
      	(lang_mark_false_label_stack): Fix typo.
      	(lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD,
      	TEMPLATE_PARM_INDEX.  Handle the funny TYPE_LANG_SPECIFIC on
      	pointer to method types.
      	(lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC.
      	* decl2.c (finish_objects): Adjust call to finish_function.
      	(finish_static_store_duration_function): Likewise.
      	(do_nonmember_using_decl): Remove call to binding_init.
      	* except.c (end_anon_func): Adjust call to finish_function.
      	* lex.c (mark_impl_file_chain): New function.
      	(init_parse): Call init_tree, not init_cplus_unsave.
      	Add GC roots.
      	(cp_pramga_interface): Use xmalloc, not permalloc.
      	(cp_pragma_implementation): Likewise.
      	(begin_definition_of_inclass_inline): Simplify.
      	(process_next_inline): Adjust prototype.
      	(do_scoped_id): Don't call binding_init.
      	(make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc.
      	(emit_thunk): Adjust call to finish_function.
      	(synthesize_method): Likewise.
      	* parse.y (%union): Add a new `pi' variant.
      	(PRE_PARSED_FUNCTION_DECL): Use it.
      	(fn.defpen): Likewise.
      	(fndef): Adjust call to finish_function.
      	(instantiate_decl): Likewise.
      	(rtti.c): Likewise.
      	(semantics.c): Likewise.
      	* tree.c: Include ggc.h.
      	(mark_list_hash): New function.
      	(binding_init): Remove.
      	(init_cplus_unsave): Rename to ...
      	(init_tree): This.  Add GC roots.
      
      From-SVN: r29172
      Mark Mitchell committed
  39. 28 Aug, 1999 1 commit
    • cp-tree.def (LABEL_STMT): New tree node. · acef433b
      	* cp-tree.def (LABEL_STMT): New tree node.
      	(LABEL_STMT_LABEL): New macro.
      	(shadow_label): Remove.
      	(declare_local_label): New function.
      	(finish_label_decl): Likewise.
      	* decl.c (make_label_decl): New function, split out from
      	lookup_label.
      	(shadowed_labels): Remove.
      	(binding_level): Add shadowed_labels.
      	(clear_binding_level): Remove.
      	(push_binding_level): Just bzero the new binding level.
      	(pushlevel): Fix indentation.
      	(pop_label): New function.
      	(pop_labels): Likewise, split out from poplevel.
      	(poplevel): Pop local labels.  Use pop_labels.
      	(maybe_push_to_top_level): Don't clear shadowed_labels.
      	(lookup_label): Use make_label_decl.
      	(shadow_label): Remove.
      	(declare_local_label): New function.
      	(define_label): Simplify.
      	(start_function): Don't clear shadowed_labels.
      	(cp_function): Remove shadowed_labels.
      	(push_cp_function_context): Don't save shadowed_labels.
      	(pop_cp_function_context): Don't restore it.
      	* dump.c (dequeue_and_dump): Handle LABEL_STMT.
      	* parse.y (label_decl): Use finish_label_decl.
      	* pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
      	declarations.
      	* semantics.c (finish_label_stmt): Add a LABEL_STMT when
      	building_stmt_tree.
      	(finish_label_decl): New function.
      	(expand_stmt): Handle LABEL_STMTs and local label declarations.
      
      From-SVN: r28943
      Mark Mitchell committed