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
Import CGFloat as CoreFoundation.CGFloat if possible #40856
Conversation
lib/ClangImporter/ImportDecl.cpp
Outdated
@@ -250,6 +250,29 @@ getSwiftStdlibType(const clang::TypedefNameDecl *D, | |||
} | |||
#include "MappedTypes.def" | |||
|
|||
if (Name.str() == "CGFloat") { | |||
SwiftModuleName = StringRef("CoreGraphics"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the StringRef()s are necessary
@swift-ci test source compatibility |
Multiple source failures producing this error: |
Also, is there a way to run this test suite locally? |
Also adding @xymus as an additional reviewer. Do we really need to hard-code this information into the importer? Does it imply a deeper issue in modulization. |
c06eb54
to
6d269e5
Compare
@swift-ci please smoke test |
@swift-ci please test source compatibility |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks okay if it's passing tests
M = Impl.getNamedModule("CoreGraphics"); | ||
SwiftType = Impl.getNamedSwiftType(M, SwiftTypeName); | ||
} | ||
|
||
if (!SwiftType && !CanBeMissing) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a slight behavior change here that might explain the failure in module-cache-diagnostics.swift
: when there is no module and CanBeMissing
, the old code would unconditionally return std::make_pair(Type(), "")
. The new code will return std::make_pair(Type(), SwiftTypeName)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that. I'll add the module check back
The lldb failure was due to the fact that lldb reuses the ClangImporter/MappedTypes.def file. Inverting the fallback logic and keeping the MappedTypes.def file unmodified fixes the failure. This should pass the smoke test now. Can someone please run the smoke test? |
@swift-ci please smoke test |
The Windows failure looks unrelated. #40954 is also hitting the same failure. |
@swift-ci please test Windows |
Resolves rdar://87605416