[llvm] 8c2cece - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC. (#161496)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 03:06:41 PDT 2025


Author: Simon Pilgrim
Date: 2025-10-01T10:06:36Z
New Revision: 8c2cece14deaaa175bc665e20228280fbe6d019d

URL: https://github.com/llvm/llvm-project/commit/8c2cece14deaaa175bc665e20228280fbe6d019d
DIFF: https://github.com/llvm/llvm-project/commit/8c2cece14deaaa175bc665e20228280fbe6d019d.diff

LOG: Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC. (#161496)

Added: 
    

Modified: 
    llvm/lib/CAS/OnDiskTrieRawHashMap.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CAS/OnDiskTrieRawHashMap.cpp b/llvm/lib/CAS/OnDiskTrieRawHashMap.cpp
index 9b382dd749ea5..940389336ce22 100644
--- a/llvm/lib/CAS/OnDiskTrieRawHashMap.cpp
+++ b/llvm/lib/CAS/OnDiskTrieRawHashMap.cpp
@@ -114,7 +114,7 @@ class SubtrieHandle {
   using SlotT = std::atomic<int64_t>;
 
   static int64_t getSlotsSize(uint32_t NumBits) {
-    return sizeof(int64_t) * (1u << NumBits);
+    return sizeof(int64_t) * (1ull << NumBits);
   }
 
   static int64_t getSize(uint32_t NumBits) {
@@ -191,7 +191,8 @@ class SubtrieHandle {
   MutableArrayRef<SlotT> Slots;
 
   static MutableArrayRef<SlotT> getSlots(Header &H) {
-    return MutableArrayRef(reinterpret_cast<SlotT *>(&H + 1), 1u << H.NumBits);
+    return MutableArrayRef(reinterpret_cast<SlotT *>(&H + 1),
+                           1ull << H.NumBits);
   }
 };
 


        


More information about the llvm-commits mailing list