summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-03-23 18:56:16 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-03-23 18:56:16 +0000
commit4d3745ade6baba16b7cec50c22ca41ce78f488ea (patch)
treeb0dbf475f6335e0a10777965a07aaf28ee22dbd1 /clang/lib/CodeGen/CodeGenModule.cpp
parent59f75bba24cfa305f9829129cd3f1a7e91901b68 (diff)
downloadbcm5719-llvm-4d3745ade6baba16b7cec50c22ca41ce78f488ea.tar.gz
bcm5719-llvm-4d3745ade6baba16b7cec50c22ca41ce78f488ea.zip
Avoid producing implicit methods when we have a explicit template instantiation
declaration. llvm-svn: 99311
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 1606710bc5c..69ce49cbb18 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud