aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2009-10-25 02:26:48 +0000
committerNate Begeman <natebegeman@mac.com>2009-10-25 02:26:48 +0000
commit2207d79204559baa15fc1f342f813d1bcdb6db5b (patch)
treed30dcbc9442eac8d62627f30ac04c2adf7c9536c /lib/Sema
parenta99f08351b6df3bb0f2947e038747717a60fd93a (diff)
Add support for vector shifts, pretty straight forward.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index b1915750c9..17956e65ae 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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);