Index: clang/include/clang/AST/DeclObjC.h =================================================================== --- clang/include/clang/AST/DeclObjC.h +++ clang/include/clang/AST/DeclObjC.h @@ -1226,7 +1226,8 @@ /// which will be NULL if this class has not yet been defined. /// /// The bit indicates when we don't need to check for out-of-date - /// declarations. It will be set unless modules are enabled. + /// declarations. It will be set unless there is an ExternalASTSource that + /// could provide a definition. llvm::PointerIntPair Data; ObjCInterfaceDecl(const ASTContext &C, DeclContext *DC, SourceLocation AtLoc, @@ -1515,7 +1516,7 @@ // If the name of this class is out-of-date, bring it up-to-date, which // might bring in a definition. // Note: a null value indicates that we don't have a definition and that - // modules are enabled. + // there is a ExternalASTSource that could provide a definition. if (!Data.getOpaqueValue()) getMostRecentDecl(); @@ -2061,7 +2062,8 @@ /// which will be NULL if this class has not yet been defined. /// /// The bit indicates when we don't need to check for out-of-date - /// declarations. It will be set unless modules are enabled. + /// declarations. It will be set unless there is an ExternalASTSource that + /// could provide a definition. llvm::PointerIntPair Data; ObjCProtocolDecl(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, @@ -2193,7 +2195,7 @@ // If the name of this protocol is out-of-date, bring it up-to-date, which // might bring in a definition. // Note: a null value indicates that we don't have a definition and that - // modules are enabled. + // there is a ExternalASTSource that could provide a definition. if (!Data.getOpaqueValue()) getMostRecentDecl(); Index: clang/lib/AST/DeclObjC.cpp =================================================================== --- clang/lib/AST/DeclObjC.cpp +++ clang/lib/AST/DeclObjC.cpp @@ -1507,7 +1507,7 @@ auto *Result = new (C, DC) ObjCInterfaceDecl(C, DC, atLoc, Id, typeParamList, ClassLoc, PrevDecl, isInternal); - Result->Data.setInt(!C.getLangOpts().Modules); + Result->Data.setInt(!C.getExternalSource()); C.getObjCInterfaceType(Result, PrevDecl); return Result; } @@ -1517,7 +1517,7 @@ auto *Result = new (C, ID) ObjCInterfaceDecl(C, nullptr, SourceLocation(), nullptr, nullptr, SourceLocation(), nullptr, false); - Result->Data.setInt(!C.getLangOpts().Modules); + Result->Data.setInt(!C.getExternalSource()); return Result; } @@ -1903,7 +1903,7 @@ ObjCProtocolDecl *PrevDecl) { auto *Result = new (C, DC) ObjCProtocolDecl(C, DC, Id, nameLoc, atStartLoc, PrevDecl); - Result->Data.setInt(!C.getLangOpts().Modules); + Result->Data.setInt(!C.getExternalSource()); return Result; } @@ -1912,7 +1912,7 @@ ObjCProtocolDecl *Result = new (C, ID) ObjCProtocolDecl(C, nullptr, nullptr, SourceLocation(), SourceLocation(), nullptr); - Result->Data.setInt(!C.getLangOpts().Modules); + Result->Data.setInt(!C.getExternalSource()); return Result; }