Avoid warnings about conversions to `bool' in MS compilers.
authorOscar Fuentes <ofv@wanadoo.es>
Thu, 23 Sep 2010 16:59:44 +0000 (16:59 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Thu, 23 Sep 2010 16:59:44 +0000 (16:59 +0000)
Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114662 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Attributes.h
include/llvm/Operator.h

index 1296d67d5258e669c5b354f9fe6c856b1b543913..580ae7339e13b93787be3db0162d05c492cfc0c7 100644 (file)
@@ -223,7 +223,7 @@ public:
   /// paramHasAttr - Return true if the specified parameter index has the
   /// specified attribute set.
   bool paramHasAttr(unsigned Idx, Attributes Attr) const {
-    return getAttributes(Idx) & Attr;
+    return static_cast<bool>(getAttributes(Idx) & Attr);
   }
 
   /// getParamAlignment - Return the alignment for the specified function
index 60865aa8ad45113c1dc741dbacc8d6f46f252cfd..d84841762534621d3daf180ad929c32a61b3312a 100644 (file)
@@ -99,7 +99,7 @@ public:
   /// hasNoSignedWrap - Test whether this operation is known to never
   /// undergo signed overflow, aka the nsw property.
   bool hasNoSignedWrap() const {
-    return SubclassOptionalData & NoSignedWrap;
+    return static_cast<bool>(SubclassOptionalData & NoSignedWrap);
   }
 
   static inline bool classof(const OverflowingBinaryOperator *) { return true; }