diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-15 16:43:00 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-15 16:43:00 +0000 |
commit | 344d3fb9614a103f84520fd88870121abe94c080 (patch) | |
tree | 01745a33bdb6a76b917fe38e69d7c571e5f83362 /lib/IR | |
parent | e1c49906dcd26486ddac08207817d0e2ce4a2829 (diff) | |
download | external_llvm-344d3fb9614a103f84520fd88870121abe94c080.zip external_llvm-344d3fb9614a103f84520fd88870121abe94c080.tar.gz external_llvm-344d3fb9614a103f84520fd88870121abe94c080.tar.bz2 |
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
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/Instructions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index 26398ce..aba0fc9 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); } |