mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user