[clang][deps] Fix traversal of precompiled dependencies
authorJan Svoboda <jan_svoboda@apple.com>
Wed, 16 Mar 2022 10:48:34 +0000 (11:48 +0100)
committerJan Svoboda <jan_svoboda@apple.com>
Wed, 16 Mar 2022 11:17:53 +0000 (12:17 +0100)
commit1e25ff84d89e94ec7af6352b02e2d74a5e273a85
tree82571b20cc6bf3e5b2c86ddb20820b465c558673
parentd73daa9135463ad4d4a08a9f0a75e109f921ad54
[clang][deps] Fix traversal of precompiled dependencies

The code for traversing precompiled dependencies is somewhat complicated and contains a dangling iterator bug.

This patch simplifies the code and fixes the bug.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D121533
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
clang/test/ClangScanDeps/modules-pch-dangling.c [new file with mode: 0644]