Make enum-valued bitfield large enough to avoid interpretation as negative values...
[oota-llvm.git] / include / llvm / Instructions.h
index 0a61d120c25590fa67a0cf3e822c993230c4f9fa..40e31745ee59687d9b951b274e28f27b674e6af6 100644 (file)
@@ -246,7 +246,7 @@ public:
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; }
+  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); }
 
   virtual LoadInst *clone() const;
 
@@ -311,7 +311,7 @@ public:
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; }
+  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | unsigned(V); }
 
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {