mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[APINotes] Add support for handling Clang modules carrying all versions of APINotes
Controlled from Swift with '-version-independent-apinotes', which, for the underlying Clang invocation enables '-fswift-version-independent-apinotes', results in PCMs which aggregate all versioned APINotes wrapped in a 'SwiftVersionedAttr', with the intent to have the client pick and apply only those that match its current Swift version, discarding the rest. This change introduces the configuration flags for this mode as well as the corresponding logic at the beginning of `importDeclImpl` to canonicalize versioned attributes, i.e. select the appropriate attributes for the current target and discard the rest.
This commit is contained in:
@@ -2013,6 +2013,12 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
|
||||
GenericArgs.push_back(blocklist);
|
||||
}
|
||||
|
||||
// Inherit APINotes processing method
|
||||
if (clangImporterOpts.LoadVersionIndependentAPINotes) {
|
||||
GenericArgs.push_back("-version-independent-apinotes");
|
||||
genericSubInvocation.getClangImporterOptions().LoadVersionIndependentAPINotes = true;
|
||||
}
|
||||
|
||||
// Inherit the C++ interoperability mode.
|
||||
if (langOpts.EnableCXXInterop) {
|
||||
// Modelled after a reverse of validateCxxInteropCompatibilityMode
|
||||
|
||||
Reference in New Issue
Block a user