mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Caching][NFC] Restructure CASOption in swift. NFC
Clean up how CASOptions are kept and passed inside swift to make the code more readable. Also avoid a copy of CAS configuration in ClangImporter.
This commit is contained in:
@@ -419,18 +419,19 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) {
|
||||
// in the .swiftinterface file itself. Instead, creation of that
|
||||
// job should incorporate those flags.
|
||||
if (FEOpts.ExplicitInterfaceBuild &&
|
||||
!(FEOpts.isTypeCheckAction() && !FEOpts.EnableCaching))
|
||||
!(FEOpts.isTypeCheckAction() &&
|
||||
!Invocation.getCASOptions().EnableCaching))
|
||||
return ModuleInterfaceLoader::buildExplicitSwiftModuleFromSwiftInterface(
|
||||
Instance, Invocation.getClangModuleCachePath(),
|
||||
FEOpts.BackupModuleInterfaceDir, PrebuiltCachePath, ABIPath, InputPath,
|
||||
Invocation.getOutputFilename(),
|
||||
/* shouldSerializeDeps */ true,
|
||||
Invocation.getSearchPathOptions().CandidateCompiledModules);
|
||||
else
|
||||
return ModuleInterfaceLoader::buildSwiftModuleFromSwiftInterface(
|
||||
|
||||
return ModuleInterfaceLoader::buildSwiftModuleFromSwiftInterface(
|
||||
Instance.getSourceMgr(), Instance.getDiags(),
|
||||
Invocation.getSearchPathOptions(), Invocation.getLangOptions(),
|
||||
Invocation.getClangImporterOptions(),
|
||||
Invocation.getClangImporterOptions(), Invocation.getCASOptions(),
|
||||
Invocation.getClangModuleCachePath(), PrebuiltCachePath,
|
||||
FEOpts.BackupModuleInterfaceDir, Invocation.getModuleName(), InputPath,
|
||||
Invocation.getOutputFilename(), ABIPath,
|
||||
@@ -1455,7 +1456,7 @@ static bool performAction(CompilerInstance &Instance,
|
||||
/// false and will not replay any output.
|
||||
static bool tryReplayCompilerResults(CompilerInstance &Instance) {
|
||||
if (!Instance.supportCaching() ||
|
||||
Instance.getInvocation().getFrontendOptions().CacheSkipReplay)
|
||||
Instance.getInvocation().getCASOptions().CacheSkipReplay)
|
||||
return false;
|
||||
|
||||
assert(Instance.getCompilerBaseKey() &&
|
||||
@@ -1471,7 +1472,7 @@ static bool tryReplayCompilerResults(CompilerInstance &Instance) {
|
||||
Instance.getObjectStore(), Instance.getActionCache(),
|
||||
*Instance.getCompilerBaseKey(), Instance.getDiags(),
|
||||
Instance.getInvocation().getFrontendOptions().InputsAndOutputs, *CDP,
|
||||
Instance.getInvocation().getFrontendOptions().EnableCachingRemarks);
|
||||
Instance.getInvocation().getCASOptions().EnableCachingRemarks);
|
||||
|
||||
// If we didn't replay successfully, re-start capture.
|
||||
if (!replayed)
|
||||
|
||||
Reference in New Issue
Block a user