Merge pull request #40645 from rintaro/sourcekit-compilerserver

[SourceKit] Add a request to generate object files in SourceKit
This commit is contained in:
Rintaro Ishizaki
2021-12-21 22:29:11 -08:00
committed by GitHub
36 changed files with 1000 additions and 84 deletions

View File

@@ -705,7 +705,7 @@ static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
int &ReturnValue,
FrontendObserver *observer);
static bool performCompileStepsPostSema(CompilerInstance &Instance,
bool swift::performCompileStepsPostSema(CompilerInstance &Instance,
int &ReturnValue,
FrontendObserver *observer) {
const auto &Invocation = Instance.getInvocation();
@@ -1436,6 +1436,14 @@ static void freeASTContextIfPossible(CompilerInstance &Instance) {
return;
}
// If this instance is used for multiple compilations, we need the ASTContext
// to live.
if (Instance.getInvocation()
.getFrontendOptions()
.ReuseFrontendForMutipleCompilations) {
return;
}
const auto &opts = Instance.getInvocation().getFrontendOptions();
// If there are multiple primary inputs it is too soon to free