[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:
Vedant Kumar
2018-06-18 14:43:27 -07:00
committed by GitHub
parent 88d305cade
commit d910e5a5c2
3 changed files with 19 additions and 0 deletions

View File

@@ -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 = "";
}