@@ -200,74 +200,6 @@ class ExportContext {
200200 const AvailableAttr *shouldDiagnoseDeclAsUnavailable (const Decl *decl) const ;
201201};
202202
203- // / Represents the reason a declaration is considered unavailable in a certain
204- // / context.
205- class UnmetAvailabilityRequirement {
206- public:
207- enum class Kind {
208- // / The declaration is referenced in a context in which it is
209- // / generally unavailable. For example, a reference to a declaration that is
210- // / unavailable on macOS from a context that may execute on macOS has this
211- // / unmet requirement.
212- AlwaysUnavailable,
213-
214- // / The declaration is referenced in a context in which it is considered
215- // / obsolete. For example, a reference to a declaration that is obsolete in
216- // / macOS 13 from a context that may execute on macOS 13 or later has this
217- // / unmet requirement.
218- Obsoleted,
219-
220- // / The declaration is only available in a different version. For example,
221- // / the declaration might only be introduced in the Swift 6 language mode
222- // / while the module is being compiled in the Swift 5 language mode.
223- RequiresVersion,
224-
225- // / The declaration is referenced in a context that does not have an
226- // / adequate minimum version constraint. For example, a reference to a
227- // / declaration that is introduced in macOS 13 from a context that may
228- // / execute on earlier versions of macOS has this unmet requirement. This
229- // / kind of unmet requirement can be addressed by tightening the minimum
230- // / version of the context with `if #available(...)` or by adding or
231- // / adjusting an `@available` attribute.
232- IntroducedInNewerVersion,
233- };
234-
235- private:
236- Kind kind;
237- const AvailableAttr *attr;
238-
239- UnmetAvailabilityRequirement (Kind kind, const AvailableAttr *attr)
240- : kind(kind), attr(attr){};
241-
242- public:
243- static UnmetAvailabilityRequirement
244- forAlwaysUnavailable (const AvailableAttr *attr) {
245- return UnmetAvailabilityRequirement (Kind::AlwaysUnavailable, attr);
246- }
247-
248- static UnmetAvailabilityRequirement forObsoleted (const AvailableAttr *attr) {
249- return UnmetAvailabilityRequirement (Kind::Obsoleted, attr);
250- }
251-
252- static UnmetAvailabilityRequirement
253- forRequiresVersion (const AvailableAttr *attr) {
254- return UnmetAvailabilityRequirement (Kind::RequiresVersion, attr);
255- }
256-
257- static UnmetAvailabilityRequirement
258- forIntroducedInNewerVersion (const AvailableAttr *attr) {
259- return UnmetAvailabilityRequirement (Kind::IntroducedInNewerVersion, attr);
260- }
261-
262- Kind getKind () const { return kind; }
263- const AvailableAttr *getAttr () const { return attr; }
264-
265- // / Returns the required range for `IntroducedInNewerVersion` requirements, or
266- // / `std::nullopt` otherwise.
267- std::optional<AvailabilityRange>
268- getRequiredNewerAvailabilityRange (ASTContext &ctx) const ;
269- };
270-
271203// / Check if a declaration is exported as part of a module's external interface.
272204// / This includes public and @usableFromInline decls.
273205bool isExported (const ValueDecl *VD);
0 commit comments