[build-script] fix NoncopyableGenerics option

This patch introduces `--enable-experimental-noncopyable-generics` for
the build script. It replaces
`--swift-stdlib-experimental-noncopyable-generics`

The old build option only enables the feature when building the
stdlib, but if we've built the stdlib with NoncopyableGenerics, the
compiler should be hardwired to have that feature enabled, too.

This patch also introduces the `noncopyable_generics` lit parameter, so
that tests assuming the system was built with the feature can live
in-tree and be tested, if they specify `REQUIRES: noncopyable_generics`.
This commit is contained in:
Kavon Farvardin
2024-01-11 17:49:17 -08:00
parent 5c83cae0df
commit b92fe5f2e9
14 changed files with 50 additions and 17 deletions

View File

@@ -895,6 +895,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.enableFeature(Feature::LayoutPrespecialization);
if (SWIFT_ENABLE_EXPERIMENTAL_NONCOPYABLE_GENERICS)
Opts.enableFeature(Feature::NoncopyableGenerics);
Opts.EnableAppExtensionLibraryRestrictions |= Args.hasArg(OPT_enable_app_extension_library);
Opts.EnableAppExtensionRestrictions |= Args.hasArg(OPT_enable_app_extension);
Opts.EnableAppExtensionRestrictions |= Opts.EnableAppExtensionLibraryRestrictions;