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