Skip to content

[NFC] Replace std::unordered_map with llvm::DenseSet in metadata reader #68465

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 1 commit into from
Sep 14, 2023

Conversation

augusto2112
Copy link
Contributor

No description provided.

@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

/// The dense map info for a std::pair<StoredPointer, bool>.
struct DenseMapInfoTypeCacheKey {
using Pair = std::pair<StoredPointer, bool>;
using StoredPointerInfo = llvm::DenseMapInfo<StoredPointer>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be necessary. DenseMapInfo has already a generic specialization for std::pair as long as both elements are supported. You should only need to define this for StoredPointer if at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DenseMapInfo has already a generic specialization for std::pair as long as both elements are supported

bool is not supported since it can't implement getEmptyKey or getTombstoneKey. This implementation uses only the StoredPointer's implementation for both those functions.

@augusto2112 augusto2112 merged commit 79cdadf into swiftlang:main Sep 14, 2023
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