diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-03-17 17:22:18 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-03-17 17:22:18 +0000 |
commit | 9c167115e9089d46266ba2eacf79693b1ca1c036 (patch) | |
tree | 86d988478638c7ff5ce0c53fe0f247d1945fbfef | |
parent | a716d7a575c55805c4b90e07cccf61b9cc0960b8 (diff) |
Check in a couple fixes for vector extensions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48461 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d756345c1a..8df023f238 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -547,7 +547,7 @@ ActOnMemberReferenceExpr(ExprTy *Base, SourceLocation OpLoc, MemberLoc, MemberType); } else if (BaseType->isOCUVectorType() && OpKind == tok::period) { // Component access limited to variables (reject vec4.rg.g). - if (!isa<DeclRefExpr>(BaseExpr)) + if (!isa<DeclRefExpr>(BaseExpr) && !isa<ArraySubscriptExpr>(BaseExpr)) return Diag(OpLoc, diag::err_ocuvector_component_access, SourceRange(MemberLoc)); QualType ret = CheckOCUVectorComponent(BaseType, OpLoc, Member, MemberLoc); @@ -1284,7 +1284,7 @@ inline QualType Sema::CheckVectorOperands(SourceLocation loc, Expr *&lex, QualType lhsType = lex->getType(), rhsType = rex->getType(); // make sure the vector types are identical. - if (lhsType == rhsType) + if (lhsType.getCanonicalType() == rhsType.getCanonicalType()) return lhsType; // if the lhs is an ocu vector and the rhs is a scalar of the same type, |