[clang][tooling] Create SourceManager for DiagnosticsEngine before command-line parsing
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.
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D99414
GitOrigin-RevId: 2935737da32dd21bf02e1a3c912a340de660d557
2 files changed