mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Use req options instead of compiler arguments for controlling index-to-store behavior
This commit is contained in:
@@ -370,12 +370,11 @@ void SwiftLangSupport::indexSource(StringRef InputFile,
|
||||
}
|
||||
|
||||
static void emitIndexDataForSourceFile(SourceFile &PrimarySourceFile,
|
||||
StringRef IndexStorePath,
|
||||
StringRef IndexUnitOutputPath,
|
||||
bool IncludeLocals,
|
||||
IndexStoreOptions IndexOpts,
|
||||
const CompilerInstance &Instance) {
|
||||
const auto &Invocation = Instance.getInvocation();
|
||||
const auto &Opts = Invocation.getFrontendOptions();
|
||||
// FIXME: Compiler arguments should be the default for setting options, but this is currently broken (see PR #69076)
|
||||
// const auto &Opts = Invocation.getFrontendOptions();
|
||||
|
||||
bool isDebugCompilation;
|
||||
switch (Invocation.getSILOptions().OptMode) {
|
||||
@@ -389,14 +388,15 @@ static void emitIndexDataForSourceFile(SourceFile &PrimarySourceFile,
|
||||
break;
|
||||
}
|
||||
|
||||
(void) index::indexAndRecord(&PrimarySourceFile, IndexUnitOutputPath,
|
||||
IndexStorePath,
|
||||
!Opts.IndexIgnoreClangModules,
|
||||
Opts.IndexSystemModules,
|
||||
Opts.IndexIgnoreStdlib,
|
||||
IncludeLocals,
|
||||
(void) index::indexAndRecord(&PrimarySourceFile,
|
||||
IndexOpts.IndexUnitOutputPath,
|
||||
IndexOpts.IndexStorePath,
|
||||
!IndexOpts.IgnoreClangModules,
|
||||
IndexOpts.IncludeSystemModules,
|
||||
IndexOpts.IgnoreStdlib,
|
||||
IndexOpts.IncludeLocals,
|
||||
isDebugCompilation,
|
||||
Opts.DisableImplicitModules,
|
||||
IndexOpts.DisableImplicitModules,
|
||||
Invocation.getTargetTriple(),
|
||||
*Instance.getDependencyTracker(),
|
||||
Invocation.getIRGenOptions().FilePrefixMap);
|
||||
@@ -426,9 +426,7 @@ void SwiftLangSupport::indexToStore(
|
||||
void handlePrimaryAST(ASTUnitRef AstUnit) override {
|
||||
auto &SF = AstUnit->getPrimarySourceFile();
|
||||
auto &CI = AstUnit->getCompilerInstance();
|
||||
emitIndexDataForSourceFile(SF, Opts.IndexStorePath,
|
||||
Opts.IndexUnitOutputPath, Opts.IncludeLocals,
|
||||
CI);
|
||||
emitIndexDataForSourceFile(SF, Opts, CI);
|
||||
Receiver(RequestResult<IndexStoreInfo>::fromResult(IndexStoreInfo{}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user