mirror of
https://github.com/apple/swift.git
synced 2026-06-27 12:25:55 +02:00
8d1e4c4988
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