diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-02 11:49:32 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-02 11:49:32 +0000 |
commit | b143ac238d751545002b8e1ba8de3e7f2ce19c56 (patch) | |
tree | a51375f307a70404ff1007431598cd4808a5661f /lib/CodeGen | |
parent | ca954c8a5b16dc2552fec5b12104eb8185dc0bcb (diff) | |
download | clang-b143ac238d751545002b8e1ba8de3e7f2ce19c56.tar.gz |
Log2_32 returns an unsigned. NFCI.
Silences clang static analyzer warning about out of bounds (negative) shifts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373451 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index ee5c12aa35..ee0fd184c6 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -1854,7 +1854,8 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { ivarBuilder.addInt(Int32Ty, CGM.getContext().getTypeSizeInChars(ivarTy).getQuantity()); // Alignment will be stored as a base-2 log of the alignment. - int align = llvm::Log2_32(Context.getTypeAlignInChars(ivarTy).getQuantity()); + unsigned align = + llvm::Log2_32(Context.getTypeAlignInChars(ivarTy).getQuantity()); // Objects that require more than 2^64-byte alignment should be impossible! assert(align < 64); // uint32_t flags; |