Skip to content

Commit b939128

Browse files
committed
Also fetch proper module name for system modules
1 parent 65062c9 commit b939128

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -426,16 +426,16 @@ static void addModuleDependencies(ArrayRef<ImportedModule> imports,
426426
bool withoutUnitName = true;
427427
if (FU->getKind() == FileUnitKind::ClangModule) {
428428
auto clangModUnit = cast<ClangModuleUnit>(LFU);
429-
if ((!clangModUnit->isSystemModule() || indexSystemModules)) {
430-
withoutUnitName = !indexClangModules;
431-
if (auto clangMod = clangModUnit->getUnderlyingClangModule()) {
432-
moduleName = clangMod->getTopLevelModuleName();
433-
// FIXME: clang's -Rremarks do not seem to go through Swift's
434-
// diagnostic emitter.
435-
if (indexClangModules)
436-
clang::index::emitIndexDataForModuleFile(clangMod,
437-
clangCI, unitWriter);
438-
}
429+
bool shouldIndexModule = indexClangModules &&
430+
(!clangModUnit->isSystemModule() || indexSystemModules);
431+
withoutUnitName = !shouldIndexModule;
432+
if (auto clangMod = clangModUnit->getUnderlyingClangModule()) {
433+
moduleName = clangMod->getTopLevelModuleName();
434+
// FIXME: clang's -Rremarks do not seem to go through Swift's
435+
// diagnostic emitter.
436+
if (shouldIndexModule)
437+
clang::index::emitIndexDataForModuleFile(clangMod,
438+
clangCI, unitWriter);
439439
}
440440
} else {
441441
// Serialized AST file.

0 commit comments

Comments
 (0)