From 540801735664c5d5d6821717847bbb3afe939e06 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 25 Aug 2010 08:44:16 +0000 Subject: [PATCH] Rename *PendingImplicitInstantiations to *PendingInstantiations. No functionality changed. llvm-svn: 112040 --- clang/include/clang/Sema/Sema.h | 4 +-- clang/include/clang/Serialization/ASTReader.h | 2 +- clang/lib/Sema/Sema.cpp | 2 +- clang/lib/Sema/SemaExpr.cpp | 5 ++-- .../lib/Sema/SemaTemplateInstantiateDecl.cpp | 30 +++++++++---------- clang/lib/Serialization/ASTReader.cpp | 19 ++++++------ clang/lib/Serialization/ASTWriter.cpp | 30 +++++++++---------- 7 files changed, 44 insertions(+), 48 deletions(-) diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 01c5a41b428b..4505171a752b 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -3558,7 +3558,7 @@ public: /// \brief The queue of implicit template instantiations that are required /// but have not yet been performed. - std::deque PendingImplicitInstantiations; + std::deque PendingInstantiations; /// \brief The queue of implicit template instantiations that are required /// and must be performed within the current local scope. @@ -3569,7 +3569,7 @@ public: /// types, static variables, enumerators, etc. std::deque PendingLocalImplicitInstantiations; - void PerformPendingImplicitInstantiations(bool LocalOnly = false); + void PerformPendingInstantiations(bool LocalOnly = false); TypeSourceInfo *SubstType(TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h index 7ce923181422..94a77778d289 100644 --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -472,7 +472,7 @@ private: /// of the TU. It consists of a pair of values for every pending instantiation /// where the first value is the ID of the decl and the second is the /// instantiation location. - llvm::SmallVector PendingImplicitInstantiations; + llvm::SmallVector PendingInstantiations; /// \brief The IDs of all dynamic class declarations in the chain. /// diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 2320d7dc3234..6143492ea763 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -300,7 +300,7 @@ void Sema::ActOnEndOfTranslationUnit() { // common behavior for C++ compilers, it is technically wrong. In the // future, we either need to be able to filter the results of name lookup // or we need to perform template instantiations earlier. - PerformPendingImplicitInstantiations(); + PerformPendingInstantiations(); /// If DefinedUsedVTables ends up marking any virtual member /// functions it might lead to more pending template diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 5986eca37372..197c44dfa475 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -7678,8 +7678,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { PendingLocalImplicitInstantiations.push_back(std::make_pair(Function, Loc)); else - PendingImplicitInstantiations.push_back(std::make_pair(Function, - Loc)); + PendingInstantiations.push_back(std::make_pair(Function, Loc)); } } @@ -7698,7 +7697,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { if (MSInfo->getPointOfInstantiation().isInvalid() && MSInfo->getTemplateSpecializationKind()== TSK_ImplicitInstantiation) { MSInfo->setPointOfInstantiation(Loc); - PendingImplicitInstantiations.push_back(std::make_pair(Var, Loc)); + PendingInstantiations.push_back(std::make_pair(Var, Loc)); } } diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index dd82114f2b03..db216f3c568e 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2042,7 +2042,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, Function->setInvalidDecl(); } else if (Function->getTemplateSpecializationKind() == TSK_ExplicitInstantiationDefinition) { - PendingImplicitInstantiations.push_back( + PendingInstantiations.push_back( std::make_pair(Function, PointOfInstantiation)); } @@ -2065,9 +2065,9 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, // If we're performing recursive template instantiation, create our own // queue of pending implicit instantiations that we will instantiate later, // while we're still within our own instantiation context. - std::deque SavedPendingImplicitInstantiations; + std::deque SavedPendingInstantiations; if (Recursive) - PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations); + PendingInstantiations.swap(SavedPendingInstantiations); EnterExpressionEvaluationContext EvalContext(*this, Action::PotentiallyEvaluated); @@ -2126,16 +2126,16 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, // This class may have local implicit instantiations that need to be // instantiation within this scope. - PerformPendingImplicitInstantiations(/*LocalOnly=*/true); + PerformPendingInstantiations(/*LocalOnly=*/true); Scope.Exit(); if (Recursive) { // Instantiate any pending implicit instantiations found during the // instantiation of this template. - PerformPendingImplicitInstantiations(); + PerformPendingInstantiations(); // Restore the set of pending implicit instantiations. - PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations); + PendingInstantiations.swap(SavedPendingInstantiations); } } @@ -2182,7 +2182,7 @@ void Sema::InstantiateStaticDataMemberDefinition( Diag(Def->getLocation(), diag::note_explicit_instantiation_here); } else if (Var->getTemplateSpecializationKind() == TSK_ExplicitInstantiationDefinition) { - PendingImplicitInstantiations.push_back( + PendingInstantiations.push_back( std::make_pair(Var, PointOfInstantiation)); } @@ -2208,9 +2208,9 @@ void Sema::InstantiateStaticDataMemberDefinition( // If we're performing recursive template instantiation, create our own // queue of pending implicit instantiations that we will instantiate later, // while we're still within our own instantiation context. - std::deque SavedPendingImplicitInstantiations; + std::deque SavedPendingInstantiations; if (Recursive) - PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations); + PendingInstantiations.swap(SavedPendingInstantiations); // Enter the scope of this instantiation. We don't use // PushDeclContext because we don't have a scope. @@ -2234,10 +2234,10 @@ void Sema::InstantiateStaticDataMemberDefinition( if (Recursive) { // Instantiate any pending implicit instantiations found during the // instantiation of this template. - PerformPendingImplicitInstantiations(); + PerformPendingInstantiations(); // Restore the set of pending implicit instantiations. - PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations); + PendingInstantiations.swap(SavedPendingInstantiations); } } @@ -2703,14 +2703,14 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, /// \brief Performs template instantiation for all implicit template /// instantiations we have seen until this point. -void Sema::PerformPendingImplicitInstantiations(bool LocalOnly) { +void Sema::PerformPendingInstantiations(bool LocalOnly) { while (!PendingLocalImplicitInstantiations.empty() || - (!LocalOnly && !PendingImplicitInstantiations.empty())) { + (!LocalOnly && !PendingInstantiations.empty())) { PendingImplicitInstantiation Inst; if (PendingLocalImplicitInstantiations.empty()) { - Inst = PendingImplicitInstantiations.front(); - PendingImplicitInstantiations.pop_front(); + Inst = PendingInstantiations.front(); + PendingInstantiations.pop_front(); } else { Inst = PendingLocalImplicitInstantiations.front(); PendingLocalImplicitInstantiations.pop_front(); diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index abe9b16a1a6f..f07215cb8f51 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1927,11 +1927,11 @@ ASTReader::ReadASTBlock(PerFileData &F) { case PENDING_IMPLICIT_INSTANTIATIONS: // Optimization for the first block. - if (PendingImplicitInstantiations.empty()) - PendingImplicitInstantiations.swap(Record); + if (PendingInstantiations.empty()) + PendingInstantiations.swap(Record); else - PendingImplicitInstantiations.insert( - PendingImplicitInstantiations.end(), Record.begin(), Record.end()); + PendingInstantiations.insert(PendingInstantiations.end(), + Record.begin(), Record.end()); break; case SEMA_DECL_REFS: @@ -3430,12 +3430,11 @@ void ASTReader::InitializeSema(Sema &S) { // If there were any pending implicit instantiations, deserialize them // and add them to Sema's queue of such instantiations. - assert(PendingImplicitInstantiations.size() % 2 == 0 && - "Expected pairs of entries"); - for (unsigned Idx = 0, N = PendingImplicitInstantiations.size(); Idx < N;) { - ValueDecl *D=cast(GetDecl(PendingImplicitInstantiations[Idx++])); - SourceLocation Loc = ReadSourceLocation(PendingImplicitInstantiations, Idx); - SemaObj->PendingImplicitInstantiations.push_back(std::make_pair(D, Loc)); + assert(PendingInstantiations.size() % 2 == 0 && "Expected pairs of entries"); + for (unsigned Idx = 0, N = PendingInstantiations.size(); Idx < N;) { + ValueDecl *D=cast(GetDecl(PendingInstantiations[Idx++])); + SourceLocation Loc = ReadSourceLocation(PendingInstantiations, Idx); + SemaObj->PendingInstantiations.push_back(std::make_pair(D, Loc)); } // Load the offsets of the declarations that Sema references. diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index cefa87bc9651..efc7da7f282a 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2301,12 +2301,12 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, AddDeclRef(SemaRef.DynamicClasses[I], DynamicClasses); // Build a record containing all of pending implicit instantiations. - RecordData PendingImplicitInstantiations; + RecordData PendingInstantiations; for (std::deque::iterator - I = SemaRef.PendingImplicitInstantiations.begin(), - N = SemaRef.PendingImplicitInstantiations.end(); I != N; ++I) { - AddDeclRef(I->first, PendingImplicitInstantiations); - AddSourceLocation(I->second, PendingImplicitInstantiations); + I = SemaRef.PendingInstantiations.begin(), + N = SemaRef.PendingInstantiations.end(); I != N; ++I) { + AddDeclRef(I->first, PendingInstantiations); + AddSourceLocation(I->second, PendingInstantiations); } assert(SemaRef.PendingLocalImplicitInstantiations.empty() && "There are local ones at end of translation unit!"); @@ -2404,9 +2404,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses); // Write the record containing pending implicit instantiations. - if (!PendingImplicitInstantiations.empty()) - Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, - PendingImplicitInstantiations); + if (!PendingInstantiations.empty()) + Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations); // Write the record containing declaration references of Sema. if (!SemaDeclRefs.empty()) @@ -2553,13 +2552,13 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls, AddDeclRef(SemaRef.DynamicClasses[I], DynamicClasses); // Build a record containing all of pending implicit instantiations. - RecordData PendingImplicitInstantiations; + RecordData PendingInstantiations; for (std::deque::iterator - I = SemaRef.PendingImplicitInstantiations.begin(), - N = SemaRef.PendingImplicitInstantiations.end(); I != N; ++I) { + I = SemaRef.PendingInstantiations.begin(), + N = SemaRef.PendingInstantiations.end(); I != N; ++I) { if (I->first->getPCHLevel() == 0) { - AddDeclRef(I->first, PendingImplicitInstantiations); - AddSourceLocation(I->second, PendingImplicitInstantiations); + AddDeclRef(I->first, PendingInstantiations); + AddSourceLocation(I->second, PendingInstantiations); } } assert(SemaRef.PendingLocalImplicitInstantiations.empty() && @@ -2639,9 +2638,8 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls, Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses); // Write the record containing pending implicit instantiations. - if (!PendingImplicitInstantiations.empty()) - Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, - PendingImplicitInstantiations); + if (!PendingInstantiations.empty()) + Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations); // Write the record containing declaration references of Sema. if (!SemaDeclRefs.empty())