Commits

Jordan Rose committed 5e0f4b704de
[AST] Introduce AvailabilityContext to wrap VersionRange. This is the beginning of the extension of the availability model introduced in Swift 2.0 to support two interesting things: inlineable code and binary frameworks not tied to an OS. The former is critical to having a stable standard library that isn't shipped with a client app. (For more information on both of these, see docs/LibraryEvolution.rst.) The existing availability model enforces that API is not used unless the developer has already guaranteed its existence. We want to reuse this logic for these new purposes. Additionally, certain queries about the AST are dependent on this type of information as well, e.g. "can I assume this enum will not grow any additional cases?" If the enum comes from the module being compiled, the answer is usually "yes", but not if the code asking the question may be inlined into another binary! (This latter purpose is currently served by ResilienceExpansion down at the SIL level; my goal is to replace ResilienceExpansion with AvailabilityContext. It's a bit heavier but would also allow additional optimization in the future.) This commit does not change any logic; it only wraps existing uses of VersionRange in AvailabilityContext if they're not strictly referring to the OS version.