Frontend: Allow any experimental feature to be enabled when compiling a module.

When building a module from its interface, do not diagnose whether or not a
feature is available in production compilers. This is important since older
compilers may be expected to build .swiftinterfaces that were produced by newer
compilers where the feature has been enabled by default.

Resolves rdar://125500318
This commit is contained in:
Allan Shortlidge
2024-03-27 11:31:17 -07:00
parent a63078f279
commit b11b64273b
6 changed files with 69 additions and 19 deletions

View File

@@ -276,10 +276,8 @@ void CompilerInstance::recordPrimaryInputBuffer(unsigned BufID) {
}
bool CompilerInstance::setUpASTContextIfNeeded() {
if ((Invocation.getFrontendOptions().RequestedAction ==
FrontendOptions::ActionType::CompileModuleFromInterface ||
Invocation.getFrontendOptions().RequestedAction ==
FrontendOptions::ActionType::TypecheckModuleFromInterface) &&
if (FrontendOptions::doesActionBuildModuleFromInterface(
Invocation.getFrontendOptions().RequestedAction) &&
!Invocation.getFrontendOptions().ExplicitInterfaceBuild) {
// Compiling a module interface from source uses its own CompilerInstance
// with options read from the input file. Don't bother setting up an