Merge pull request #87862 from benlangmuir/casoptions-adaptation

[cas] Adapt to clang::CASOptions change to remove internal cache of instances
This commit is contained in:
Ben Langmuir
2026-03-19 09:42:20 -07:00
committed by GitHub
16 changed files with 117 additions and 58 deletions
+8 -3
View File
@@ -1803,7 +1803,7 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
if (casOpts.EnableCaching) {
genericSubInvocation.getCASOptions().EnableCaching = casOpts.EnableCaching;
genericSubInvocation.getCASOptions().CASOpts = casOpts.CASOpts;
genericSubInvocation.getCASOptions().Config = casOpts.Config;
genericSubInvocation.getCASOptions().HasImmutableFileSystem =
casOpts.HasImmutableFileSystem;
casOpts.enumerateCASConfigurationFlags(
@@ -1856,8 +1856,11 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
StringRef moduleCachePath, StringRef prebuiltCachePath,
StringRef backupModuleInterfaceDir,
ArrayRef<std::pair<std::string, std::string>> replayPrefixMap,
bool serializeDependencyHashes, bool trackSystemDependencies)
: SM(SM), Diags(Diags), ArgSaver(Allocator) {
bool serializeDependencyHashes, bool trackSystemDependencies,
std::shared_ptr<llvm::cas::ObjectStore> CAS,
std::shared_ptr<llvm::cas::ActionCache> ActionCache)
: SM(SM), Diags(Diags), ArgSaver(Allocator),
CAS(std::move(CAS)), ActionCache(std::move(ActionCache)) {
genericSubInvocation.setMainExecutablePath(LoaderOpts.mainExecutablePath);
inheritOptionsForBuildingInterface(LoaderOpts.requestedAction, searchPathOpts,
langOpts, clangImporterOpts, casOpts,
@@ -2186,6 +2189,8 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
subInstance.getSourceMgr().setFileSystem(SM.getFileSystem());
std::string InstanceSetupError;
if (CAS)
subInstance.setSharedCASInstances(CAS, ActionCache);
if (subInstance.setup(subInvocation, InstanceSetupError)) {
return std::make_error_code(std::errc::not_supported);
}