[llvm] 0394888 - Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFC
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 03:26:55 PDT 2024
Author: Simon Pilgrim
Date: 2024-10-30T10:12:57Z
New Revision: 03948882d3bac33cf71a47df1c7ee0f87aad9fc2
URL: https://github.com/llvm/llvm-project/commit/03948882d3bac33cf71a47df1c7ee0f87aad9fc2
DIFF: https://github.com/llvm/llvm-project/commit/03948882d3bac33cf71a47df1c7ee0f87aad9fc2.diff
LOG: Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFC
NumBits should be less than 20 so using an unsigned instead of size_t should be OK
Added:
Modified:
llvm/lib/Support/TrieRawHashMap.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/TrieRawHashMap.cpp b/llvm/lib/Support/TrieRawHashMap.cpp
index 4741f3d4db0490..11d79a62d011dd 100644
--- a/llvm/lib/Support/TrieRawHashMap.cpp
+++ b/llvm/lib/Support/TrieRawHashMap.cpp
@@ -79,7 +79,7 @@ class TrieSubtrie final
static constexpr size_t sizeToAlloc(unsigned NumBits) {
assert(NumBits < 20 && "Tries should have fewer than ~1M slots");
- size_t Count = 1u << NumBits;
+ unsigned Count = 1u << NumBits;
return totalSizeToAlloc<LazyAtomicPointer<TrieNode>>(Count);
}
More information about the llvm-commits
mailing list