Commit Graph
4 Commits
Author SHA1 Message Date
Jon Ross-Perkins 584a50d0dc Fix check-diagnostics for pre-commit (#2683)
Unused diagnostics were incorrectly always returning "false" regardless of whether there was an issue. It was still looking for registry file changes, not kind file changes. Also, this should only be run once per pre-commit run (pass_filenames=false).

Remove the one unused diagnostic.
2023-03-15 18:01:48 -07:00
Jon Ross-Perkins 3d90a85f24 Change DiagnosticKind to use EnumBase (#2532)
Although the implementation is similar in size, I think the consistency benefits are helpful. registry.def -> kind.def is also consistent with other implementations.

Also switching int32_t -> uint16_t because I think we it might be enough space (?). We use uint8_t elsewhere, but that's certainly going to be too small. Sticking with int32_t felt inconsistent.
2023-01-18 17:47:28 -08:00
Jon Ross-PerkinsandChandler Carruth 04d3901b7f Switch Diagnostic structure to use DiagnosticMessage to avoid pointers (#2502)
Followup for #2490 

The switch of DiagnosticMessage to have DiagnosticMessage means we don't need to use unique_ptr. This means that copy constructors are implicit again and don't need to be avoided, but per discussion still keeping with moves. Comments on HandleDiagnostic try to capture the use of moves there.

I'm keeping DiagnosticLevel at the top-level, and adding some checking that notes are actually Notes.

Also, adding MakeMessage to unify some of the logic (this has particularly been bugging me around format_fn, and I ran into it here because of the Diagnostic -> DiagnosticMessage change). The addition of NoTypeDeduction is intended to avoid some duplicative comments that'd been piling up.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-12-28 16:47:33 -08:00
Jon Ross-Perkins 733965704a Start building some checking of diagnostic use. (#2487)
In theory we're doing a central registry so that we can ensure there's at least one test for each. This isn't doing that, but I'm trying to validate that the central registry isn't leading to duplicates or abandoned checks (and catching a couple of each).
2022-12-27 08:43:58 -08:00