]> granicus.if.org Git - clang/commitdiff
Use CheckVectorOperands when % is applied to a vector type.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 5 Jan 2009 22:42:10 +0000 (22:42 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 5 Jan 2009 22:42:10 +0000 (22:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61763 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index d65c10bb50c0f8f21a65d89a4c625c9ba301db83..42ef417de472a558033d43baf59333fbdbfdb0db 100644 (file)
@@ -2361,9 +2361,7 @@ inline QualType Sema::CheckVectorOperands(SourceLocation Loc, Expr *&lex,
 inline QualType Sema::CheckMultiplyDivideOperands(
   Expr *&lex, Expr *&rex, SourceLocation Loc, bool isCompAssign) 
 {
-  QualType lhsType = lex->getType(), rhsType = rex->getType();
-
-  if (lhsType->isVectorType() || rhsType->isVectorType())
+  if (lex->getType()->isVectorType() || rex->getType()->isVectorType())
     return CheckVectorOperands(Loc, lex, rex);
     
   QualType compType = UsualArithmeticConversions(lex, rex, isCompAssign);
@@ -2376,7 +2374,8 @@ inline QualType Sema::CheckMultiplyDivideOperands(
 inline QualType Sema::CheckRemainderOperands(
   Expr *&lex, Expr *&rex, SourceLocation Loc, bool isCompAssign) 
 {
-  QualType lhsType = lex->getType(), rhsType = rex->getType();
+  if (lex->getType()->isVectorType() || rex->getType()->isVectorType())
+    return CheckVectorOperands(Loc, lex, rex);
 
   QualType compType = UsualArithmeticConversions(lex, rex, isCompAssign);