From e46ee9aaea11f95541f0c39837b2243bebfa9898 Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Sun, 25 Oct 2009 02:26:48 +0000 Subject: [PATCH] Add support for vector shifts, pretty straight forward. llvm-svn: 85033 --- clang/lib/Sema/SemaExpr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index b1915750c9e9..17956e65ae58 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4406,6 +4406,10 @@ QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation Loc, if (!lex->getType()->isIntegerType() || !rex->getType()->isIntegerType()) return InvalidOperands(Loc, lex, rex); + // Vector shifts promote their scalar inputs to vector type. + if (lex->getType()->isVectorType() || rex->getType()->isVectorType()) + return CheckVectorOperands(Loc, lex, rex); + // Shifts don't perform usual arithmetic conversions, they just do integer // promotions on each operand. C99 6.5.7p3 QualType LHSTy = Context.isPromotableBitField(lex);