Merge pull request #71403 from nate-chandler/delete-flag

[Frontend] Removed enable-lexical-borrow-scopes flag.
This commit is contained in:
nate-chandler
2024-02-06 07:00:25 -08:00
committed by GitHub
30 changed files with 88 additions and 197 deletions

View File

@@ -2198,15 +2198,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.CopyPropagation = *specifiedCopyPropagationOption;
}
llvm::Optional<bool> enableLexicalBorrowScopesFlag;
if (Arg *A = Args.getLastArg(OPT_enable_lexical_borrow_scopes)) {
enableLexicalBorrowScopesFlag =
llvm::StringSwitch<llvm::Optional<bool>>(A->getValue())
.Case("true", true)
.Case("false", false)
.Default(llvm::None);
}
// Allow command line flags to override the default value of
// Opts.LexicalLifetimes. If no explicit flags are passed, then
// Opts.LexicalLifetimes retains its initial value.
@@ -2231,26 +2222,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
}
}
if (enableLexicalLifetimesFlag.value_or(false) &&
!enableLexicalBorrowScopesFlag.value_or(true)) {
// Error if lexical lifetimes have been enabled but lexical borrow scopes--
// on which they are dependent--have been disabled.
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination,
"enable-lexical-lifetimes=true",
"enable-lexical-borrow-scopes=false");
return true;
}
if (Args.hasArg(OPT_enable_experimental_move_only) &&
!enableLexicalBorrowScopesFlag.value_or(true)) {
// Error if move-only is enabled and lexical borrow scopes--on which it
// depends--has been disabled.
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination,
"enable-experimental-move-only",
"enable-lexical-borrow-scopes=false");
return true;
}
// Unless overridden below, enabling copy propagation means enabling lexical
// lifetimes.
if (Opts.CopyPropagation == CopyPropagationOption::On) {
@@ -2277,13 +2248,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Opts.LexicalLifetimes = LexicalLifetimesOption::DiagnosticMarkersOnly;
}
}
if (enableLexicalBorrowScopesFlag) {
if (*enableLexicalBorrowScopesFlag) {
Opts.LexicalLifetimes = LexicalLifetimesOption::DiagnosticMarkersOnly;
} else {
Opts.LexicalLifetimes = LexicalLifetimesOption::Off;
}
}
if (specifiedDestroyHoistingOption)
Opts.DestroyHoisting = *specifiedDestroyHoistingOption;