Add workaround flag for lazy import-as-member

In rdar://123649082, a project failed to build because of the lazy import-as-member loading changes in #71320. That project was configured in a way that broke modularization and the correct solution is to fix it, but out of an abundance of caution, add a `-disable-named-lazy-import-as-member-loading` frontend flag in case a project needs to temporarily restore the old behavior.

As a bonus, this lets us write a test to verify that lazy import-as-member loading has positive performance impact.
This commit is contained in:
Becca Royal-Gordon
2024-03-01 14:44:16 -08:00
parent 1a97803c8c
commit 54fd4b01b6
7 changed files with 50 additions and 3 deletions

View File

@@ -623,6 +623,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
!Args.hasArg(OPT_disable_experimental_clang_importer_diagnostics) &&
Args.hasArg(OPT_enable_experimental_eager_clang_module_diagnostics);
Opts.DisableNamedLazyImportAsMemberLoading |=
Args.hasArg(OPT_disable_named_lazy_import_as_member_loading);
Opts.DisableImplicitConcurrencyModuleImport |=
Args.hasArg(OPT_disable_implicit_concurrency_module_import);