You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redesign handling of anyAppleOS availability attribute (llvm#190817)
Previously, when processing an anyAppleOS availability attribute, clang
replaced it with an implicit platform-specific attribute (e.g., ios,
macos) inferred for the current target. Only the introduced version of
the original anyAppleOS attribute was preserved (as a field on the
inferred attr). This was insufficient for clients such as Swift that
need access to the full original attribute, including deprecated,
obsoleted, and message fields.
This patch preserves the original anyAppleOS attribute on the decl and
attaches the inferred platform-specific attribute to it as a child via
the new InferredAttr field. Most callers use getEffectiveAttr() to
transparently get the inferred attr when present, preserving existing
behavior. Fix-it hints use the presence of an inferred attr to decide
whether to emit "anyAppleOS" or a platform-specific name in the
@available expression. The one behavioral change is in documentation
XML, where availability info is now emitted for both the anyAppleOS attr
and the inferred platform-specific attr.
When an explicit platform-specific attribute (e.g. ios(introduced=26.0))
conflicts with an anyAppleOS-derived attribute for the same platform,
the explicit attribute wins: the anyAppleOS attribute is erased from the
decl so only the explicit one is used.
0 commit comments