diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-23 18:56:16 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-23 18:56:16 +0000 |
commit | 5fb12c6c8f64d4b69f65faefb7d0800d7e4bca66 (patch) | |
tree | d83e15531a5c7e44cebe5a1303a9d1110e3ecf42 /lib/CodeGen/CodeGenModule.cpp | |
parent | 707ea283f5514e2cb633a89f702190f0d798c7ea (diff) |
Avoid producing implicit methods when we have a explicit template instantiation
declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 1606710bc5..69ce49cbb1 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -310,8 +310,17 @@ GetLinkageForFunction(ASTContext &Context, const FunctionDecl *FD, // instantiated when used so that the body can be considered for // inlining, but that no out-of-line copy of the inline function would be // generated in the translation unit. -- end note ] - if (FD->getTemplateSpecializationKind() - == TSK_ExplicitInstantiationDeclaration) + + // We check the specialization kind of the class for implicit methods. + // They have a TSK_Undeclared specialization kind. + TemplateSpecializationKind TSK; + const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD); + if (MD && MD->isImplicit()) + TSK = MD->getParent()->getTemplateSpecializationKind(); + else + TSK = FD->getTemplateSpecializationKind(); + + if (TSK == TSK_ExplicitInstantiationDeclaration) return CodeGenModule::GVA_C99Inline; return CodeGenModule::GVA_CXXInline; |