From: Simon Pilgrim Date: Wed, 2 Oct 2019 11:49:32 +0000 (+0000) Subject: Log2_32 returns an unsigned. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b143ac238d751545002b8e1ba8de3e7f2ce19c56;p=clang 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 --- 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;