[llvm-commits] [llvm] r55140 - /llvm/trunk/lib/VMCore/Constants.cpp

Dale Johannesen dalej at apple.com
Thu Aug 21 14:20:10 PDT 2008


Author: johannes
Date: Thu Aug 21 16:20:09 2008
New Revision: 55140

URL: http://llvm.org/viewvc/llvm-project?rev=55140&view=rev
Log:
Accept NOT of a constant vector of int.


Modified:
    llvm/trunk/lib/VMCore/Constants.cpp

Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=55140&r1=55139&r2=55140&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Thu Aug 21 16:20:09 2008
@@ -756,9 +756,11 @@
              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);





More information about the llvm-commits mailing list