forked from OSchip/llvm-project
Allow vectors in CreatePointerCast.
Both underlying IR operations support vectors of pointers already. llvm-svn: 172538
This commit is contained in:
parent
a31e58b2df
commit
c9bd35b143
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue