[llvm-commits] CVS: llvm/include/llvm/Constants.h
Chris Lattner
clattner at apple.com
Thu Jan 11 16:54:35 PST 2007
> Index: llvm/include/llvm/Constants.h
> diff -u llvm/include/llvm/Constants.h:1.114 llvm/include/llvm/
> Constants.h:1.115
> --- llvm/include/llvm/Constants.h:1.114 Thu Jan 11 06:24:13 2007
> +++ llvm/include/llvm/Constants.h Thu Jan 11 08:31:10 2007
> @@ -96,13 +96,13 @@
> /// @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));
> }
This method is incorrect for all values. Please remove it.
-Chris
More information about the llvm-commits
mailing list