mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Explicit Modules] On an explicit interface build, early exit if the expected output is up-to-date.
This commit is contained in:
@@ -1345,6 +1345,21 @@ bool ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface(
|
||||
ArrayRef<std::string> CompiledCandidates,
|
||||
DependencyTracker *tracker) {
|
||||
|
||||
// First, check if the expected output already exists and possibly up-to-date w.r.t.
|
||||
// all of the dependencies it was built with. If so, early exit.
|
||||
UpToDateModuleCheker checker(Instance.getASTContext(),
|
||||
RequireOSSAModules_t(Instance.getSILOptions()));
|
||||
ModuleRebuildInfo rebuildInfo;
|
||||
SmallVector<FileDependency, 3> allDeps;
|
||||
std::unique_ptr<llvm::MemoryBuffer> moduleBuffer;
|
||||
if (checker.swiftModuleIsUpToDate(outputPath, rebuildInfo, allDeps, moduleBuffer)) {
|
||||
if (Instance.getASTContext().LangOpts.EnableSkipExplicitInterfaceModuleBuildRemarks) {
|
||||
Instance.getDiags().diagnose(SourceLoc(),
|
||||
diag::explicit_interface_build_skipped, outputPath);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read out the compiler version.
|
||||
llvm::BumpPtrAllocator alloc;
|
||||
llvm::StringSaver ArgSaver(alloc);
|
||||
|
||||
Reference in New Issue
Block a user