Propagate '-application-extension' to module interface loader sub-invocations.

This flag restricts availability of certain symbols to ensure the code cannot use declarations that are explicitly unavalable to extensions. This restriction should be passed down to dependency modules also.
This commit is contained in:
Artem Chikin
2022-10-11 09:14:02 -07:00
parent af276b77f5
commit 0c470f238b
3 changed files with 56 additions and 0 deletions

View File

@@ -1559,6 +1559,11 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
genericSubInvocation.getFrontendOptions().DisableImplicitModules = true;
GenericArgs.push_back("-disable-implicit-swift-modules");
}
// If building an application extension, make sure API use
// is restricted accordingly in downstream dependnecies.
if (langOpts.EnableAppExtensionRestrictions) {
GenericArgs.push_back("-application-extension");
}
// Save the parent invocation's Target Triple
ParentInvocationTarget = langOpts.Target;