@@ -395,6 +395,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
395
395
bool indexSystemModules,
396
396
bool skipStdlib,
397
397
bool includeLocals,
398
+ bool explicitModulebuild,
398
399
StringRef targetTriple,
399
400
const clang::CompilerInstance &clangCI,
400
401
DiagnosticEngine &diags,
@@ -598,6 +599,7 @@ static void addModuleDependencies(ArrayRef<ImportedModule> imports,
598
599
bool indexSystemModules,
599
600
bool skipStdlib,
600
601
bool includeLocals,
602
+ bool explicitModuleBuild,
601
603
StringRef targetTriple,
602
604
const clang::CompilerInstance &clangCI,
603
605
DiagnosticEngine &diags,
@@ -674,7 +676,9 @@ static void addModuleDependencies(ArrayRef<ImportedModule> imports,
674
676
emitDataForSwiftSerializedModule (mod, indexStorePath,
675
677
indexClangModules,
676
678
indexSystemModules, skipStdlib,
677
- includeLocals, targetTriple,
679
+ includeLocals,
680
+ explicitModuleBuild,
681
+ targetTriple,
678
682
clangCI, diags,
679
683
unitWriter,
680
684
pathRemapper,
@@ -719,6 +723,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
719
723
bool indexSystemModules,
720
724
bool skipStdlib,
721
725
bool includeLocals,
726
+ bool explicitModuleBuild,
722
727
StringRef targetTriple,
723
728
const clang::CompilerInstance &clangCI,
724
729
DiagnosticEngine &diags,
@@ -747,7 +752,9 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
747
752
// Reload resilient modules from swiftinterface to avoid indexing
748
753
// internal details.
749
754
bool skipIndexingModule = false ;
750
- if (module ->getResilienceStrategy () == ResilienceStrategy::Resilient &&
755
+ // Note, we are unable to reload from interface on an explicit module build
756
+ if (!explicitModuleBuild &&
757
+ module ->getResilienceStrategy () == ResilienceStrategy::Resilient &&
751
758
!module ->isBuiltFromInterface () &&
752
759
!module ->isStdlibModule ()) {
753
760
module ->getASTContext ().setIgnoreAdjacentModules (true );
@@ -867,6 +874,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
867
874
StringScratchSpace moduleNameScratch;
868
875
addModuleDependencies (imports, indexStorePath, indexClangModules,
869
876
indexSystemModules, skipStdlib, includeLocals,
877
+ explicitModuleBuild,
870
878
targetTriple, clangCI, diags, unitWriter,
871
879
moduleNameScratch, pathRemapper, initialFile);
872
880
@@ -883,7 +891,7 @@ recordSourceFileUnit(SourceFile *primarySourceFile, StringRef indexUnitToken,
883
891
StringRef indexStorePath, bool indexClangModules,
884
892
bool indexSystemModules, bool skipStdlib,
885
893
bool includeLocals, bool isDebugCompilation,
886
- StringRef targetTriple,
894
+ bool isExplicitModuleBuild, StringRef targetTriple,
887
895
ArrayRef<const clang::FileEntry *> fileDependencies,
888
896
const clang::CompilerInstance &clangCI,
889
897
const PathRemapper &pathRemapper,
@@ -909,8 +917,9 @@ recordSourceFileUnit(SourceFile *primarySourceFile, StringRef indexUnitToken,
909
917
StringScratchSpace moduleNameScratch;
910
918
addModuleDependencies (imports, indexStorePath, indexClangModules,
911
919
indexSystemModules, skipStdlib, includeLocals,
912
- targetTriple, clangCI, diags, unitWriter,
913
- moduleNameScratch, pathRemapper, primarySourceFile);
920
+ isExplicitModuleBuild, targetTriple, clangCI, diags,
921
+ unitWriter, moduleNameScratch, pathRemapper,
922
+ primarySourceFile);
914
923
915
924
// File dependencies.
916
925
for (auto *F : fileDependencies)
@@ -965,6 +974,7 @@ bool index::indexAndRecord(SourceFile *primarySourceFile,
965
974
bool skipStdlib,
966
975
bool includeLocals,
967
976
bool isDebugCompilation,
977
+ bool isExplicitModuleBuild,
968
978
StringRef targetTriple,
969
979
const DependencyTracker &dependencyTracker,
970
980
const PathRemapper &pathRemapper) {
@@ -994,8 +1004,8 @@ bool index::indexAndRecord(SourceFile *primarySourceFile,
994
1004
return recordSourceFileUnit (primarySourceFile, indexUnitToken,
995
1005
indexStorePath, indexClangModules,
996
1006
indexSystemModules, skipStdlib, includeLocals,
997
- isDebugCompilation, targetTriple ,
998
- fileDependencies.getArrayRef (),
1007
+ isDebugCompilation, isExplicitModuleBuild ,
1008
+ targetTriple, fileDependencies.getArrayRef (),
999
1009
clangCI, pathRemapper, diags);
1000
1010
}
1001
1011
@@ -1008,6 +1018,7 @@ bool index::indexAndRecord(ModuleDecl *module,
1008
1018
bool skipStdlib,
1009
1019
bool includeLocals,
1010
1020
bool isDebugCompilation,
1021
+ bool isExplicitModuleBuild,
1011
1022
StringRef targetTriple,
1012
1023
const DependencyTracker &dependencyTracker,
1013
1024
const PathRemapper &pathRemapper) {
@@ -1045,8 +1056,8 @@ bool index::indexAndRecord(ModuleDecl *module,
1045
1056
if (recordSourceFileUnit (SF, indexUnitTokens[unitIndex],
1046
1057
indexStorePath, indexClangModules,
1047
1058
indexSystemModules, skipStdlib, includeLocals,
1048
- isDebugCompilation, targetTriple ,
1049
- fileDependencies.getArrayRef (),
1059
+ isDebugCompilation, isExplicitModuleBuild ,
1060
+ targetTriple, fileDependencies.getArrayRef (),
1050
1061
clangCI, pathRemapper, diags))
1051
1062
return true ;
1052
1063
unitIndex += 1 ;
0 commit comments