mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We do this so that the swiftmodule file contains all info necessary to reconstruct the AST for debugging purposes. If the swiftmodule file is copied into a dSYM bundle, it can (in theory) be used to debug a built app months later. The header is processed with -frewrite-includes so that it includes any non-modular content; the user will not have to recreate their project structure and header maps to reload the AST. There is some extra complexity here: a target with a bridging header (such as a unit test target) may depend on another target with a bridging header (such as an app target). This is a rare case, but one we'd like to still keep working. However, if both bridging headers import some common.h, we have a problem, because -frewrite-includes will lose the once-ness of #import. Therefore, we /also/ store the path, size, and mtime of a bridging header in the swiftmodule, and prefer to use a regular parse from the original file if it can be located and hasn't been changed. <rdar://problem/17688408> Swift SVN r20128
33 KiB
33 KiB