mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Expose an ImportNonPublicDependencies LangOpt for LLDB (NFC).
This patch allows controlling the automatic import of private dependencies
separately from the DebuggerSupport option, which currently also triggers this
behavior. With explicit modules + precise compiler invocations LLDB is moving
towards no longer needing this behavior.
rdar://133088201
(cherry picked from commit a1ba7159e3)
This commit is contained in:
@@ -1801,7 +1801,7 @@ std::string ModuleFileSharedCore::resolveModuleDefiningFilePath(const StringRef
|
||||
ModuleLoadingBehavior
|
||||
ModuleFileSharedCore::getTransitiveLoadingBehavior(
|
||||
const Dependency &dependency,
|
||||
bool debuggerMode,
|
||||
bool importNonPublicDependencies,
|
||||
bool isPartialModule,
|
||||
StringRef packageName,
|
||||
bool forTestable) const {
|
||||
@@ -1817,7 +1817,7 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
|
||||
if (dependency.isImplementationOnly()) {
|
||||
// Implementation-only dependencies are not usually loaded from
|
||||
// transitive imports.
|
||||
if (debuggerMode || forTestable) {
|
||||
if (importNonPublicDependencies || forTestable) {
|
||||
// In the debugger, try to load the module if possible.
|
||||
// Same in the case of a testable import, try to load the dependency
|
||||
// but don't fail if it's missing as this could be source breaking.
|
||||
@@ -1835,7 +1835,7 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
|
||||
// on testable imports.
|
||||
if (forTestable || !moduleIsResilient) {
|
||||
return ModuleLoadingBehavior::Required;
|
||||
} else if (debuggerMode) {
|
||||
} else if (importNonPublicDependencies) {
|
||||
return ModuleLoadingBehavior::Optional;
|
||||
} else {
|
||||
return ModuleLoadingBehavior::Ignored;
|
||||
@@ -1849,7 +1849,7 @@ ModuleFileSharedCore::getTransitiveLoadingBehavior(
|
||||
forTestable ||
|
||||
!moduleIsResilient) {
|
||||
return ModuleLoadingBehavior::Required;
|
||||
} else if (debuggerMode) {
|
||||
} else if (importNonPublicDependencies) {
|
||||
return ModuleLoadingBehavior::Optional;
|
||||
} else {
|
||||
return ModuleLoadingBehavior::Ignored;
|
||||
|
||||
Reference in New Issue
Block a user