Skip to content

[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

Merged
merged 2 commits into from
Mar 24, 2018

Conversation

dcci
Copy link
Member

@dcci dcci commented Mar 22, 2018

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

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>
@dcci
Copy link
Member Author

dcci commented Mar 22, 2018

@swift-ci please test

Copy link
Contributor

@jrose-apple jrose-apple left a 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. :-(

// {
// }
// }
// }
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5831fc9

@dcci
Copy link
Member Author

dcci commented Mar 22, 2018

hmm, this seems to fail on iphonesimulator-i386
I'm not sure what's different there, any clue? (or is there an easy way for me to reproduce?)

@jrose-apple
Copy link
Contributor

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.

@dcci
Copy link
Member Author

dcci commented Mar 23, 2018

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>
@dcci
Copy link
Member Author

dcci commented Mar 23, 2018

Pushing a stopgap solution to unblock Adrian, and I'll take care of refactoring next

@dcci
Copy link
Member Author

dcci commented Mar 23, 2018

@swift-ci please test and merge

@dcci
Copy link
Member Author

dcci commented Mar 23, 2018

@swift-ci please smoke test and merge

@dcci
Copy link
Member Author

dcci commented Mar 24, 2018

@swift-ci please smoke test macosx

@dcci
Copy link
Member Author

dcci commented Mar 24, 2018

@shahmishal the linux bot got stuck somehow can you give it a kick?

@dcci
Copy link
Member Author

dcci commented Mar 24, 2018

@swift-ci please smoke test linux

@dcci
Copy link
Member Author

dcci commented Mar 24, 2018

@swift-ci plase smoke test linux

@dcci dcci merged commit fee9800 into swiftlang:master Mar 24, 2018
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.

3 participants