Allow vectors in CreatePointerCast.

Both underlying IR operations support vectors of pointers already.

llvm-svn: 172538
This commit is contained in:
Evgeniy Stepanov 2013-01-15 16:43:00 +00:00
parent a31e58b2df
commit c9bd35b143
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}