diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index b5c67b8fe66..214edf145c0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -7277,14 +7277,16 @@ QualType Sema::CheckVectorCompareOperands(Expr *&lex, Expr *&rex, if (vType.isNull()) return vType; + QualType lType = lex->getType(); + QualType rType = rex->getType(); + // If AltiVec, the comparison results in a numeric type, i.e. // bool for C++, int for C - if (getLangOptions().AltiVec) + if (lType->getAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector + && rType->getAs<VectorType>()->getVectorKind() == + VectorType::AltiVecVector) return Context.getLogicalOperationType(); - QualType lType = lex->getType(); - QualType rType = rex->getType(); - // For non-floating point types, check for self-comparisons of the form // x == x, x != x, x < x, etc. These always evaluate to a constant, and // often indicate logic errors in the program. |

