Accept NOT of a constant vector of int.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55140 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen 2008-08-21 21:20:09 +00:00
parent 1887c1c2f9
commit 3434994874

View File

@ -756,9 +756,11 @@ Constant *ConstantExpr::getNeg(Constant *C) {
C);
}
Constant *ConstantExpr::getNot(Constant *C) {
assert(isa<IntegerType>(C->getType()) && "Cannot NOT a nonintegral value!");
assert((isa<IntegerType>(C->getType()) ||
cast<VectorType>(C->getType())->getElementType()->isInteger()) &&
"Cannot NOT a nonintegral value!");
return get(Instruction::Xor, C,
ConstantInt::getAllOnesValue(C->getType()));
Constant::getAllOnesValue(C->getType()));
}
Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2) {
return get(Instruction::Add, C1, C2);