summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-16 14:41:46 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-16 14:41:46 +0000
commit2338264ad970cce047356959899668f5978afe78 (patch)
tree15ab676455fbc48838c291bee3f76a0c9997f5d6 /llvm/lib/IR/Constants.cpp
parenta259b26c501724aa8e07c73a31f0d81ac265d665 (diff)
downloadbcm5719-llvm-2338264ad970cce047356959899668f5978afe78.tar.gz
bcm5719-llvm-2338264ad970cce047356959899668f5978afe78.zip
Allow vectors in CreatePointerCast of constants.
llvm-svn: 172615
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 93275549b18..e984aaca33b 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1465,10 +1465,11 @@ Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) {
}
Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) {
- assert(S->getType()->isPointerTy() && "Invalid cast");
- assert((Ty->isIntegerTy() || Ty->isPointerTy()) && "Invalid cast");
+ assert(S->getType()->isPtrOrPtrVectorTy() && "Invalid cast");
+ assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) &&
+ "Invalid cast");
- if (Ty->isIntegerTy())
+ if (Ty->isIntOrIntVectorTy())
return getPtrToInt(S, Ty);
return getBitCast(S, Ty);
}
OpenPOWER on IntegriCloud