Cast arithmetic results to avoid comparison of an unsigned to an int.
---
 llvm/tools/clang/lib/CodeGen/CGExpr.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/llvm/tools/clang/lib/CodeGen/CGExpr.cpp 
b/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
index 461126e..faffcae 100644
--- a/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
+++ b/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
@@ -1191,7 +1191,7 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue 
LV) {
   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");
-- 
1.7.8.4

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to