aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXCast.cpp
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2011-03-27 09:32:40 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2011-03-27 09:32:40 +0000
commitd06fea8580658470f92fb5d0d3d7ab5b475728dc (patch)
tree9ee9d5c46327ce3f931ba10af09aabf844a85bc6 /lib/Sema/SemaCXXCast.cpp
parentbda0d6bda0f1a08a9fdf3ee4cf550b6b10d454ec (diff)
supported: AltiVec vector initialization with a single literal according to PIM section 2.5.1 - after initialization all elements have the value specified by the literal
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCXXCast.cpp')
-rw-r--r--lib/Sema/SemaCXXCast.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index 557d27a943..d10042ad03 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -1517,6 +1517,16 @@ Sema::CXXCheckCStyleCast(SourceRange R, QualType CastTy, ExprValueKind &VK,
return ret;
}
+ // Case of AltiVec vector initialization with a single literal
+ if (CastTy->isVectorType()
+ && CastTy->getAs<VectorType>()->getVectorKind() ==
+ VectorType::AltiVecVector
+ && (CastExpr->getType()->isIntegerType()
+ || CastExpr->getType()->isFloatingType())) {
+ Kind = CK_VectorSplat;
+ return false;
+ }
+
// Make sure we determine the value kind before we bail out for
// dependent types.
VK = Expr::getValueKindForType(CastTy);