diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-25 14:24:04 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-25 14:24:04 +0000 |
commit | 1a3320e4639c9f39e85311f41dcd4d5a5c2c7f28 (patch) | |
tree | 5e0a2558e01bea5a62f5dc995be8c5c280cc0441 /clang/lib/Sema/SemaOpenMP.cpp | |
parent | f0c2dd07eaa888ab949f6f1befe3a70e78abc831 (diff) | |
download | bcm5719-llvm-1a3320e4639c9f39e85311f41dcd4d5a5c2c7f28.tar.gz bcm5719-llvm-1a3320e4639c9f39e85311f41dcd4d5a5c2c7f28.zip |
[OPENMP 4.0] Initial support for array sections.
Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0).
Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions.
Differential Revision: http://reviews.llvm.org/D10732
llvm-svn: 245937
Diffstat (limited to 'clang/lib/Sema/SemaOpenMP.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 77d8c2f662b..6b092a80de9 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6973,10 +6973,11 @@ Sema::ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, // structure) but is not an array element or an array section cannot appear // in a depend clause. auto *SimpleExpr = RefExpr->IgnoreParenCasts(); - DeclRefExpr *DE = dyn_cast<DeclRefExpr>(SimpleExpr); - ArraySubscriptExpr *ASE = dyn_cast<ArraySubscriptExpr>(SimpleExpr); - if (!RefExpr->IgnoreParenImpCasts()->isLValue() || (!ASE && !DE) || - (DE && !isa<VarDecl>(DE->getDecl())) || + auto *DE = dyn_cast<DeclRefExpr>(SimpleExpr); + auto *ASE = dyn_cast<ArraySubscriptExpr>(SimpleExpr); + auto *OASE = dyn_cast<OMPArraySectionExpr>(SimpleExpr); + if (!RefExpr->IgnoreParenImpCasts()->isLValue() || + (!ASE && !DE && !OASE) || (DE && !isa<VarDecl>(DE->getDecl())) || (ASE && !ASE->getBase()->getType()->isAnyPointerType() && !ASE->getBase()->getType()->isArrayType())) { Diag(ELoc, diag::err_omp_expected_var_name_or_array_item) |