[all-commits] [llvm/llvm-project] 729530: -fmodules-codegen should not emit extern templates
Luboš Luňák via All-commits
all-commits at lists.llvm.org
Tue Jan 14 14:40:10 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 729530f68fe135ad41d470fbed019cc5e31ac8a5
https://github.com/llvm/llvm-project/commit/729530f68fe135ad41d470fbed019cc5e31ac8a5
Author: Luboš Luňák <l.lunak at centrum.cz>
Date: 2020-01-14 (Tue, 14 Jan 2020)
Changed paths:
M clang/lib/Serialization/ASTWriterDecl.cpp
A clang/test/Modules/codegen-extern-template.cpp
A clang/test/Modules/codegen-extern-template.h
A clang/test/Modules/codegen-extern-template.modulemap
Log Message:
-----------
-fmodules-codegen should not emit extern templates
If a header contains 'extern template', then the template should be provided
somewhere by an explicit instantiation, so it is not necessary to generate
a copy. Worse, this can lead to an unresolved symbol, because the codegen's
object file will not actually contain functions from such a template
because of the GVA_AvailableExternally, but the object file for the explicit
instantiation will not contain them either because it will be blocked
by the information provided by the module.
Differential Revision: https://reviews.llvm.org/D69779
More information about the All-commits
mailing list