Skip to content

Commit de79a71

Browse files
committed
[rebranch] Delegate to DenseMapInfo<APInt> where possible
`WidthPreservingAPIntDenseMapInfo` uses the same `getHashValue` and `isEqual` as the normal `DenseMapInfo` but with different empty and tombstone keys. `hash_value` is no longer a complete type, so just delegate to `DenseMapInfo<APInt>` rather than add another `#include`.
1 parent edfe2cb commit de79a71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Basic/APIntMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ struct WidthPreservingAPIntDenseMapInfo {
3838
}
3939

4040
static unsigned getHashValue(const APInt &Key) {
41-
return static_cast<unsigned>(hash_value(Key));
41+
return llvm::DenseMapInfo<APInt>::getHashValue(Key);
4242
}
4343

4444
static bool isEqual(const APInt &LHS, const APInt &RHS) {
45-
return LHS.getBitWidth() == RHS.getBitWidth() && LHS == RHS;
45+
return llvm::DenseMapInfo<APInt>::isEqual(LHS, RHS);
4646
}
4747
};
4848

0 commit comments

Comments
 (0)