Required in https://reviews.llvm.org/D137534.
The build systems needs the information to know that "header X changed, scanning may have changed, so please rerun scanning". Although it is possible to get the information by running clang-scan-deps for the second time with make format, it is not user friendly clearly.
For scanning, this cannot be the object file. The output needs to be the P1689 output (or whatever the "main output" for the scanning rule is). This is the purpose behind the -MT <target> flag: to say what goes in this slot. I think it'll be necessary here (even if clang-scan-deps learns an -o flag because it is the build system that determines the "primary output").
I don't know if the -MMD and -MD differences are important or not; I don't think I particularly care which is default (I've used -MD FWIW), but it may matter for other situations.