[Frontend][Index] Add frontend option to skip indexing the stdlib (for test performance)

Several tests related to indexing system modules were taking a considerable
amount of time (100+ seconds in the worst case) indexing the standard library.
This adds a frontend option to skip it and updates those tests to pass it.
This commit is contained in:
Nathan Hawes
2020-03-25 14:36:23 -07:00
parent 8b03b05f1d
commit a785fa6cee
9 changed files with 52 additions and 15 deletions

View File

@@ -1729,7 +1729,8 @@ static bool emitIndexDataIfNeeded(SourceFile *PrimarySourceFile,
PrimarySourceFile->getFilename());
if (index::indexAndRecord(PrimarySourceFile, PSPs.OutputFilename,
opts.IndexStorePath, opts.IndexSystemModules,
isDebugCompilation, Invocation.getTargetTriple(),
opts.IndexIgnoreStdlib, isDebugCompilation,
Invocation.getTargetTriple(),
*Instance.getDependencyTracker())) {
return true;
}
@@ -1741,7 +1742,7 @@ static bool emitIndexDataIfNeeded(SourceFile *PrimarySourceFile,
if (index::indexAndRecord(Instance.getMainModule(), opts.InputsAndOutputs.copyOutputFilenames(),
moduleToken, opts.IndexStorePath,
opts.IndexSystemModules,
opts.IndexSystemModules, opts.IndexIgnoreStdlib,
isDebugCompilation, Invocation.getTargetTriple(),
*Instance.getDependencyTracker())) {
return true;