To prevent the creation of diagnostics file, clang-scan-deps strips the corresponding command-line argument. This behavior is useful even when using the C++ DependencyScanner library.
This patch transforms stripping of command-line in clang-scan-deps into stripping of CompilerInvocation in DependencyScanning.
AFAIK, the clang-cl driver doesn't even accept --serialize-diagnostics, so I've removed the test. (It would fail with an unknown command-line argument otherwise.)
Note: Since we're generating command-lines for modular dependencies from CompilerInvocation, the --serialize-diagnostics will be dropped. This was already happening in clang-scan-deps before this patch, but it will now happen also when using DependencyScanning library directly. This is resolved in D104036.