[clang][deps] Report directory dependencies of modules to build systems (#229559)
Validating directory dependencies inside the compiler means walking
every directory whenever a module is loaded. A build system already
watches the file system, so let it do that instead.
The dependency scanner now reports the directories each module depends
on the listing of, and a build system can pass back the ones that
changed on later incremental scans, so that cached scanning modules
depending on them are rebuilt. The API takes paths rather than
directories so that files can be reported the same way in the future,
but only directories are checked for now.
This is supported by clang-scan-deps via `directory-deps` in the
`experimental-full` output and the `-invalidated-path=` flag.
Assisted-by: Claude Code: opus-5.5