mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Disable expensive SIL options (#17306)
Disable the sanitizers and code coverage when building a swift invocation for the purpose of collecting diagnostics. This should speed up diagnostic generation and reduce exposure to compiler bugs. rdar://40955900
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "swift/AST/ASTVisitor.h"
|
||||
#include "swift/AST/ClangModuleLoader.h"
|
||||
#include "swift/AST/SILOptions.h"
|
||||
#include "swift/AST/USRGeneration.h"
|
||||
#include "swift/Config.h"
|
||||
#include "swift/IDE/CodeCompletion.h"
|
||||
@@ -777,3 +778,13 @@ CloseClangModuleFiles::~CloseClangModuleFiles() {
|
||||
M->getASTFile()->closeFile();
|
||||
}
|
||||
}
|
||||
|
||||
void SourceKit::disableExpensiveSILOptions(SILOptions &Opts) {
|
||||
// Disable the sanitizers.
|
||||
Opts.Sanitizers = {};
|
||||
|
||||
// Disable PGO and code coverage.
|
||||
Opts.GenerateProfile = false;
|
||||
Opts.EmitProfileCoverageMapping = false;
|
||||
Opts.UseProfile = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user