forked from OSchip/llvm-project
Read/write function template specializations for PCH, properly this time.
llvm-svn: 107665
This commit is contained in:
parent
af2eac2869
commit
39fdf81b43
|
@ -977,9 +977,12 @@ void PCHDeclReader::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
|
|||
if (PrevDecl == 0) {
|
||||
// This FunctionTemplateDecl owns a CommonPtr; read it.
|
||||
|
||||
// FunctionTemplateSpecializationInfos are filled through the
|
||||
// templated FunctionDecl's setFunctionTemplateSpecialization, no need to
|
||||
// read them here.
|
||||
// Read the function specialization declarations.
|
||||
// FunctionTemplateDecl's FunctionTemplateSpecializationInfos are filled
|
||||
// through the specialized FunctionDecl's setFunctionTemplateSpecialization.
|
||||
unsigned NumSpecs = Record[Idx++];
|
||||
while (NumSpecs--)
|
||||
Reader.GetDecl(Record[Idx++]);
|
||||
|
||||
if (FunctionTemplateDecl *CTD
|
||||
= cast_or_null<FunctionTemplateDecl>(Reader.GetDecl(Record[Idx++]))) {
|
||||
|
|
|
@ -923,9 +923,12 @@ void PCHDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
|
|||
if (D->getPreviousDeclaration() == 0) {
|
||||
// This FunctionTemplateDecl owns the CommonPtr; write it.
|
||||
|
||||
// FunctionTemplateSpecializationInfos are filled through the
|
||||
// templated FunctionDecl's setFunctionTemplateSpecialization, no need to
|
||||
// write them here.
|
||||
// Write the function specialization declarations.
|
||||
Record.push_back(D->getSpecializations().size());
|
||||
for (llvm::FoldingSet<FunctionTemplateSpecializationInfo>::iterator
|
||||
I = D->getSpecializations().begin(),
|
||||
E = D->getSpecializations().end() ; I != E; ++I)
|
||||
Writer.AddDeclRef(I->Function, Record);
|
||||
|
||||
Writer.AddDeclRef(D->getInstantiatedFromMemberTemplate(), Record);
|
||||
if (D->getInstantiatedFromMemberTemplate())
|
||||
|
|
Loading…
Reference in New Issue