[cfe-commits] r48461 - /cfe/trunk/lib/Sema/SemaExpr.cpp

Nate Begeman natebegeman at mac.com
Mon Mar 17 10:22:19 PDT 2008


Author: sampo
Date: Mon Mar 17 12:22:18 2008
New Revision: 48461

URL: http://llvm.org/viewvc/llvm-project?rev=48461&view=rev
Log:
Check in a couple fixes for vector extensions.  

Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=48461&r1=48460&r2=48461&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Mar 17 12:22:18 2008
@@ -547,7 +547,7 @@
                           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 @@
   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,





More information about the cfe-commits mailing list