mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Allow vectors in CreatePointerCast.
Both underlying IR operations support vectors of pointers already. llvm-svn: 172538
This commit is contained in:
parent
a263f1e883
commit
adbeb94241
@ -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
Block a user