[llvm] r278512 - Fix type to avoid problems on 32-bit builds

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 07:55:43 PDT 2016


Author: tejohnson
Date: Fri Aug 12 09:55:43 2016
New Revision: 278512

URL: http://llvm.org/viewvc/llvm-project?rev=278512&view=rev
Log:
Fix type to avoid problems on 32-bit builds

lto::InputFile::Symbol::getCommonSize should return uint64_t instead of
size_t since it is returning the result of DataLayout::getTypeAllocSize
which returns uint64_t, and the result of getCommonSize is assigned to a
uint64_t variable. On 32-bit builds size_t is unsigned int and there are
type errors. This was introduced in r278338.

Modified:
    llvm/trunk/include/llvm/LTO/LTO.h

Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=278512&r1=278511&r2=278512&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Fri Aug 12 09:55:43 2016
@@ -178,7 +178,7 @@ public:
         return GV->getComdat();
       return nullptr;
     }
-    size_t getCommonSize() const {
+    uint64_t getCommonSize() const {
       assert(Flags & object::BasicSymbolRef::SF_Common);
       if (!GV)
         return 0;




More information about the llvm-commits mailing list