aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2010-11-18 03:19:30 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2010-11-18 03:19:30 +0000
commitaa4fe05939ffbfd746b8f0065cc0b5e06ea94fe2 (patch)
treeecb65cac67c68a7486229e2de1094fccdf9e64c0 /lib/Sema
parentcdba6595a61a7bd31f504260abf63c900a759d0f (diff)
comparison of AltiVec vectors now gives bool result (fix for 7533)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 277da3b78c..2cb92b6db6 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -6423,6 +6423,11 @@ QualType Sema::CheckVectorCompareOperands(Expr *&lex, Expr *&rex,
if (vType.isNull())
return vType;
+ // If AltiVec, the comparison results in a numeric type, i.e.
+ // bool for C++, int for C
+ if (getLangOptions().AltiVec)
+ return (getLangOptions().CPlusPlus ? Context.BoolTy : Context.IntTy);
+
QualType lType = lex->getType();
QualType rType = rex->getType();