summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-02-19 01:11:03 +0000
committerNate Begeman <natebegeman@mac.com>2008-02-19 01:11:03 +0000
commit22011e90c992533411d2efc17f5efd365a636117 (patch)
tree7c3ad3d70ec49224a4e2e3ef05a5b800e7df0da5
parent58cc30b64b210033c56fd40cef1cf823fb3df5a7 (diff)
downloadbcm5719-llvm-22011e90c992533411d2efc17f5efd365a636117.tar.gz
bcm5719-llvm-22011e90c992533411d2efc17f5efd365a636117.zip
Allow ArraySubscriptExpr to be a base node for vector dereference. This
allows you to do things like typedef __attribute__(( ocu_vector_type(4))) float float4; float4 *x; float y = x[0][2]; llvm-svn: 47295
-rw-r--r--clang/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 0d48ad7aa52..31cdc5947f4 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -414,7 +414,7 @@ ActOnArraySubscriptExpr(ExprTy *Base, SourceLocation LLoc,
IndexExpr = RHSExp;
// Component access limited to variables (reject vec4.rg[1]).
- if (!isa<DeclRefExpr>(BaseExpr))
+ if (!isa<DeclRefExpr>(BaseExpr) && !isa<ArraySubscriptExpr>(BaseExpr))
return Diag(LLoc, diag::err_ocuvector_component_access,
SourceRange(LLoc, RLoc));
// FIXME: need to deal with const...
OpenPOWER on IntegriCloud