summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorAlexander Musman <alexander.musman@gmail.com>2014-05-27 15:12:19 +0000
committerAlexander Musman <alexander.musman@gmail.com>2014-05-27 15:12:19 +0000
commit8bd31e69a441bb7178134de57bc60c22be8e0f3c (patch)
tree03c7c30a004a5d9aa29ba6ec4ad5ba26d832ef2a /clang/lib/AST
parentb355e8f604d3b26f15990b478a126b254a0fd9b8 (diff)
downloadbcm5719-llvm-8bd31e69a441bb7178134de57bc60c22be8e0f3c.tar.gz
bcm5719-llvm-8bd31e69a441bb7178134de57bc60c22be8e0f3c.zip
Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch. llvm-svn: 209660
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/StmtPrinter.cpp6
-rw-r--r--clang/lib/AST/StmtProfile.cpp5
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index e5f24dc5d5e..0804d4089bb 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -608,6 +608,12 @@ void OMPClausePrinter::VisitOMPSafelenClause(OMPSafelenClause *Node) {
OS << ")";
}
+void OMPClausePrinter::VisitOMPCollapseClause(OMPCollapseClause *Node) {
+ OS << "collapse(";
+ Node->getNumForLoops()->printPretty(OS, nullptr, Policy, 0);
+ OS << ")";
+}
+
void OMPClausePrinter::VisitOMPDefaultClause(OMPDefaultClause *Node) {
OS << "default("
<< getOpenMPSimpleClauseTypeName(OMPC_default, Node->getDefaultKind())
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 5dbaa0e8327..9cff6d67437 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -279,6 +279,11 @@ void OMPClauseProfiler::VisitOMPSafelenClause(const OMPSafelenClause *C) {
Profiler->VisitStmt(C->getSafelen());
}
+void OMPClauseProfiler::VisitOMPCollapseClause(const OMPCollapseClause *C) {
+ if (C->getNumForLoops())
+ Profiler->VisitStmt(C->getNumForLoops());
+}
+
void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
void OMPClauseProfiler::VisitOMPProcBindClause(const OMPProcBindClause *C) { }
OpenPOWER on IntegriCloud