[4.2 EARLY] [Serialization] Always list the bridging header before any imports #17300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: When debugging, we want to mimic the compilation environment as closely as possible so that Objective-C declarations are imported the same way. In cases where non-modular headers were being included both in imported modules and in a bridging header, we were getting different behavior between compilation and debugging, leading to crashes. This change makes sure that the debugger will load any bridging header first, like the compiler does.
Scope: Affects all app targets with bridging headers, but should have no significant effect except where a textual header is included in multiple ways.
Issue: rdar://problem/40471329
Risk: Medium-low. In an ideal world this has no effect at all; in a practical world we expect it to improve things. There's a small chance that someone was depending on the previous behavior for their real-world code, but it's hard to see how it would have compiled successfully in that case.
Testing: Added compiler regression tests.
Reviewed by: @DougGregor