Skip to content

[Metadata/IRGen] NFC: Couple of field metadata related improvements #14776

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
Feb 22, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 21, 2018

This PR does following:

  • Enables field descriptor caching (after my previous changes remove field name/type accessors);
  • Adjusts structure of the class context descriptor in IRGen

Resolves: rdar://problem/26060144

@xedin xedin requested a review from jckarter February 21, 2018 23:05
@xedin
Copy link
Contributor Author

xedin commented Feb 21, 2018

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 21, 2018

@swift-ci please test source compatibility

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Just one C semantics nitpick. This LGTM otherwise.


int compareWithKey(const Metadata *other) const {
return Base == other;
return Type == other ? 0 : (Type < other ? -1 : 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Comparing unrelated pointers is UB in C/C++. Strictly, you need to do (uintptr_t)Type < (uintptr_t)Other there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah interesting, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@xedin xedin force-pushed the rdar-26060144-improvements branch from 91e822e to 333f614 Compare February 21, 2018 23:27
@xedin
Copy link
Contributor Author

xedin commented Feb 21, 2018

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 21, 2018

@swift-ci please test source compatibility

@swiftlang swiftlang deleted a comment from swift-ci Feb 21, 2018
@swiftlang swiftlang deleted a comment from swift-ci Feb 21, 2018
@xedin xedin merged commit c1b48a2 into swiftlang:master Feb 22, 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.

2 participants