[SourceKit] Add cancellation points for 'compile' requests

After each stage of the compilation pipeline before the code generation.
Sema, SILGen, SILOptimization, SILLowering, IRGen.
This commit is contained in:
Rintaro Ishizaki
2022-01-21 14:52:43 -08:00
parent 17fdc6fc78
commit d91ec5ac1d
4 changed files with 31 additions and 1 deletions

View File

@@ -1368,6 +1368,10 @@ bool CompilerInstance::performSILProcessing(SILModule *silModule) {
return false;
}
bool CompilerInstance::isCancellationRequested() const {
auto flag = getASTContext().CancellationFlag;
return flag && flag->load(std::memory_order_relaxed);
}
const PrimarySpecificPaths &
CompilerInstance::getPrimarySpecificPathsForWholeModuleOptimizationMode()