[SourceKit] Add a request to generate object files in SourceKit

Add 'request.compile'
This commit is contained in:
Rintaro Ishizaki
2021-12-20 13:33:50 -08:00
parent 21e13c436c
commit 7c92a8e555
36 changed files with 1000 additions and 84 deletions

View File

@@ -710,7 +710,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();
@@ -1440,6 +1440,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