@@ -3198,7 +3198,7 @@ inline void ASTReader::LoadedDecl(unsigned Index, Decl *D) {
3198
3198
// / This routine should return true for anything that might affect
3199
3199
// / code generation, e.g., inline function definitions, Objective-C
3200
3200
// / declarations with metadata, etc.
3201
- static bool isConsumerInterestedIn (ASTContext &Ctx, Decl *D, bool HasBody ) {
3201
+ bool ASTReader:: isConsumerInterestedIn (Decl *D) {
3202
3202
// An ObjCMethodDecl is never considered as "interesting" because its
3203
3203
// implementation container always is.
3204
3204
@@ -3207,7 +3207,7 @@ static bool isConsumerInterestedIn(ASTContext &Ctx, Decl *D, bool HasBody) {
3207
3207
if (isPartOfPerModuleInitializer (D)) {
3208
3208
auto *M = D->getImportedOwningModule ();
3209
3209
if (M && M->Kind == Module::ModuleMapModule &&
3210
- Ctx .DeclMustBeEmitted (D))
3210
+ getContext () .DeclMustBeEmitted (D))
3211
3211
return false ;
3212
3212
}
3213
3213
@@ -3222,7 +3222,7 @@ static bool isConsumerInterestedIn(ASTContext &Ctx, Decl *D, bool HasBody) {
3222
3222
(Var->isThisDeclarationADefinition () == VarDecl::Definition ||
3223
3223
OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration (Var));
3224
3224
if (const auto *Func = dyn_cast<FunctionDecl>(D))
3225
- return Func->doesThisDeclarationHaveABody () || HasBody ;
3225
+ return Func->doesThisDeclarationHaveABody () || PendingBodies. count (D) ;
3226
3226
3227
3227
if (auto *ES = D->getASTContext ().getExternalSource ())
3228
3228
if (ES->hasExternalDefinitions (D) == ExternalASTSource::EK_Never)
@@ -4173,7 +4173,7 @@ void ASTReader::PassInterestingDeclsToConsumer() {
4173
4173
while (!PotentiallyInterestingDecls.empty ()) {
4174
4174
Decl *D = PotentiallyInterestingDecls.front ();
4175
4175
PotentiallyInterestingDecls.pop_front ();
4176
- if (isConsumerInterestedIn (getContext (), D, PendingBodies. count (D) ))
4176
+ if (isConsumerInterestedIn (D ))
4177
4177
PassInterestingDeclToConsumer (D);
4178
4178
}
4179
4179
}
@@ -4197,8 +4197,7 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
4197
4197
// the declaration, then we know it was interesting and we skip the call
4198
4198
// to isConsumerInterestedIn because it is unsafe to call in the
4199
4199
// current ASTReader state.
4200
- bool WasInteresting =
4201
- Record.JustLoaded || isConsumerInterestedIn (getContext (), D, false );
4200
+ bool WasInteresting = Record.JustLoaded || isConsumerInterestedIn (D);
4202
4201
for (auto &FileAndOffset : UpdateOffsets) {
4203
4202
ModuleFile *F = FileAndOffset.first ;
4204
4203
uint64_t Offset = FileAndOffset.second ;
@@ -4230,8 +4229,7 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
4230
4229
4231
4230
// We might have made this declaration interesting. If so, remember that
4232
4231
// we need to hand it off to the consumer.
4233
- if (!WasInteresting &&
4234
- isConsumerInterestedIn (getContext (), D, PendingBodies.count (D))) {
4232
+ if (!WasInteresting && isConsumerInterestedIn (D)) {
4235
4233
PotentiallyInterestingDecls.push_back (D);
4236
4234
WasInteresting = true ;
4237
4235
}
0 commit comments