mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Stop using isSystemModule to represent "non-user" modules
Rather than using `ModuleDecl::isSystemModule()` to determine whether a module is not a user module, instead check whether the module was defined adjacent to the compiler or if it's part of the SDK. If no SDK path was given, then `isSystemModule` is still used as a fallback. Resolves rdar://89253201.
This commit is contained in:
@@ -611,15 +611,15 @@ public:
|
||||
};
|
||||
|
||||
static const ValueDecl *getRelatedSystemDecl(const ValueDecl *VD) {
|
||||
if (VD->getModuleContext()->isSystemModule())
|
||||
if (VD->getModuleContext()->isNonUserModule())
|
||||
return VD;
|
||||
for (auto *Req : VD->getSatisfiedProtocolRequirements()) {
|
||||
if (Req->getModuleContext()->isSystemModule())
|
||||
if (Req->getModuleContext()->isNonUserModule())
|
||||
return Req;
|
||||
}
|
||||
for (auto Over = VD->getOverriddenDecl(); Over;
|
||||
Over = Over->getOverriddenDecl()) {
|
||||
if (Over->getModuleContext()->isSystemModule())
|
||||
if (Over->getModuleContext()->isNonUserModule())
|
||||
return Over;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user