Skip to content

Commit 5408017

Browse files
committed
Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed. llvm-svn: 112040
1 parent 7a0d8c6 commit 5408017

File tree

7 files changed

+44
-48
lines changed

7 files changed

+44
-48
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,7 +3558,7 @@ class Sema : public Action {
35583558

35593559
/// \brief The queue of implicit template instantiations that are required
35603560
/// but have not yet been performed.
3561-
std::deque<PendingImplicitInstantiation> PendingImplicitInstantiations;
3561+
std::deque<PendingImplicitInstantiation> PendingInstantiations;
35623562

35633563
/// \brief The queue of implicit template instantiations that are required
35643564
/// and must be performed within the current local scope.
@@ -3569,7 +3569,7 @@ class Sema : public Action {
35693569
/// types, static variables, enumerators, etc.
35703570
std::deque<PendingImplicitInstantiation> PendingLocalImplicitInstantiations;
35713571

3572-
void PerformPendingImplicitInstantiations(bool LocalOnly = false);
3572+
void PerformPendingInstantiations(bool LocalOnly = false);
35733573

35743574
TypeSourceInfo *SubstType(TypeSourceInfo *T,
35753575
const MultiLevelTemplateArgumentList &TemplateArgs,

clang/include/clang/Serialization/ASTReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ class ASTReader
472472
/// of the TU. It consists of a pair of values for every pending instantiation
473473
/// where the first value is the ID of the decl and the second is the
474474
/// instantiation location.
475-
llvm::SmallVector<uint64_t, 64> PendingImplicitInstantiations;
475+
llvm::SmallVector<uint64_t, 64> PendingInstantiations;
476476

477477
/// \brief The IDs of all dynamic class declarations in the chain.
478478
///

clang/lib/Sema/Sema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void Sema::ActOnEndOfTranslationUnit() {
300300
// common behavior for C++ compilers, it is technically wrong. In the
301301
// future, we either need to be able to filter the results of name lookup
302302
// or we need to perform template instantiations earlier.
303-
PerformPendingImplicitInstantiations();
303+
PerformPendingInstantiations();
304304

305305
/// If DefinedUsedVTables ends up marking any virtual member
306306
/// functions it might lead to more pending template

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7678,8 +7678,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
76787678
PendingLocalImplicitInstantiations.push_back(std::make_pair(Function,
76797679
Loc));
76807680
else
7681-
PendingImplicitInstantiations.push_back(std::make_pair(Function,
7682-
Loc));
7681+
PendingInstantiations.push_back(std::make_pair(Function, Loc));
76837682
}
76847683
}
76857684

@@ -7698,7 +7697,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
76987697
if (MSInfo->getPointOfInstantiation().isInvalid() &&
76997698
MSInfo->getTemplateSpecializationKind()== TSK_ImplicitInstantiation) {
77007699
MSInfo->setPointOfInstantiation(Loc);
7701-
PendingImplicitInstantiations.push_back(std::make_pair(Var, Loc));
7700+
PendingInstantiations.push_back(std::make_pair(Var, Loc));
77027701
}
77037702
}
77047703

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
20422042
Function->setInvalidDecl();
20432043
} else if (Function->getTemplateSpecializationKind()
20442044
== TSK_ExplicitInstantiationDefinition) {
2045-
PendingImplicitInstantiations.push_back(
2045+
PendingInstantiations.push_back(
20462046
std::make_pair(Function, PointOfInstantiation));
20472047
}
20482048

@@ -2065,9 +2065,9 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
20652065
// If we're performing recursive template instantiation, create our own
20662066
// queue of pending implicit instantiations that we will instantiate later,
20672067
// while we're still within our own instantiation context.
2068-
std::deque<PendingImplicitInstantiation> SavedPendingImplicitInstantiations;
2068+
std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
20692069
if (Recursive)
2070-
PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations);
2070+
PendingInstantiations.swap(SavedPendingInstantiations);
20712071

20722072
EnterExpressionEvaluationContext EvalContext(*this,
20732073
Action::PotentiallyEvaluated);
@@ -2126,16 +2126,16 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
21262126

21272127
// This class may have local implicit instantiations that need to be
21282128
// instantiation within this scope.
2129-
PerformPendingImplicitInstantiations(/*LocalOnly=*/true);
2129+
PerformPendingInstantiations(/*LocalOnly=*/true);
21302130
Scope.Exit();
21312131

21322132
if (Recursive) {
21332133
// Instantiate any pending implicit instantiations found during the
21342134
// instantiation of this template.
2135-
PerformPendingImplicitInstantiations();
2135+
PerformPendingInstantiations();
21362136

21372137
// Restore the set of pending implicit instantiations.
2138-
PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations);
2138+
PendingInstantiations.swap(SavedPendingInstantiations);
21392139
}
21402140
}
21412141

@@ -2182,7 +2182,7 @@ void Sema::InstantiateStaticDataMemberDefinition(
21822182
Diag(Def->getLocation(), diag::note_explicit_instantiation_here);
21832183
} else if (Var->getTemplateSpecializationKind()
21842184
== TSK_ExplicitInstantiationDefinition) {
2185-
PendingImplicitInstantiations.push_back(
2185+
PendingInstantiations.push_back(
21862186
std::make_pair(Var, PointOfInstantiation));
21872187
}
21882188

@@ -2208,9 +2208,9 @@ void Sema::InstantiateStaticDataMemberDefinition(
22082208
// If we're performing recursive template instantiation, create our own
22092209
// queue of pending implicit instantiations that we will instantiate later,
22102210
// while we're still within our own instantiation context.
2211-
std::deque<PendingImplicitInstantiation> SavedPendingImplicitInstantiations;
2211+
std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
22122212
if (Recursive)
2213-
PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations);
2213+
PendingInstantiations.swap(SavedPendingInstantiations);
22142214

22152215
// Enter the scope of this instantiation. We don't use
22162216
// PushDeclContext because we don't have a scope.
@@ -2234,10 +2234,10 @@ void Sema::InstantiateStaticDataMemberDefinition(
22342234
if (Recursive) {
22352235
// Instantiate any pending implicit instantiations found during the
22362236
// instantiation of this template.
2237-
PerformPendingImplicitInstantiations();
2237+
PerformPendingInstantiations();
22382238

22392239
// Restore the set of pending implicit instantiations.
2240-
PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations);
2240+
PendingInstantiations.swap(SavedPendingInstantiations);
22412241
}
22422242
}
22432243

@@ -2703,14 +2703,14 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
27032703

27042704
/// \brief Performs template instantiation for all implicit template
27052705
/// instantiations we have seen until this point.
2706-
void Sema::PerformPendingImplicitInstantiations(bool LocalOnly) {
2706+
void Sema::PerformPendingInstantiations(bool LocalOnly) {
27072707
while (!PendingLocalImplicitInstantiations.empty() ||
2708-
(!LocalOnly && !PendingImplicitInstantiations.empty())) {
2708+
(!LocalOnly && !PendingInstantiations.empty())) {
27092709
PendingImplicitInstantiation Inst;
27102710

27112711
if (PendingLocalImplicitInstantiations.empty()) {
2712-
Inst = PendingImplicitInstantiations.front();
2713-
PendingImplicitInstantiations.pop_front();
2712+
Inst = PendingInstantiations.front();
2713+
PendingInstantiations.pop_front();
27142714
} else {
27152715
Inst = PendingLocalImplicitInstantiations.front();
27162716
PendingLocalImplicitInstantiations.pop_front();

clang/lib/Serialization/ASTReader.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,11 +1927,11 @@ ASTReader::ReadASTBlock(PerFileData &F) {
19271927

19281928
case PENDING_IMPLICIT_INSTANTIATIONS:
19291929
// Optimization for the first block.
1930-
if (PendingImplicitInstantiations.empty())
1931-
PendingImplicitInstantiations.swap(Record);
1930+
if (PendingInstantiations.empty())
1931+
PendingInstantiations.swap(Record);
19321932
else
1933-
PendingImplicitInstantiations.insert(
1934-
PendingImplicitInstantiations.end(), Record.begin(), Record.end());
1933+
PendingInstantiations.insert(PendingInstantiations.end(),
1934+
Record.begin(), Record.end());
19351935
break;
19361936

19371937
case SEMA_DECL_REFS:
@@ -3430,12 +3430,11 @@ void ASTReader::InitializeSema(Sema &S) {
34303430

34313431
// If there were any pending implicit instantiations, deserialize them
34323432
// and add them to Sema's queue of such instantiations.
3433-
assert(PendingImplicitInstantiations.size() % 2 == 0 &&
3434-
"Expected pairs of entries");
3435-
for (unsigned Idx = 0, N = PendingImplicitInstantiations.size(); Idx < N;) {
3436-
ValueDecl *D=cast<ValueDecl>(GetDecl(PendingImplicitInstantiations[Idx++]));
3437-
SourceLocation Loc = ReadSourceLocation(PendingImplicitInstantiations, Idx);
3438-
SemaObj->PendingImplicitInstantiations.push_back(std::make_pair(D, Loc));
3433+
assert(PendingInstantiations.size() % 2 == 0 && "Expected pairs of entries");
3434+
for (unsigned Idx = 0, N = PendingInstantiations.size(); Idx < N;) {
3435+
ValueDecl *D=cast<ValueDecl>(GetDecl(PendingInstantiations[Idx++]));
3436+
SourceLocation Loc = ReadSourceLocation(PendingInstantiations, Idx);
3437+
SemaObj->PendingInstantiations.push_back(std::make_pair(D, Loc));
34393438
}
34403439

34413440
// Load the offsets of the declarations that Sema references.

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,12 +2301,12 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
23012301
AddDeclRef(SemaRef.DynamicClasses[I], DynamicClasses);
23022302

23032303
// Build a record containing all of pending implicit instantiations.
2304-
RecordData PendingImplicitInstantiations;
2304+
RecordData PendingInstantiations;
23052305
for (std::deque<Sema::PendingImplicitInstantiation>::iterator
2306-
I = SemaRef.PendingImplicitInstantiations.begin(),
2307-
N = SemaRef.PendingImplicitInstantiations.end(); I != N; ++I) {
2308-
AddDeclRef(I->first, PendingImplicitInstantiations);
2309-
AddSourceLocation(I->second, PendingImplicitInstantiations);
2306+
I = SemaRef.PendingInstantiations.begin(),
2307+
N = SemaRef.PendingInstantiations.end(); I != N; ++I) {
2308+
AddDeclRef(I->first, PendingInstantiations);
2309+
AddSourceLocation(I->second, PendingInstantiations);
23102310
}
23112311
assert(SemaRef.PendingLocalImplicitInstantiations.empty() &&
23122312
"There are local ones at end of translation unit!");
@@ -2404,9 +2404,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
24042404
Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses);
24052405

24062406
// Write the record containing pending implicit instantiations.
2407-
if (!PendingImplicitInstantiations.empty())
2408-
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS,
2409-
PendingImplicitInstantiations);
2407+
if (!PendingInstantiations.empty())
2408+
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations);
24102409

24112410
// Write the record containing declaration references of Sema.
24122411
if (!SemaDeclRefs.empty())
@@ -2553,13 +2552,13 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
25532552
AddDeclRef(SemaRef.DynamicClasses[I], DynamicClasses);
25542553

25552554
// Build a record containing all of pending implicit instantiations.
2556-
RecordData PendingImplicitInstantiations;
2555+
RecordData PendingInstantiations;
25572556
for (std::deque<Sema::PendingImplicitInstantiation>::iterator
2558-
I = SemaRef.PendingImplicitInstantiations.begin(),
2559-
N = SemaRef.PendingImplicitInstantiations.end(); I != N; ++I) {
2557+
I = SemaRef.PendingInstantiations.begin(),
2558+
N = SemaRef.PendingInstantiations.end(); I != N; ++I) {
25602559
if (I->first->getPCHLevel() == 0) {
2561-
AddDeclRef(I->first, PendingImplicitInstantiations);
2562-
AddSourceLocation(I->second, PendingImplicitInstantiations);
2560+
AddDeclRef(I->first, PendingInstantiations);
2561+
AddSourceLocation(I->second, PendingInstantiations);
25632562
}
25642563
}
25652564
assert(SemaRef.PendingLocalImplicitInstantiations.empty() &&
@@ -2639,9 +2638,8 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
26392638
Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses);
26402639

26412640
// Write the record containing pending implicit instantiations.
2642-
if (!PendingImplicitInstantiations.empty())
2643-
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS,
2644-
PendingImplicitInstantiations);
2641+
if (!PendingInstantiations.empty())
2642+
Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS, PendingInstantiations);
26452643

26462644
// Write the record containing declaration references of Sema.
26472645
if (!SemaDeclRefs.empty())

0 commit comments

Comments
 (0)