Skip to content

Commit 7d1c62d

Browse files
committed
Swift: Address review comment
1 parent 07b0294 commit 7d1c62d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

swift/extractor/mangler/SwiftMangler.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,15 @@ SwiftMangler::ExtensionOrFilePrivateValueIndex SwiftMangler::getExtensionOrFileP
148148
}
149149

150150
bool SwiftMangler::isExtensionOrFilePrivateValue(const swift::Decl* decl) {
151-
return decl->getKind() == swift::DeclKind::Extension ||
152-
(swift::isa<swift::ValueDecl>(decl) &&
153-
swift::dyn_cast<swift::ValueDecl>(decl)->getFormalAccess() ==
154-
swift::AccessLevel::FilePrivate);
151+
if (decl->getKind() == swift::DeclKind::Extension) {
152+
return true;
153+
}
154+
155+
if (const auto* valueDecl = swift::dyn_cast<swift::ValueDecl>(decl)) {
156+
return valueDecl->getFormalAccess() == swift::AccessLevel::FilePrivate;
157+
}
158+
159+
return false;
155160
}
156161

157162
void SwiftMangler::indexExtensionsAndFilePrivateValues(llvm::ArrayRef<swift::Decl*> siblings) {

0 commit comments

Comments
 (0)