Skip to content
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

Unify and fix hashset/hashmap implementations #1108

Open
bryanpkc opened this issue Jul 13, 2021 · 0 comments
Open

Unify and fix hashset/hashmap implementations #1108

bryanpkc opened this issue Jul 13, 2021 · 0 comments

Comments

@bryanpkc
Copy link
Collaborator

Classic Flang contains two implementations of hashset and hashmap that are almost identical:

The first one is used by flang1, and the second is used by flang2. It seems that plan was to reuse the code between flang1 and flang2, but that effort was abandoned half-way through. It would be nice to unify these implementations.

Both of these implementations suffer require type casts on arguments to their APIs. Specifically, hash_key_t and hash_data_t are typedef-ed to const void *, and throughout the code base these casts often have to add or drop the const qualifier, resulting in -Wcast-qual warnings, which turn into compile-time errors when -Werror is enabled. #1073 avoided these warnings with diagnostic pragmas, but ideally the APIs could be rewritten to avoid dropping the const qualifier, or at least to reduce the number of places where pragmas are needed.

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

No branches or pull requests

1 participant