================
@@ -1235,6 +1243,39 @@ void
ModulesBuilder::ModulesBuilderImpl::getPrebuiltModuleFile(
}
}
+bool ModulesBuilder::ModulesBuilderImpl::hasNewerDependency(
+ StringRef ModuleName, PathRef PublishedModuleFilePath,
+ PathRef RequiredSource, PathRef ModuleUnitFileName,
+ CachingProjectModules &MDB) {
+ std::vector<std::string> Deps = MDB.getRequiredModules(ModuleUnitFileName);
+ if (Deps.empty())
+ return false;
+
+ llvm::sys::fs::file_status Status;
+ // Without a published module file there is nothing to compare against, so
+ // treat any cached copy as stale.
+ if (llvm::sys::fs::status(PublishedModuleFilePath, Status))
+ return true;
+ const auto ModuleTime = Status.getLastModificationTime();
+
+ return llvm::any_of(Deps, [&](const std::string &Dep) {
+ std::string DepSource = MDB.getSourceForModuleName(Dep, RequiredSource);
----------------
lslimani wrote:
Well from what I've tested the perfs look almost identical without the check
and with both versions of it, for the next few days I won't be able to go
further but if you think it's really worth investigating we can wait. But in
the other case I push the change to `moduleUnitFileName` whenever.
https://github.com/llvm/llvm-project/pull/234181
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits