summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-07-30 11:36:16 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-07-30 11:36:16 +0000
commit10e775f4a882ec49e374bbeca567e91547d78312 (patch)
treecced55f964fdfb8e5d538d246c1ec312c6356912 /clang/lib/AST
parent3cc4a250a6a4c533097ce1e1ff272d07c30b0465 (diff)
downloadbcm5719-llvm-10e775f4a882ec49e374bbeca567e91547d78312.tar.gz
bcm5719-llvm-10e775f4a882ec49e374bbeca567e91547d78312.zip
[OPENMP 4.1] Initial support for extended 'ordered' clause.
OpenMP 4.1 introduces optional argument '(n)' for 'ordered' clause, where 'n' is a number of loops that immediately follow the directive. 'n' must be constant positive integer expressions and it must be less or equal than the number of the loops in the resulting loop nest. Patch adds parsing and semantic analysis for this optional argument. llvm-svn: 243635
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp7
-rw-r--r--clang/lib/AST/StmtProfile.cpp5
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index 30f15e037ba..57187ca8620 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -651,8 +651,13 @@ void OMPClausePrinter::VisitOMPScheduleClause(OMPScheduleClause *Node) {
OS << ")";
}
-void OMPClausePrinter::VisitOMPOrderedClause(OMPOrderedClause *) {
+void OMPClausePrinter::VisitOMPOrderedClause(OMPOrderedClause *Node) {
OS << "ordered";
+ if (auto *Num = Node->getNumForLoops()) {
+ OS << "(";
+ Num->printPretty(OS, nullptr, Policy, 0);
+ OS << ")";
+ }
}
void OMPClausePrinter::VisitOMPNowaitClause(OMPNowaitClause *) {
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index f2fa53d25cd..091682ad7ff 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -306,7 +306,10 @@ void OMPClauseProfiler::VisitOMPScheduleClause(const OMPScheduleClause *C) {
}
}
-void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *) {}
+void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
+ if (auto *Num = C->getNumForLoops())
+ Profiler->VisitStmt(Num);
+}
void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
OpenPOWER on IntegriCloud