Merge pull request #71586 from cachemeifyoucan/eng/PR-122814823

[Caching] Do not mix swift modules built from CAS vs. from FileSystem
This commit is contained in:
Steven Wu
2024-02-16 10:50:40 -08:00
committed by GitHub
4 changed files with 37 additions and 2 deletions

View File

@@ -71,7 +71,8 @@ std::string CompilerInvocation::getPCHHash() const {
SearchPathOpts.getPCHHashComponents(),
DiagnosticOpts.getPCHHashComponents(),
SILOpts.getPCHHashComponents(),
IRGenOpts.getPCHHashComponents());
IRGenOpts.getPCHHashComponents(),
CASOpts.getPCHHashComponents());
return llvm::toString(llvm::APInt(64, Code), 36, /*Signed=*/false);
}
@@ -85,7 +86,8 @@ std::string CompilerInvocation::getModuleScanningHash() const {
SearchPathOpts.getModuleScanningHashComponents(),
DiagnosticOpts.getModuleScanningHashComponents(),
SILOpts.getModuleScanningHashComponents(),
IRGenOpts.getModuleScanningHashComponents());
IRGenOpts.getModuleScanningHashComponents(),
CASOpts.getModuleScanningHashComponents());
return llvm::toString(llvm::APInt(64, Code), 36, /*Signed=*/false);
}

View File

@@ -1932,6 +1932,10 @@ InterfaceSubContextDelegateImpl::getCacheHash(StringRef useInterfacePath,
// invalidation behavior of this cache item.
genericSubInvocation.getFrontendOptions().shouldTrackSystemDependencies(),
// Whether or not caching is enabled affects if the instance is able to
// correctly load the dependencies.
genericSubInvocation.getCASOptions().getModuleScanningHashComponents(),
// Whether or not OSSA modules are enabled.
//
// If OSSA modules are enabled, we use a separate namespace of modules to