]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-common.h (lang_post_pch_load): New variable.
authorMark Mitchell <mark@codesourcery.com>
Thu, 29 Jul 2004 17:59:31 +0000 (17:59 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 29 Jul 2004 17:59:31 +0000 (17:59 +0000)
commit4684cd27fc05d4b4b14401c639fe4427a3bbbe3e
treebd18935ca8aaabc7e84771ece8e457e583cfbf6c
parentb4042a039f664fe6e2cedc49cb74a65c159756fe
c-common.h (lang_post_pch_load): New variable.

* c-common.h (lang_post_pch_load): New variable.
* c-pch.c (lang_post_pch_load): Define it.
(c_common_read_pch): Use it.
* cgraphunit.c (record_call_1): Give the front end a chance to
record additional needed entities when a variable is marked as
needed.
* tlink.c (recompile_files): Robustify.
(scan_linker_output): If a symbol is assigned to a file,
but after recompilation is not present there, issue an error
message.

* cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
(lang_decl_flags): Narrow the width of "languages".  Add
repo_available_p.
(DECL_NEEDED_P): Remove.
(FOR_EACH_CLONE): New macro.
(DECL_REPO_AVAILABLE_P): Likewise.
(DECL_TINFO_P): Likewise.
(set_linkage_according_to_type): Declare.
(import_export_vtable): Remove.
(import_export_tinfo): Likewise.
(mark_needed): New function.
(decl_needed_p): Likewise.
(note_vauge_linkage_fn): Likewise.
(init_repo): Change prototype.
(repo_template_used): Remove.
(repo_template_instantiated): Likewise.
(repo_emit_p): New function.
(repo_export_class_p): Likewise.
(no_linkage_check): Change prototype.
* class.c (set_linkage_according_to_type): New function.
(build_vtable): Use it.  Do not call import_export_vtable.  Set
DECL_IGNORED_P if appropriate.
* decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
(make_rtL_for_nonlocal_decls): Check for template instantiations
explicitly.
(grokfndecl): Adjust call to no_linkage_check.
(set_linkage_for_static_data_member): New function.
(grokvardecl): Use it.  Adjust call to no_linkage_check.
(grokdeclarator): Use set_linkage_for_static_data_member.
* decl2.c (note_vague_linkage_fn): New function.
(note_vague_linkage_var): Likewise.
(finish_static_data_member_decl): Use it.
(import_export_vtable): Remove.
(import_export_class): Use repo_export_class_p.
(var_finalized_p): Simplify.
(maybe_emit_vtables): Simplify.
(mark_needed): New function.
(decl_needed_p): Likewise.
(import_export_decl): Add documentation and consistency checks.
Use repo_emit_p.  Handle virtual tables and RTTI information
here.
(import_export_tinfo): Remove.
(write_out_vars): Call import_export_decl.
(cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
whenever one is.
(finish_file): Use decl_needed_p.  Do not call import_export_decl
for undefined static data members.  Do not warn about undefined
inlines when using a repository.
(mark_used): Use note_vague_linkage_fn.  Always defer template
instantiations.
* lex.c (cxx_init): Adjust call to init_repo.  Always set
flag_unit_at_a-time.
* method.c (synthesize_method): Remove unncessary
import_export_decl call.
(implicitly_declare_fn): Use set_linkage_according_to_type.
* optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
* pt.c (instantiate_class_template): Don't redundantly add classes
to keyed_classes.  Don't call repo_template_used.
(tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
templates with internal linkage.
(check_instantiated_args): Adjust call to no_linkage_check.
(instantiate_template): Use FOR_EACH_CLONE.
(mark_definable): New function.
(mark_decl_instantiated): Use it.
(do_decl_instantiation): Adjust tests for explicit instantiation
after "extern template".
(instantiate_class_member): Do not use repo_template_instantiated.
(do_type_instantiation): Simplify.
(instantiate_decl): Use mark_definable.  Check repo_emit_p.
Simplify.
* repo.c (repo_get_id): Remove.
(original_repo): Remove.
(IDENTIFIER_REPO_USED): Remove.
(IDENTIFIER_REPO_CHOSEN): Remove.
Remove all #if 0'd code.
(repo_template_used): Remove.
(repo_template_instantiated): Remove.
(temporary_obstack_initialized_p): New variable.
(init_repo): Register with lang_post_pch_load.  Avoid creating
identifiers unnecessarily.  Don't use original_repo.  Close the
file here.
(reopen_repo_file_for_write): Not here.
(finish_repo): Always write out a new repository file.
(repo_emit_p): New function.
(repo_export_class_p): Likewise.
* rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
(involves_incomplete_p): New function.
(tinfo_base_init): Use it.
(ptr_initializer): Remove non_public_ptr parameter.
(ptm_initializer): Likewise.
(get_pseudo_ti_init): Likewise.
(unemitted_tinfo_decl_p): Remove.
(emit_tinfo_decl): Use import_export_decl.
* semantics.c (expand_body): Move updates of static_ctors and
static_dtors to ...
(expand_or_defer_fn): ... here.
* tree.c (no_linkage_check): Add relaxed_p parameter.

* g++.dg/abi/inline1.C: New test.
* g++.dg/abi/local1-a.cc: Likewise.
* g++.dg/abi/local1.C: Likewise.
* g++.dg/abi/mangle11.C: Tweak location of warnings.
* g++.dg/abi/mangle12.C: Likewise.
* g++.dg/abi/mangle17.C: Likewise.
* g++.dg/abi/mangle20-2.C: Likewise.
* g++.dg/opt/interface1.C: Likewise.
* g++.dg/opt/interface1.h: Likewise.
* g++.dg/opt/interface1-a.cc: New test.
* g++.dg/parse/repo1.C: New test.
* g++.dg/template/repo1.C: Likewise.
* g++.dg/warn/Winline-1.C: Likewise.
* lib/gcc-dg.exp (gcc-dg-test-1): Fix -frepo handling.

From-SVN: r85309
33 files changed:
gcc/ChangeLog
gcc/c-common.h
gcc/c-pch.c
gcc/cgraphunit.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/lex.c
gcc/cp/method.c
gcc/cp/optimize.c
gcc/cp/pt.c
gcc/cp/repo.c
gcc/cp/rtti.c
gcc/cp/semantics.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/inline1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/local1-a.cc [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/local1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/mangle11.C
gcc/testsuite/g++.dg/abi/mangle12.C
gcc/testsuite/g++.dg/abi/mangle17.C
gcc/testsuite/g++.dg/abi/mangle20-2.C
gcc/testsuite/g++.dg/opt/interface1-a.cc [new file with mode: 0644]
gcc/testsuite/g++.dg/opt/interface1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/opt/interface1.h [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/repo1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/repo1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Winline-1.C
gcc/testsuite/lib/gcc-dg.exp
gcc/tlink.c