mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -36,6 +36,9 @@ namespace index {
|
||||
/// \param indexSystemModules If true, emit index data for imported serialized
|
||||
/// swift system modules.
|
||||
///
|
||||
/// \param skipStdlib If indexing system modules, don't index the standard
|
||||
/// library.
|
||||
///
|
||||
/// \param isDebugCompilation true for non-optimized compiler invocation.
|
||||
///
|
||||
/// \param targetTriple The target for this compilation.
|
||||
@@ -43,7 +46,8 @@ namespace index {
|
||||
/// \param dependencyTracker The set of dependencies seen while building.
|
||||
bool indexAndRecord(SourceFile *primarySourceFile, StringRef indexUnitToken,
|
||||
StringRef indexStorePath, bool indexSystemModules,
|
||||
bool isDebugCompilation, StringRef targetTriple,
|
||||
bool skipStdlib, bool isDebugCompilation,
|
||||
StringRef targetTriple,
|
||||
const DependencyTracker &dependencyTracker);
|
||||
|
||||
/// Index the given module and store the results to \p indexStorePath.
|
||||
@@ -64,6 +68,9 @@ bool indexAndRecord(SourceFile *primarySourceFile, StringRef indexUnitToken,
|
||||
/// \param indexSystemModules If true, emit index data for imported serialized
|
||||
/// swift system modules.
|
||||
///
|
||||
/// \param skipStdlib If indexing system modules, don't index the standard
|
||||
/// library.
|
||||
///
|
||||
/// \param isDebugCompilation true for non-optimized compiler invocation.
|
||||
///
|
||||
/// \param targetTriple The target for this compilation.
|
||||
@@ -71,8 +78,8 @@ bool indexAndRecord(SourceFile *primarySourceFile, StringRef indexUnitToken,
|
||||
/// \param dependencyTracker The set of dependencies seen while building.
|
||||
bool indexAndRecord(ModuleDecl *module, ArrayRef<std::string> indexUnitTokens,
|
||||
StringRef moduleUnitToken, StringRef indexStorePath,
|
||||
bool indexSystemModules, bool isDebugCompilation,
|
||||
StringRef targetTriple,
|
||||
bool indexSystemModules, bool skipStdlib,
|
||||
bool isDebugCompilation, StringRef targetTriple,
|
||||
const DependencyTracker &dependencyTracker);
|
||||
// FIXME: indexUnitTokens could be StringRef, but that creates an impedance
|
||||
// mismatch in the caller.
|
||||
|
||||
Reference in New Issue
Block a user