Accept NOT of a constant vector of int.

llvm-svn: 55140
This commit is contained in:
Dale Johannesen 2008-08-21 21:20:09 +00:00
parent 9534ea03e8
commit 47a5ef381e
1 changed files with 4 additions and 2 deletions

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);