Clang-cl.exe support for C++ modules

The issue can be summarised as such. Given the following foo.cxx:

export module foo;
export int from_foo()
{
  return 0;
}

Running the following outputs foo.pcm, but doesn’t output foo.bmi as requested by -Fo:

clang-cl.exe -std:c++20 --precompile -x c++-module -fmodule-output=foo.bmi -Fo"foo.bmi" -c foo.cxx

However, running the following outputs foo.bmi as requested:

clang++.exe -std=c++20 --precompile -x c++-module -fmodule-output=foo.bmi -o foo.bmi -c foo.cxx

This behaviour is then used by clang-scan-deps to output the dependency scanning JSON. In the former case since no .bmi is output, the corresponding value of the primary-output key here is "-".

I’d like to understand how the Clang driver builds its output files. I’ve read through Driver Design and Internals but the debug/trace options there don’t emit the information I need, so I am stuck to running it under the debugger.