[cxx-interop] Configure requires ObjC from frontend option

We sometimes don't have the information in the modulemaps whether a
module requires ObjC or not. This info is useful for reverse interop.
This PR introduces a frontend flag to have a comma separated list of
modules that we should import as if they had "requires ObjC" in their
modulemaps.
This commit is contained in:
Gabor Horvath
2025-07-17 16:18:32 +01:00
parent 48fb7cd874
commit 4b64abdc45
7 changed files with 40 additions and 13 deletions

View File

@@ -850,7 +850,8 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
// Collect some special case pseudo-features which should be processed
// separately.
if (argValue.starts_with("StrictConcurrency") ||
argValue.starts_with("AvailabilityMacro=")) {
argValue.starts_with("AvailabilityMacro=") ||
argValue.starts_with("RequiresObjC=")) {
if (isEnableFeatureFlag)
psuedoFeatures.push_back(argValue);
continue;
@@ -977,6 +978,11 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
Opts.AvailabilityMacros.push_back(availability.str());
continue;
}
if (featureName->starts_with("RequiresObjC")) {
auto modules = featureName->split("=").second;
modules.split(Opts.ModulesRequiringObjC, ",");
}
}
// Map historical flags over to experimental features. We do this for all