[llvm-commits] [llvm] r114796 - in /llvm/trunk/include/llvm: Analysis/DebugInfo.h Attributes.h Operator.h

Oscar Fuentes ofv at wanadoo.es
Sat Sep 25 13:27:36 PDT 2010


Author: ofv
Date: Sat Sep 25 15:27:36 2010
New Revision: 114796

URL: http://llvm.org/viewvc/llvm-project?rev=114796&view=rev
Log:
Avoid warnings about implicit conversions to `bool' in MSVC. This time
for real.

Patch by Nathan Jeffords!

Modified:
    llvm/trunk/include/llvm/Analysis/DebugInfo.h
    llvm/trunk/include/llvm/Attributes.h
    llvm/trunk/include/llvm/Operator.h

Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=114796&r1=114795&r2=114796&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Sat Sep 25 15:27:36 2010
@@ -160,8 +160,8 @@
     /// 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); }
 

Modified: llvm/trunk/include/llvm/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Attributes.h?rev=114796&r1=114795&r2=114796&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Attributes.h (original)
+++ llvm/trunk/include/llvm/Attributes.h Sat Sep 25 15:27:36 2010
@@ -223,7 +223,7 @@
   /// 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

Modified: llvm/trunk/include/llvm/Operator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=114796&r1=114795&r2=114796&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Operator.h (original)
+++ llvm/trunk/include/llvm/Operator.h Sat Sep 25 15:27:36 2010
@@ -99,7 +99,7 @@
   /// 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; }





More information about the llvm-commits mailing list