From: Evgeniy Stepanov Date: Tue, 15 Jan 2013 16:43:00 +0000 (+0000) Subject: Allow vectors in CreatePointerCast. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=344d3fb9614a103f84520fd88870121abe94c080;p=oota-llvm.git Allow vectors in CreatePointerCast. Both underlying IR operations support vectors of pointers already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172538 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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); }