mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Frontend] Support -index-store-path for explicit module interface compilation.
This commit is contained in:
committed by
Tony Allevato
parent
2a76cc13f6
commit
5fd985256c
@@ -974,6 +974,21 @@ static void dumpAPIIfNeeded(const CompilerInstance &Instance) {
|
||||
}
|
||||
}
|
||||
|
||||
static bool shouldEmitIndexData(const CompilerInvocation &Invocation) {
|
||||
const auto &opts = Invocation.getFrontendOptions();
|
||||
auto action = opts.RequestedAction;
|
||||
|
||||
if (action == FrontendOptions::ActionType::CompileModuleFromInterface &&
|
||||
opts.ExplicitInterfaceBuild) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// FIXME: This predicate matches the status quo, but there's no reason
|
||||
// indexing cannot run for actions that do not require stdlib e.g. to better
|
||||
// facilitate tests.
|
||||
return FrontendOptions::doesActionRequireSwiftStandardLibrary(action);
|
||||
}
|
||||
|
||||
/// Perform any actions that must have access to the ASTContext, and need to be
|
||||
/// delayed until the Swift compile pipeline has finished. This may be called
|
||||
/// before or after LLVM depending on when the ASTContext gets freed.
|
||||
@@ -1068,10 +1083,7 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: This predicate matches the status quo, but there's no reason
|
||||
// indexing cannot run for actions that do not require stdlib e.g. to better
|
||||
// facilitate tests.
|
||||
if (FrontendOptions::doesActionRequireSwiftStandardLibrary(action)) {
|
||||
if (shouldEmitIndexData(Invocation)) {
|
||||
emitIndexData(Instance);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user