Skip to content

Commit e89e66c

Browse files
committed
Allow implementation-only imports to be missing when debugging
This will be tested on the LLDB side.
1 parent 526ea54 commit e89e66c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,8 +1514,16 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
15141514
continue;
15151515
}
15161516

1517-
if (dependency.isImplementationOnly() && !treatAsPartialModule)
1517+
if (dependency.isImplementationOnly() &&
1518+
!(treatAsPartialModule || ctx.LangOpts.DebuggerSupport)) {
1519+
// When building normally (and not merging partial modules), we don't
1520+
// want to bring in the implementation-only module, because that might
1521+
// change the set of visible declarations. However, when debugging we
1522+
// want to allow getting at the internals of this module when possible,
1523+
// and so we'll try to reference the implementation-only module if it's
1524+
// available.
15181525
continue;
1526+
}
15191527

15201528
StringRef modulePathStr = dependency.RawPath;
15211529
StringRef scopePath;
@@ -1544,7 +1552,8 @@ Status ModuleFile::associateWithFileContext(FileUnit *file,
15441552

15451553
// Otherwise, continue trying to load dependencies, so that we can list
15461554
// everything that's missing.
1547-
missingDependency = true;
1555+
if (!(dependency.isImplementationOnly() && ctx.LangOpts.DebuggerSupport))
1556+
missingDependency = true;
15481557
continue;
15491558
}
15501559

0 commit comments

Comments
 (0)