aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2007-04-21 14:32:59 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2007-04-21 14:32:59 +0000
commit68c773cf193ceb5060b5130a64b43388b34b4ec9 (patch)
tree3bb646ee5c028a437baa79a7dcba1cb14b6a6a6a /include
parent2330e4d4c4f8008d17f5a38ac0d7b04e139d4131 (diff)
downloadexternal_llvm-68c773cf193ceb5060b5130a64b43388b34b4ec9.zip
external_llvm-68c773cf193ceb5060b5130a64b43388b34b4ec9.tar.gz
external_llvm-68c773cf193ceb5060b5130a64b43388b34b4ec9.tar.bz2
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instructions.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 0a61d12..40e3174 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 {