Add -index-ignore-clang-modules flag

This flag avoids indexing import clang modules (pcms), behaving
similar to `-index-ignore-system-modules` except for PCMs.
This commit is contained in:
David Goldman
2022-05-13 17:06:14 -04:00
parent 8fb604c18b
commit 63c88b97f1
8 changed files with 87 additions and 40 deletions

View File

@@ -1760,7 +1760,9 @@ static void emitIndexDataForSourceFile(SourceFile *PrimarySourceFile,
if (OutputFile.empty())
OutputFile = PSPs.OutputFilename;
(void) index::indexAndRecord(PrimarySourceFile, OutputFile,
opts.IndexStorePath, opts.IndexSystemModules,
opts.IndexStorePath,
!opts.IndexIgnoreClangModules,
opts.IndexSystemModules,
opts.IndexIgnoreStdlib, isDebugCompilation,
Invocation.getTargetTriple(),
*Instance.getDependencyTracker(),
@@ -1775,6 +1777,7 @@ static void emitIndexDataForSourceFile(SourceFile *PrimarySourceFile,
opts.InputsAndOutputs
.copyIndexUnitOutputFilenames(),
moduleToken, opts.IndexStorePath,
!opts.IndexIgnoreClangModules,
opts.IndexSystemModules,
opts.IndexIgnoreStdlib,
isDebugCompilation,