summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-09-04 22:48:11 +0000
committerDouglas Gregor <dgregor@apple.com>2009-09-04 22:48:11 +0000
commit34ec2ef159c0d712ee66364228bd16dbe7f5e390 (patch)
tree88a51c59692b5c83131f813645f2a995ed4933c9 /clang/lib/CodeGen/CodeGenModule.cpp
parent21d15aa591e142396aad3b79569f0aa8ce6f66e3 (diff)
downloadbcm5719-llvm-34ec2ef159c0d712ee66364228bd16dbe7f5e390.tar.gz
bcm5719-llvm-34ec2ef159c0d712ee66364228bd16dbe7f5e390.zip
Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation declaration and an explicit instantiation definition, and know not to instantiate explicit instantiation declarations. Unfortunately, there is some remaining confusion w.r.t. instantiation of out-of-line member function definitions that causes trouble here. llvm-svn: 81053
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index cde6e89d66f..180a68659d5 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -250,9 +250,8 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD,
// The kind of external linkage this function will have, if it is not
// inline or static.
CodeGenModule::GVALinkage External = CodeGenModule::GVA_StrongExternal;
- if (Context.getLangOptions().CPlusPlus &&
- (FD->getPrimaryTemplate() || FD->getInstantiatedFromMemberFunction()) &&
- !FD->isExplicitSpecialization())
+ if (Context.getLangOptions().CPlusPlus &&
+ FD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation)
External = CodeGenModule::GVA_TemplateInstantiation;
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) {
OpenPOWER on IntegriCloud