-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TypeReconstruction] Fix reconstructions for allocator. #15432
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
Adrian reported this bug he discovered as part of his work on improving generics in swift/lldb. Allocators were treated as `function`, when the demangle tree suggests they're much more akin to constructors. On top of that, the code for handling them was commented out, so type reconstruction was always failing. I'm not entirely sure this is always correct, but it seems to be an improvement on what currently type reconstruction does. At least now we have tests so if something will break, we're going to notice. <rdar://problem/38720742>
@swift-ci please 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.
Yes, allocators are like constructors. :-(
// { | ||
// } | ||
// } | ||
// } |
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.
Did you mean to leave this commented out?
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.
Yes, because this was wrong code (in the wrong place). I decided to remove it altogether but happy to split it in a separate commit if you prefer.
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.
Oh, sorry, my brain thought this was an addition of commented-out code. I agree that it should be removed.
Build failed |
hmm, this seems to fail on |
That might just mean it doesn't work on any simulator. You can run simulator tests locally if you built with Ninja and not Xcode by using the test-iphonesimulator-* directories instead of test-macosx-x86_64. |
Thanks to Jordan's help I found out this breaks a test on i386-simulator because it always set the default target triple instead of the one of the module. I'm going to fix that. |
We're going to infer all these informations from the module, but that's a large refactoring task which I'm going to do next. In the meanwhile, this should allow Adrian's work to be unblocked. <rdar://problem/38720742>
Pushing a stopgap solution to unblock Adrian, and I'll take care of refactoring next |
@swift-ci please test and merge |
@swift-ci please smoke test and merge |
@swift-ci please smoke test macosx |
@shahmishal the linux bot got stuck somehow can you give it a kick? |
@swift-ci please smoke test linux |
@swift-ci plase smoke test linux |
Adrian reported this bug he discovered as part of his
work on improving generics in swift/lldb.
Allocators were treated as
function
, when the demangletree suggests they're much more akin to constructors. On
top of that, the code for handling them was commented out,
so type reconstruction was always failing. I'm not entirely
sure this is always correct, but it seems to be an improvement
on what currently type reconstruction does. At least now
we have tests so if something will break, we're going to
notice.
rdar://problem/38720742