Files
swift-mirror/lib/DependencyScan
Steven Wu 8d1e4c4988 [BridgingHeader] Improve bridging header scanning to fix corner cases
Improve bridging header chaining when prefix mapping is used so it
matches the behavior of non-prefix-map and non-caching builds.
This also fixes a corner case where the same bridging header is used
by different modules in the dependency chain, preventing it from being
imported twice.

The improvements are:
* Fully utilize the clang scanner prefix mapping option, which can
  restore prefix-mapped paths during scanning to find the real file on
  the file system. This allows the generated bridging header to always
  reference the header path without worrying about introducing path
  dependencies.
* Move the header existence check from a file system access in the
  Swift scanner to a `__has_include` check in the clang scanner. This
  allows direct header import even when the header path is previously
  prefix mapped.
* Use `#import` to chain bridging headers so the same header will not
  be imported twice.

rdar://172870182
2026-03-19 16:42:19 -07:00
..