Dependency scanning currently performs an implicit build. When testing that Clang can build modules with the command-lines generated by clang-scan-deps, the actual compilation would overwrite artifacts created during the scan, which makes debugging harder than it should be and can lead to errors in multi-step builds.
To prevent this, this patch adds new flag to clang-scan-deps that allows developers to customize the directory to use when generating module map paths, instead of always using the module cache. Moreover, the explicit context hash in now part of the PCM path, which will be useful in D102488, where the context hash can change due to command-line pruning.
This was a bit confusing at first. I think it would be better to say that the paths that it returns are using this directory as a base. clang-scan-deps doesn't actually put files in here itself, it just returns paths that use it.