diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-11-03 01:26:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-11-03 01:26:01 +0000 |
commit | e124612eda3561d10fa5749583e0fabf813e2c82 (patch) | |
tree | 3eae4debaf829e3309f9f805e89d2f1a70d5fb8a /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 9196ed1be11f3c15cf58f6a3ef1b9b73f8722075 (diff) | |
download | bcm5719-llvm-e124612eda3561d10fa5749583e0fabf813e2c82.tar.gz bcm5719-llvm-e124612eda3561d10fa5749583e0fabf813e2c82.zip |
[c++17] Visit class template explicit specializations just like all other class definitions in codegen.
If an explicit specialization has a static data member, it may be a definition and we may need to register it for emission.
llvm-svn: 317296
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b2a18a03f29..b1550170acc 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4030,6 +4030,13 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::Namespace: EmitDeclContext(cast<NamespaceDecl>(D)); break; + case Decl::ClassTemplateSpecialization: { + const auto *Spec = cast<ClassTemplateSpecializationDecl>(D); + if (DebugInfo && + Spec->getSpecializationKind() == TSK_ExplicitInstantiationDefinition && + Spec->hasDefinition()) + DebugInfo->completeTemplateDefinition(*Spec); + } LLVM_FALLTHROUGH; case Decl::CXXRecord: if (DebugInfo) { if (auto *ES = D->getASTContext().getExternalSource()) @@ -4216,15 +4223,6 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { EmitOMPThreadPrivateDecl(cast<OMPThreadPrivateDecl>(D)); break; - case Decl::ClassTemplateSpecialization: { - const auto *Spec = cast<ClassTemplateSpecializationDecl>(D); - if (DebugInfo && - Spec->getSpecializationKind() == TSK_ExplicitInstantiationDefinition && - Spec->hasDefinition()) - DebugInfo->completeTemplateDefinition(*Spec); - break; - } - case Decl::OMPDeclareReduction: EmitOMPDeclareReduction(cast<OMPDeclareReductionDecl>(D)); break; |