@@ -94,8 +94,6 @@ namespace clang {
94
94
GlobalDeclID NamedDeclForTagDecl = 0 ;
95
95
IdentifierInfo *TypedefNameForLinkage = nullptr ;
96
96
97
- bool HasPendingBody = false ;
98
-
99
97
// /A flag to carry the information for a decl from the entity is
100
98
// / used. We use it to delay the marking of the canonical decl as used until
101
99
// / the entire declaration is deserialized and merged.
@@ -314,9 +312,6 @@ namespace clang {
314
312
static void markIncompleteDeclChainImpl (Redeclarable<DeclT> *D);
315
313
static void markIncompleteDeclChainImpl (...);
316
314
317
- // / Determine whether this declaration has a pending body.
318
- bool hasPendingBody () const { return HasPendingBody; }
319
-
320
315
void ReadFunctionDefinition (FunctionDecl *FD);
321
316
void Visit (Decl *D);
322
317
@@ -541,7 +536,6 @@ void ASTDeclReader::ReadFunctionDefinition(FunctionDecl *FD) {
541
536
}
542
537
// Store the offset of the body so we can lazily load it later.
543
538
Reader.PendingBodies [FD] = GetCurrentCursorOffset ();
544
- HasPendingBody = true ;
545
539
}
546
540
547
541
void ASTDeclReader::Visit (Decl *D) {
@@ -1164,7 +1158,6 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
1164
1158
// Load the body on-demand. Most clients won't care, because method
1165
1159
// definitions rarely show up in headers.
1166
1160
Reader.PendingBodies [MD] = GetCurrentCursorOffset ();
1167
- HasPendingBody = true ;
1168
1161
}
1169
1162
MD->setSelfDecl (readDeclAs<ImplicitParamDecl>());
1170
1163
MD->setCmdDecl (readDeclAs<ImplicitParamDecl>());
@@ -4156,8 +4149,7 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) {
4156
4149
// AST consumer might need to know about, queue it.
4157
4150
// We don't pass it to the consumer immediately because we may be in recursive
4158
4151
// loading, and some declarations may still be initializing.
4159
- PotentiallyInterestingDecls.push_back (
4160
- InterestingDecl (D, Reader.hasPendingBody ()));
4152
+ PotentiallyInterestingDecls.push_back (D);
4161
4153
4162
4154
return D;
4163
4155
}
@@ -4179,10 +4171,10 @@ void ASTReader::PassInterestingDeclsToConsumer() {
4179
4171
EagerlyDeserializedDecls.clear ();
4180
4172
4181
4173
while (!PotentiallyInterestingDecls.empty ()) {
4182
- InterestingDecl D = PotentiallyInterestingDecls.front ();
4174
+ Decl * D = PotentiallyInterestingDecls.front ();
4183
4175
PotentiallyInterestingDecls.pop_front ();
4184
- if (isConsumerInterestedIn (getContext (), D. getDecl (), D. hasPendingBody ( )))
4185
- PassInterestingDeclToConsumer (D. getDecl () );
4176
+ if (isConsumerInterestedIn (getContext (), D, PendingBodies. count (D )))
4177
+ PassInterestingDeclToConsumer (D);
4186
4178
}
4187
4179
}
4188
4180
@@ -4239,9 +4231,8 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
4239
4231
// We might have made this declaration interesting. If so, remember that
4240
4232
// we need to hand it off to the consumer.
4241
4233
if (!WasInteresting &&
4242
- isConsumerInterestedIn (getContext (), D, Reader.hasPendingBody ())) {
4243
- PotentiallyInterestingDecls.push_back (
4244
- InterestingDecl (D, Reader.hasPendingBody ()));
4234
+ isConsumerInterestedIn (getContext (), D, PendingBodies.count (D))) {
4235
+ PotentiallyInterestingDecls.push_back (D);
4245
4236
WasInteresting = true ;
4246
4237
}
4247
4238
}
0 commit comments