🍒[cxx-interop] Import CF_OPTIONS types such as Foundation.NSTextCheckingType
correctly
#67308
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: This fixes linker errors which occurred when using Foundation extensions to
Swift.String
, such asfunc replacingOccurrences
. After the last rebranch, Clang started wrapping certain types inclang::ElaboratedType
. This caused CF_OPTIONS types such asFoundation.NSTextCheckingType
to be imported incorrectly in C++ language mode (NSTextCheckingType
was imported asuint64_t
without getting the special treatment of a CF type), which was causing deserialization errors when Swift tried readingFoundation.swiftmodule
. Those deserialization errors were silenced by default. The IR for those functions was not emitted, which caused linker errors later.Scope: This teaches ClangImporter to unwrap
clang::ElaboratedType
when it handles CF typedefs.Risk: Low, this brings back the pre-rebranch behavior.
Original PR: #67301
rdar://109830032
(cherry picked from commit e6b830b)