Accept NOT of a constant vector of int.
authorDale Johannesen <dalej@apple.com>
Thu, 21 Aug 2008 21:20:09 +0000 (21:20 +0000)
committerDale Johannesen <dalej@apple.com>
Thu, 21 Aug 2008 21:20:09 +0000 (21:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55140 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index df1ac086b779fddb16e9d3abb059b76524c17c29..639370380554903f2829ca2675431971b2b8dd3e 100644 (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);