From adbeb9424162df3c5251b8d246a8a3d0e9aa5797 Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Tue, 15 Jan 2013 16:43:00 +0000 Subject: [PATCH] Allow vectors in CreatePointerCast. Both underlying IR operations support vectors of pointers already. llvm-svn: 172538 --- lib/IR/Instructions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index 26398ce8515..aba0fc92f24 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -2386,11 +2386,11 @@ CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty, CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore) { - assert(S->getType()->isPointerTy() && "Invalid cast"); - assert((Ty->isIntegerTy() || Ty->isPointerTy()) && + assert(S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"); + assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && "Invalid cast"); - if (Ty->isIntegerTy()) + if (Ty->isIntOrIntVectorTy()) return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); }