Diagnose the combination of -Ounchecked with strict memory safety

Aligns with the current proposal and fixes rdar://127128995
This commit is contained in:
Doug Gregor
2024-12-20 12:25:17 -08:00
parent 1230045c9d
commit ba3e197841
3 changed files with 16 additions and 0 deletions

View File

@@ -3834,6 +3834,13 @@ bool CompilerInvocation::parseArgs(
}
}
if (LangOpts.hasFeature(Feature::WarnUnsafe)) {
if (SILOpts.RemoveRuntimeAsserts ||
SILOpts.AssertConfig == SILOptions::Unchecked) {
Diags.diagnose(SourceLoc(), diag::Ounchecked_with_strict_safety);
}
}
SILOpts.UseAggressiveReg2MemForCodeSize =
ParsedArgs.hasFlag(OPT_enable_aggressive_reg2mem,
OPT_disable_aggressive_reg2mem,