From 655578f8b5275e7c59b87d4709b0d56b2621caac Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Wed, 16 Jan 2013 14:41:46 +0000 Subject: Allow vectors in CreatePointerCast of constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172615 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Constants.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/IR/Constants.cpp') diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp index 93275549b1..e984aaca33 100644 --- a/lib/IR/Constants.cpp +++ b/lib/IR/Constants.cpp @@ -1465,10 +1465,11 @@ Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) { } Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) { - assert(S->getType()->isPointerTy() && "Invalid cast"); - assert((Ty->isIntegerTy() || Ty->isPointerTy()) && "Invalid cast"); + assert(S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"); + assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && + "Invalid cast"); - if (Ty->isIntegerTy()) + if (Ty->isIntOrIntVectorTy()) return getPtrToInt(S, Ty); return getBitCast(S, Ty); } -- cgit v1.2.3-18-g5258