Skip to content

Fix some problems in ClangTypeConverter::getFunctionType #28726

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 3 commits into from
Dec 13, 2019
Merged

Fix some problems in ClangTypeConverter::getFunctionType #28726

merged 3 commits into from
Dec 13, 2019

Conversation

varungandhi-apple
Copy link
Contributor

Includes the fix for the thing pointed out in #28527.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please smoke test

@varungandhi-apple
Copy link
Contributor Author

Oops, this broke pointer equality as we create a duplicate function type.

@varungandhi-apple
Copy link
Contributor Author

I think there are two options here: (a) @slavapestov's solution is suboptimal (I guess we don't check for equality there, so it only increases memory usage due to missed uniquing but doesn't affect correctness) or (b) this is a Clang bug where the ExtParameterInfos field being nullptr (the default field value in ExtProtoInfo) is not treated the same way as a pointer to an array filled with default-initialized ExtParameterInfos.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please smoke test

@varungandhi-apple
Copy link
Contributor Author

The middle commit now makes sure that we add the clang::PointerType correctly so we don't need to fiddle with this at different potential call-sites.

@swift-ci please smoke test

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@varungandhi-apple varungandhi-apple merged commit a6f5c57 into swiftlang:master Dec 13, 2019
@varungandhi-apple varungandhi-apple deleted the vg-fix-ClangTypeConverter.getFunctionType branch December 13, 2019 01:41
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.

2 participants