[llvm] ADT: Add constructor from uint64_t array for Bitset (PR #162703)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 9 19:04:49 PDT 2025
================
@@ -45,7 +45,18 @@ class Bitset {
StorageType Bits{};
protected:
- constexpr Bitset(const StorageType &B) : Bits{B} {}
+ constexpr Bitset(const std::array<uint64_t, (NumBits + 63) / 64> &B) {
+ if (sizeof(BitWord) == sizeof(uint64_t)) {
+ for (size_t I = 0; I != B.size(); ++I)
+ Bits[I] = B[I];
+ } else {
+ for (size_t I = 0; I != B.size(); ++I) {
+ uint64_t Elt = B[I];
----------------
arsenm wrote:
It's already static_asserted above, I guess I could move the assertion down
https://github.com/llvm/llvm-project/pull/162703
More information about the llvm-commits
mailing list