[llvm] r375213 - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 02:59:31 PDT 2019


Author: rksimon
Date: Fri Oct 18 02:59:31 2019
New Revision: 375213

URL: http://llvm.org/viewvc/llvm-project?rev=375213&view=rev
Log:
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI.

Modified:
    llvm/trunk/lib/Object/MachOUniversal.cpp
    llvm/trunk/tools/llvm-objdump/MachODump.cpp

Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=375213&r1=375212&r2=375213&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Fri Oct 18 02:59:31 2019
@@ -164,7 +164,7 @@ MachOUniversalBinary::MachOUniversalBina
                            ") (maximum 2^" + Twine(MaxSectionAlignment) + ")");
       return;
     }
-    if(A.getOffset() % (1 << A.getAlign()) != 0){
+    if(A.getOffset() % (1ull << A.getAlign()) != 0){
       Err = malformedError("offset: " + Twine(A.getOffset()) +
         " for cputype (" + Twine(A.getCPUType()) + ") cpusubtype (" +
         Twine(A.getCPUSubType() & ~MachO::CPU_SUBTYPE_MASK) +

Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=375213&r1=375212&r2=375213&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Fri Oct 18 02:59:31 2019
@@ -2199,7 +2199,7 @@ static void printMachOUniversalHeaders(c
     outs() << "    offset " << OFA.getOffset();
     if (OFA.getOffset() > size)
       outs() << " (past end of file)";
-    if (OFA.getOffset() % (1 << OFA.getAlign()) != 0)
+    if (OFA.getOffset() % (1ull << OFA.getAlign()) != 0)
       outs() << " (not aligned on it's alignment (2^" << OFA.getAlign() << ")";
     outs() << "\n";
     outs() << "    size " << OFA.getSize();




More information about the llvm-commits mailing list