[PATCH] D156005: Use `getHashValue` in `SetVector::insert` and `SetVector::contains`

Evan Wilde via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 23:30:45 PDT 2023


etcwilde added a comment.

Sorry, should have used the the in the `DenseMapInfo<T>::isEqual`.

So for background, the issue that I'm running into right now is two-fold, this container used to accept types that didn't necessarily have equality (`operator==`) (except as defined by the DenseMapInfo), which made it very useful for storing unique non-equatable things like non-canonical types in a type system. This change means that that code doesn't compile anymore. Second, the `DenseMapInfo<T>::isEqual` and `DenseMapInfo<T>::getHashValue` from the `DenseMapInfo` used before aren't necessarily the same as `T::operator==`, which can result in different outcomes.

At least as far as I can tell, `DenseMapInfo<T>::isEqual` in `find_if` should result in the same result as before. Is there an issue with using going back to `DenseMapInfo<T>::isEqual` over `T::operator==`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156005/new/

https://reviews.llvm.org/D156005



More information about the llvm-commits mailing list