diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 18:36:24 +0000 |
commit | 36c5ade2f4674b544039d78db4c466756cf142b0 (patch) | |
tree | 3d3ed1e1987dbe6444294b1b4e249814b97b97a5 /include/clang/AST/StmtOpenMP.h | |
parent | 51ece4aae5857052d224ce52277924c74685714e (diff) | |
download | src-36c5ade2f4674b544039d78db4c466756cf142b0.tar.gz src-36c5ade2f4674b544039d78db4c466756cf142b0.zip |
Import clang 3.7.0 release (r246257).vendor/clang/clang-release_370-r246257
Notes
Notes:
svn path=/vendor/clang/dist/; revision=287512
svn path=/vendor/clang/clang-release_370-r246257/; revision=287513; tag=vendor/clang/clang-release_370-r246257
Diffstat (limited to 'include/clang/AST/StmtOpenMP.h')
-rw-r--r-- | include/clang/AST/StmtOpenMP.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index b412daaf2858..708b8667335e 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -312,18 +312,26 @@ class OMPLoopDirective : public OMPExecutableDirective { } /// \brief Get the updates storage. - MutableArrayRef<Expr *> getUpdates() { + MutableArrayRef<Expr *> getInits() { Expr **Storage = reinterpret_cast<Expr **>( &*std::next(child_begin(), getArraysOffset(getDirectiveKind()) + CollapsedNum)); return MutableArrayRef<Expr *>(Storage, CollapsedNum); } + /// \brief Get the updates storage. + MutableArrayRef<Expr *> getUpdates() { + Expr **Storage = reinterpret_cast<Expr **>( + &*std::next(child_begin(), + getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); + return MutableArrayRef<Expr *>(Storage, CollapsedNum); + } + /// \brief Get the final counter updates storage. MutableArrayRef<Expr *> getFinals() { Expr **Storage = reinterpret_cast<Expr **>( &*std::next(child_begin(), - getArraysOffset(getDirectiveKind()) + 2 * CollapsedNum)); + getArraysOffset(getDirectiveKind()) + 3 * CollapsedNum)); return MutableArrayRef<Expr *>(Storage, CollapsedNum); } @@ -358,7 +366,7 @@ protected: static unsigned numLoopChildren(unsigned CollapsedNum, OpenMPDirectiveKind Kind) { return getArraysOffset(Kind) + - 3 * CollapsedNum; // Counters, Updates and Finals + 4 * CollapsedNum; // Counters, Inits, Updates and Finals } void setIterationVariable(Expr *IV) { @@ -414,6 +422,7 @@ protected: *std::next(child_begin(), NextUpperBoundOffset) = NUB; } void setCounters(ArrayRef<Expr *> A); + void setInits(ArrayRef<Expr *> A); void setUpdates(ArrayRef<Expr *> A); void setFinals(ArrayRef<Expr *> A); @@ -453,6 +462,8 @@ public: Expr *NUB; /// \brief Counters Loop counters. SmallVector<Expr *, 4> Counters; + /// \brief Expressions for loop counters inits for CodeGen. + SmallVector<Expr *, 4> Inits; /// \brief Expressions for loop counters update for CodeGen. SmallVector<Expr *, 4> Updates; /// \brief Final loop counter values for GodeGen. @@ -484,10 +495,12 @@ public: NLB = nullptr; NUB = nullptr; Counters.resize(Size); + Inits.resize(Size); Updates.resize(Size); Finals.resize(Size); for (unsigned i = 0; i < Size; ++i) { Counters[i] = nullptr; + Inits[i] = nullptr; Updates[i] = nullptr; Finals[i] = nullptr; } @@ -584,6 +597,12 @@ public: return const_cast<OMPLoopDirective *>(this)->getCounters(); } + ArrayRef<Expr *> inits() { return getInits(); } + + ArrayRef<Expr *> inits() const { + return const_cast<OMPLoopDirective *>(this)->getInits(); + } + ArrayRef<Expr *> updates() { return getUpdates(); } ArrayRef<Expr *> updates() const { |