diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-04 11:27:03 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-02-04 11:27:03 +0000 |
commit | 31300ed0a5044b2e9f608d0741e4a8601b08967c (patch) | |
tree | 208cdaedd5990f5da1c0fb5abd49da845f105226 /clang/lib/AST | |
parent | e1649a7853ad419067110ee74b38f82cf54f697b (diff) | |
download | bcm5719-llvm-31300ed0a5044b2e9f608d0741e4a8601b08967c.tar.gz bcm5719-llvm-31300ed0a5044b2e9f608d0741e4a8601b08967c.zip |
[OPENMP 4.0] Fixed support of array sections/array subscripts.
Codegen for array sections/array subscripts worked only for expressions with arrays as base. Patch fixes codegen for bases with pointer/reference types.
llvm-svn: 259776
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 5590527819e..d376fc72003 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -4026,16 +4026,18 @@ unsigned AtomicExpr::getNumSubExprs(AtomicOp Op) { llvm_unreachable("unknown atomic op"); } -QualType OMPArraySectionExpr::getBaseOriginalType(Expr *Base) { +QualType OMPArraySectionExpr::getBaseOriginalType(const Expr *Base) { unsigned ArraySectionCount = 0; while (auto *OASE = dyn_cast<OMPArraySectionExpr>(Base->IgnoreParens())) { Base = OASE->getBase(); ++ArraySectionCount; } - while (auto *ASE = dyn_cast<ArraySubscriptExpr>(Base->IgnoreParens())) { + while (auto *ASE = + dyn_cast<ArraySubscriptExpr>(Base->IgnoreParenImpCasts())) { Base = ASE->getBase(); ++ArraySectionCount; } + Base = Base->IgnoreParenImpCasts(); auto OriginalTy = Base->getType(); if (auto *DRE = dyn_cast<DeclRefExpr>(Base)) if (auto *PVD = dyn_cast<ParmVarDecl>(DRE->getDecl())) |