[cfe-commits] r172570 - /cfe/trunk/lib/CodeGen/CGExpr.cpp

David Greene greened at obbligato.org
Tue Jan 15 15:13:47 PST 2013


Author: greened
Date: Tue Jan 15 17:13:47 2013
New Revision: 172570

URL: http://llvm.org/viewvc/llvm-project?rev=172570&view=rev
Log:
Avoid unsigned Compare to int

Cast arithmetic results to avoid comparison of an unsigned to an int.

Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=172570&r1=172569&r2=172570&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Jan 15 17:13:47 2013
@@ -1191,7 +1191,7 @@
   cast<llvm::LoadInst>(Val)->setAlignment(Info.StorageAlignment);
 
   if (Info.IsSigned) {
-    assert((Info.Offset + Info.Size) <= Info.StorageSize);
+    assert(static_cast<unsigned>(Info.Offset + Info.Size) <= Info.StorageSize);
     unsigned HighBits = Info.StorageSize - Info.Offset - Info.Size;
     if (HighBits)
       Val = Builder.CreateShl(Val, HighBits, "bf.shl");





More information about the cfe-commits mailing list