[llvm] 79daad3 - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 03:00:50 PDT 2024


Author: Simon Pilgrim
Date: 2024-08-07T11:00:23+01:00
New Revision: 79daad3479fa4eb9d704ba2e6814c1b74302d740

URL: https://github.com/llvm/llvm-project/commit/79daad3479fa4eb9d704ba2e6814c1b74302d740
DIFF: https://github.com/llvm/llvm-project/commit/79daad3479fa4eb9d704ba2e6814c1b74302d740.diff

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

Added: 
    

Modified: 
    llvm/lib/Object/COFFObjectFile.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 09dd3d2cbb8d8..64b5eaf860b44 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -2012,7 +2012,7 @@ bool Arm64XRelocRef::operator==(const Arm64XRelocRef &Other) const {
 uint8_t Arm64XRelocRef::getEntrySize() const {
   switch (getType()) {
   case COFF::IMAGE_DVRT_ARM64X_FIXUP_TYPE_VALUE:
-    return (1u << getArg()) / sizeof(uint16_t) + 1;
+    return (1ull << getArg()) / sizeof(uint16_t) + 1;
   case COFF::IMAGE_DVRT_ARM64X_FIXUP_TYPE_DELTA:
     return 2;
   default:


        


More information about the llvm-commits mailing list