[llvm] 5922b92 - Silence a signed/unsigned mismatch warning; NFC

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 10:32:27 PDT 2022


Author: Aaron Ballman
Date: 2022-10-06T13:32:15-04:00
New Revision: 5922b920604778fea550cf542833a258f5c185a3

URL: https://github.com/llvm/llvm-project/commit/5922b920604778fea550cf542833a258f5c185a3
DIFF: https://github.com/llvm/llvm-project/commit/5922b920604778fea550cf542833a258f5c185a3.diff

LOG: Silence a signed/unsigned mismatch warning; NFC

Added: 
    

Modified: 
    llvm/include/llvm/ADT/APFixedPoint.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h
index aa1a7bfed6b5..e151089b75bb 100644
--- a/llvm/include/llvm/ADT/APFixedPoint.h
+++ b/llvm/include/llvm/ADT/APFixedPoint.h
@@ -56,7 +56,7 @@ class FixedPointSemantics {
   /// Check if the Semantic follow the requirements of an older more limited
   /// version of this class
   bool isValidLegacySema() const {
-    return LsbWeight <= 0 && Width >= -LsbWeight;
+    return LsbWeight <= 0 && static_cast<int>(Width) >= -LsbWeight;
   }
   unsigned getWidth() const { return Width; }
   unsigned getScale() const { assert(isValidLegacySema()); return -LsbWeight; }


        


More information about the llvm-commits mailing list