aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-01-11 14:31:10 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-01-11 14:31:10 +0000
commit9c799ffbbe47253e675c8bc67782275c17f5a3ab (patch)
tree9545d8bd5d0686c8ecdf059c6f6c44ce20246572
parent6b6b6ef1677fa71b1072c2911b4c1f9524a558c9 (diff)
downloadexternal_llvm-9c799ffbbe47253e675c8bc67782275c17f5a3ab.tar.gz
external_llvm-9c799ffbbe47253e675c8bc67782275c17f5a3ab.tar.bz2
external_llvm-9c799ffbbe47253e675c8bc67782275c17f5a3ab.zip
Fixed a bug in ConstantInt::Inverted().
Modified comment of that method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33074 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Constants.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index de9730c096..e8d1460d8f 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -96,13 +96,13 @@ public:
/// @brief Get a ConstantInt for a specific value.
static ConstantInt *get(const Type *Ty, int64_t V);
- /// Returns the opposite value of this ConstantInt value if it's a boolean
- /// constant.
+ /// Returns the opposite value of this ConstantInt.
/// @brief Get inverse value.
inline ConstantInt *inverted() const {
static ConstantInt *CI = 0;
if (CI) return CI;
- return CI = new ConstantInt(getType(), Val ^ (-1));
+ return CI = new ConstantInt(getType(),
+ Val ^ (getType() == Type::BoolTy ? 1 : -1));
}
/// @returns the value of this ConstantInt only if it's a boolean type.