diff options
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 46dce322875..c2e5754a184 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1496,6 +1496,13 @@ void OMPLoopDirective::setCounters(ArrayRef<Expr *> A) { std::copy(A.begin(), A.end(), getCounters().begin()); } +void OMPLoopDirective::setPrivateCounters(ArrayRef<Expr *> A) { + assert(A.size() == getCollapsedNumber() && "Number of loop private counters " + "is not the same as the collapsed " + "number"); + std::copy(A.begin(), A.end(), getPrivateCounters().begin()); +} + void OMPLoopDirective::setUpdates(ArrayRef<Expr *> A) { assert(A.size() == getCollapsedNumber() && "Number of counter updates is not the same as the collapsed number"); @@ -1661,6 +1668,7 @@ OMPSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, Dir->setInit(Exprs.Init); Dir->setInc(Exprs.Inc); Dir->setCounters(Exprs.Counters); + Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setUpdates(Exprs.Updates); Dir->setFinals(Exprs.Finals); return Dir; @@ -1707,6 +1715,7 @@ OMPForDirective::Create(const ASTContext &C, SourceLocation StartLoc, Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setCounters(Exprs.Counters); + Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setUpdates(Exprs.Updates); Dir->setFinals(Exprs.Finals); return Dir; @@ -1753,6 +1762,7 @@ OMPForSimdDirective::Create(const ASTContext &C, SourceLocation StartLoc, Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setCounters(Exprs.Counters); + Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setUpdates(Exprs.Updates); Dir->setFinals(Exprs.Finals); return Dir; @@ -1908,6 +1918,7 @@ OMPParallelForDirective *OMPParallelForDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setCounters(Exprs.Counters); + Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setUpdates(Exprs.Updates); Dir->setFinals(Exprs.Finals); return Dir; @@ -1952,6 +1963,7 @@ OMPParallelForSimdDirective *OMPParallelForSimdDirective::Create( Dir->setNextLowerBound(Exprs.NLB); Dir->setNextUpperBound(Exprs.NUB); Dir->setCounters(Exprs.Counters); + Dir->setPrivateCounters(Exprs.PrivateCounters); Dir->setUpdates(Exprs.Updates); Dir->setFinals(Exprs.Finals); return Dir; |