This patch adds the necessary infrastructure bindings and overloads that
allow checks to implement collecting and emitting per-TU data to a
directory from which the diagnosis mode can read it and decide whether
to diagnose.
What checks emit and how they transform the data is a per-check
implementation detail.
I'd add the braces for readability despite them not being strictly required.