@@ -1360,19 +1360,25 @@ bool ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface(
1360
1360
ArrayRef<std::string> CompiledCandidates,
1361
1361
DependencyTracker *tracker) {
1362
1362
1363
- // First, check if the expected output already exists and possibly up-to-date w.r.t.
1364
- // all of the dependencies it was built with. If so, early exit.
1365
- UpToDateModuleCheker checker (Instance.getASTContext (),
1366
- RequireOSSAModules_t (Instance.getSILOptions ()));
1367
- ModuleRebuildInfo rebuildInfo;
1368
- SmallVector<FileDependency, 3 > allDeps;
1369
- std::unique_ptr<llvm::MemoryBuffer> moduleBuffer;
1370
- if (checker.swiftModuleIsUpToDate (outputPath, rebuildInfo, allDeps, moduleBuffer)) {
1371
- if (Instance.getASTContext ().LangOpts .EnableSkipExplicitInterfaceModuleBuildRemarks ) {
1372
- Instance.getDiags ().diagnose (SourceLoc (),
1373
- diag::explicit_interface_build_skipped, outputPath);
1363
+ if (!Instance.getInvocation ().getIRGenOptions ().AlwaysCompile ) {
1364
+ // First, check if the expected output already exists and possibly
1365
+ // up-to-date w.r.t. all of the dependencies it was built with. If so, early
1366
+ // exit.
1367
+ UpToDateModuleCheker checker (
1368
+ Instance.getASTContext (),
1369
+ RequireOSSAModules_t (Instance.getSILOptions ()));
1370
+ ModuleRebuildInfo rebuildInfo;
1371
+ SmallVector<FileDependency, 3 > allDeps;
1372
+ std::unique_ptr<llvm::MemoryBuffer> moduleBuffer;
1373
+ if (checker.swiftModuleIsUpToDate (outputPath, rebuildInfo, allDeps,
1374
+ moduleBuffer)) {
1375
+ if (Instance.getASTContext ()
1376
+ .LangOpts .EnableSkipExplicitInterfaceModuleBuildRemarks ) {
1377
+ Instance.getDiags ().diagnose (
1378
+ SourceLoc (), diag::explicit_interface_build_skipped, outputPath);
1379
+ }
1380
+ return false ;
1374
1381
}
1375
- return false ;
1376
1382
}
1377
1383
1378
1384
// Read out the compiler version.
0 commit comments