[Caching] Give swiftmodule loaded from CAS a path identifier

Assign the path returned from dependency scanner for the module to the
buffer identifier when loading modules from CAS. This fixes a warning in
module trace file generation about invariant violation and also an
assertion when generating swiftdeps file.

rdar://122905379
This commit is contained in:
Steven Wu
2024-03-19 09:48:37 -07:00
parent 7da493498a
commit e99a93b068
2 changed files with 59 additions and 1 deletions

View File

@@ -2603,7 +2603,7 @@ bool ExplicitCASModuleLoader::findModule(
// that are not located on disk.
auto moduleBuf = loadCachedCompileResultFromCacheKey(
Impl.CAS, Impl.Cache, Ctx.Diags, moduleCASID,
file_types::ID::TY_SwiftModuleFile);
file_types::ID::TY_SwiftModuleFile, moduleInfo.modulePath);
if (!moduleBuf) {
// We cannot read the module content, diagnose.
Ctx.Diags.diagnose(SourceLoc(), diag::error_opening_explicit_module_file,