mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user