@@ -871,6 +871,28 @@ class ModuleDecl
871871 // / \sa getImportedModules
872872 using ImportFilter = OptionSet<ImportFilterKind>;
873873
874+ // / Returns an \c ImportFilter with all elements of \c ImportFilterKind.
875+ constexpr static ImportFilter getImportFilterAll () {
876+ return {ImportFilterKind::Exported,
877+ ImportFilterKind::Default,
878+ ImportFilterKind::ImplementationOnly,
879+ ImportFilterKind::PackageOnly,
880+ ImportFilterKind::SPIOnly,
881+ ImportFilterKind::ShadowedByCrossImportOverlay};
882+ }
883+
884+ // / Import kinds visible to the module declaring them.
885+ // /
886+ // / This leaves out \c ShadowedByCrossImportOverlay as even if present in
887+ // / the sources it's superseded by the cross-overlay as the local import.
888+ constexpr static ImportFilter getImportFilterLocal () {
889+ return {ImportFilterKind::Exported,
890+ ImportFilterKind::Default,
891+ ImportFilterKind::ImplementationOnly,
892+ ImportFilterKind::PackageOnly,
893+ ImportFilterKind::SPIOnly};
894+ }
895+
874896 // / Looks up which modules are imported by this module.
875897 // /
876898 // / \p filter controls whether public, private, or any imports are included
0 commit comments