From: Jeff Cohen Date: Sat, 21 Apr 2007 14:32:59 +0000 (+0000) Subject: The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=68c773cf193ceb5060b5130a64b43388b34b4ec9;p=oota-llvm.git The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what was intended! | has higher precedence than ?. Caught by Visual Studio. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36302 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 0a61d120c25..40e31745ee5 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -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 {