In D84673, we started using DiagnosticsEngine during command-line parsing in more contexts.
When using ToolInvocation, a custom DiagnosticsConsumer can be specified and it might expect SourceManager to be present on the emitted diagnostics.
This patch ensures the SourceManager is set up in such scenarios.
Test authored by Jordan Rupprecht.