Files
Michael Gottesman c36f842bed [diagnostic] Convert diagnostics-assert-on-{error,warning} and sil-region-isolation-assert-on-unknown-pattern from llvm::cl::opt globals to Swift frontend flags, and add -diagnostics-assert-on-group
llvm::cl::opt flags are compiled out in non-asserts builds, making these
debug flags unavailable in an important category of use cases — debugging
a release compiler in lldb. By promoting them to Swift frontend flags stored
in DiagnosticOptions/SILOptions, they are available in all build
configurations.

The three existing flags are migrated:
  -diagnostics-assert-on-error
  -diagnostics-assert-on-warning
  -sil-region-isolation-assert-on-unknown-pattern
    (backing field renamed to AbortOnUnknownRegionIsolationPatternError)

A new flag is added:
  -diagnostics-assert-on-group <group>
    Traps when any diagnostic belonging to the named group is emitted,
    allowing targeted breakpoints on a single diagnostic group rather than
    all errors or all warnings.

The assert-on-{error,warning,group} flags are intentionally kept separate
from the normal diagnostic suppression/escalation machinery so that they
remain useful while other diagnostics are also being emitted.

Tests are added for all four flags.
2026-05-14 17:36:08 -07:00
..