Skip to content

[4.2] [Serialization] Track whether a cross-reference came from Clang #17377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jrose-apple
Copy link
Contributor

Cherry-pick of #17333 to the 4.2 branch. Reviewed by @DougGregor and @rjmccall.

rdar://problem/40839486

…tlang#17333)

Cross-references are identified by their containing module, with the
assumption that two modules will never have the same name. However, an
overlay has the same name as its underlying Clang module, which means
that there can be two declarations with the same name, the same type,
and the same module name. This is the underlying cause of the
'UIEdgeInsetsZero' problem, but it also affects the CloudKit overlay.

By tracking a bit that just says "this came from Clang", we're able
to resolve otherwise ambiguous cross-references.

(Why didn't we do it this way all along? Because if a declaration
moves from Clang to Swift or vice versa, that would break the
cross-reference. But that's only interesting if the swiftmodule format
is meant to be persistent across changing dependencies, and it looks
like we're moving away from that anyway. It's also a little weird for
SerializedModuleLoader to have special cases for Clang, but this isn't
the first.)

Note that I'm not reverting the UIEdgeInsetsZero workaround here; the
end state will have that coming just from UIKit as originally
described.

rdar://problem/40839486
(cherry picked from commit 6b89415)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit 5163888 into swiftlang:swift-4.2-branch Jun 21, 2018
@jrose-apple jrose-apple deleted the 4.2-reference-types-but-not-those-reference-types branch June 21, 2018 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant