mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
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
This commit is contained in:
parent
e1c49906dc
commit
344d3fb961
@ -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