The dependency scanning worker may create an in-memory VFS and inject that into its FileManager. (Implemented in D109485.) This VFS currently persists between scans, which is not correct: in-memory files created in one scan could affect subsequent scans. This patch changes things so that the in-memory VFS is local to DependencyScanningWorker::computeDependencies().
To test this, one would first scan for dependencies of a named module and then run second scan (on the same worker) for something unrelated, which would pick up the in-memory file created in the first scan. This set up is impossible to achieve with clang-scan-deps. We could set this up in ToolingTests, but the scanner needs to access the physical filesystem to store .pcm files. AFAIK we don't have a good way to propagate something like %t into unit tests to make that feasible. (This could be achieved with something like the virtualized OutputManager.)
This move seems like a problem when only one worker is made.