Avoid warnings about implicit conversions to `bool' in MSVC. This time
authorOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Sep 2010 20:27:36 +0000 (20:27 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Sat, 25 Sep 2010 20:27:36 +0000 (20:27 +0000)
for real.

Patch by Nathan Jeffords!

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

include/llvm/Analysis/DebugInfo.h
include/llvm/Attributes.h
include/llvm/Operator.h

index d01178fe3fe7a5709f4a4dc77684a50020f09a84..d5733aeb75f7603037bc1169882e6ff3481a85a4 100644 (file)
@@ -160,8 +160,8 @@ namespace llvm {
     /// module does not contain any main compile unit then the code generator
     /// will emit multiple compile units in the output object file.
 
-    bool isMain() const                { return getUnsignedField(6); }
-    bool isOptimized() const           { return getUnsignedField(7); }
+    bool isMain() const                { return getUnsignedField(6) != 0; }
+    bool isOptimized() const           { return getUnsignedField(7) != 0; }
     StringRef getFlags() const       { return getStringField(8);   }
     unsigned getRunTimeVersion() const { return getUnsignedField(9); }
 
index 580ae7339e13b93787be3db0162d05c492cfc0c7..0325c89626b03f61dfb49e8ec1ee1119872505f1 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 static_cast<bool>(getAttributes(Idx) & Attr);
+    return (getAttributes(Idx) & Attr) != 0;
   }
 
   /// getParamAlignment - Return the alignment for the specified function
index d84841762534621d3daf180ad929c32a61b3312a..3aae586f1448c778bdfa59e6b8dd865846b28ac2 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 static_cast<bool>(SubclassOptionalData & NoSignedWrap);
+    return (SubclassOptionalData & NoSignedWrap) != 0;
   }
 
   static inline bool classof(const OverflowingBinaryOperator *) { return true; }