[llvm-commits] CVS: llvm/include/llvm/Instructions.h

Jeff Cohen jeffc at jolt-lang.org
Sat Apr 21 07:33:16 PDT 2007



Changes in directory llvm/include/llvm:

Instructions.h updated: 1.67 -> 1.68
---
Log message:

The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what
was intended!  | has higher precedence than ?.  Caught by Visual Studio.


---
Diffs of the changes:  (+2 -2)

 Instructions.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.67 llvm/include/llvm/Instructions.h:1.68
--- llvm/include/llvm/Instructions.h:1.67	Sat Apr 21 03:16:25 2007
+++ llvm/include/llvm/Instructions.h	Sat Apr 21 09:32:59 2007
@@ -246,7 +246,7 @@
 
   /// 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 @@
 
   /// 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 {






More information about the llvm-commits mailing list