From 171d8e43ddeb0e5470e9f2d535c98191e5e20343 Mon Sep 17 00:00:00 2001 From: Richard Smith <richard-llvm@metafoo.co.uk> Date: Fri, 23 May 2014 21:31:59 +0000 Subject: [PATCH] Recompute the injected class name type for a class template specialization rather than saving and restoring it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209557 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTReaderDecl.cpp | 4 +--- lib/Serialization/ASTWriterDecl.cpp | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 0c6d858bf54..8a0849cb909 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -1646,8 +1646,6 @@ void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) { memcpy(CommonPtr->LazySpecializations, SpecIDs.data(), SpecIDs.size() * sizeof(DeclID)); } - - CommonPtr->InjectedClassNameType = Reader.readType(F, Record, Idx); } if (D->getTemplatedDecl()->TemplateOrInstantiation) { @@ -1655,7 +1653,7 @@ void ASTDeclReader::VisitClassTemplateDecl(ClassTemplateDecl *D) { // its corresponding type yet (see VisitCXXRecordDeclImpl), so reconstruct // it now. Reader.Context.getInjectedClassNameType( - D->getTemplatedDecl(), D->getCommonPtr()->InjectedClassNameType); + D->getTemplatedDecl(), D->getInjectedClassNameSpecialization()); } } diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index c6e42d4d315..347473c77d9 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -1156,8 +1156,6 @@ void ASTDeclWriter::VisitClassTemplateDecl(ClassTemplateDecl *D) { assert(I->isCanonicalDecl() && "Expected only canonical decls in set"); Writer.AddDeclRef(&*I, Record); } - - Writer.AddTypeRef(D->getCommonPtr()->InjectedClassNameType, Record); } Code = serialization::DECL_CLASS_TEMPLATE; } -- GitLab