mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Also fetch proper module name for system modules
This commit is contained in:
@@ -426,16 +426,16 @@ static void addModuleDependencies(ArrayRef<ImportedModule> imports,
|
||||
bool withoutUnitName = true;
|
||||
if (FU->getKind() == FileUnitKind::ClangModule) {
|
||||
auto clangModUnit = cast<ClangModuleUnit>(LFU);
|
||||
if ((!clangModUnit->isSystemModule() || indexSystemModules)) {
|
||||
withoutUnitName = !indexClangModules;
|
||||
if (auto clangMod = clangModUnit->getUnderlyingClangModule()) {
|
||||
moduleName = clangMod->getTopLevelModuleName();
|
||||
// FIXME: clang's -Rremarks do not seem to go through Swift's
|
||||
// diagnostic emitter.
|
||||
if (indexClangModules)
|
||||
clang::index::emitIndexDataForModuleFile(clangMod,
|
||||
clangCI, unitWriter);
|
||||
}
|
||||
bool shouldIndexModule = indexClangModules &&
|
||||
(!clangModUnit->isSystemModule() || indexSystemModules);
|
||||
withoutUnitName = !shouldIndexModule;
|
||||
if (auto clangMod = clangModUnit->getUnderlyingClangModule()) {
|
||||
moduleName = clangMod->getTopLevelModuleName();
|
||||
// FIXME: clang's -Rremarks do not seem to go through Swift's
|
||||
// diagnostic emitter.
|
||||
if (shouldIndexModule)
|
||||
clang::index::emitIndexDataForModuleFile(clangMod,
|
||||
clangCI, unitWriter);
|
||||
}
|
||||
} else {
|
||||
// Serialized AST file.
|
||||
|
||||
Reference in New Issue
Block a user