Use DiagnosticEmitter for phase-specific types (#5188)

Given the namespacing of `Diagnostics` in #5173, now we can use
`DiagnosticEmitter` for phase-specific emitters. This is consistent with
how we do `Context`, and also check had started this with
`DiagnosticBuilder` in anticipation of the namespacing.

Also renames `Emitter::DiagnosticBuilder` to `Emitter::Builder` for
consistency with other `Diagnostics` entities.

In check, I'm still splitting `DiagnosticEmitterBase` and
`DiagnosticEmitter` just to keep the emitter definition separate from
the context.

Also cleans up some incorrect check diagnostic emitter dependencies in
lower.
This commit is contained in:
Jon Ross-Perkins
2025-03-27 00:41:30 +00:00
committed by GitHub
parent 9d3e1d3c55
commit 0a3efb76ed
17 changed files with 87 additions and 87 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ static auto StartDiagnoseNotAllowed(
Context& context,
const Diagnostics::DiagnosticBase<TokenKinds...>& diagnostic_base,
Parse::NodeId modifier_node, Lex::TokenKind declaration_kind)
-> Diagnostics::Emitter<SemIRLoc>::DiagnosticBuilder {
-> DiagnosticBuilder {
if constexpr (sizeof...(TokenKinds) == 0) {
return context.emitter().Build(modifier_node, diagnostic_base);
} else if constexpr (sizeof...(TokenKinds) == 1) {