diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-16 18:09:37 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-16 18:09:37 +0000 |
| commit | 31ba47646ba40b7892492bb227d85de0d6733e07 (patch) | |
| tree | 3ac0882ad64f4e4b95c95a8bea50ad098c9da4bc /clang/lib/AST | |
| parent | 8cc6d42e8d6c0c133e4d5d46e918e5e2ae0781c6 (diff) | |
| download | bcm5719-llvm-31ba47646ba40b7892492bb227d85de0d6733e07.tar.gz bcm5719-llvm-31ba47646ba40b7892492bb227d85de0d6733e07.zip | |
[OPENMP]Allow priority clause in combined task-based directives.
The expression of the priority clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.
llvm-svn: 375026
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/OpenMPClause.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index ccb3cd34360..fe1334469d4 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -90,6 +90,8 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) { return static_cast<const OMPNumTasksClause *>(C); case OMPC_final: return static_cast<const OMPFinalClause *>(C); + case OMPC_priority: + return static_cast<const OMPPriorityClause *>(C); case OMPC_default: case OMPC_proc_bind: case OMPC_safelen: @@ -117,7 +119,6 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) { case OMPC_threads: case OMPC_simd: case OMPC_map: - case OMPC_priority: case OMPC_nogroup: case OMPC_hint: case OMPC_defaultmap: @@ -255,6 +256,12 @@ OMPClause::child_range OMPFinalClause::used_children() { return child_range(&Condition, &Condition + 1); } +OMPClause::child_range OMPPriorityClause::used_children() { + if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt())) + return child_range(C, C + 1); + return child_range(&Priority, &Priority + 1); +} + OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num, unsigned NumLoops, SourceLocation StartLoc, diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index e536abfe35d..1cc36623d45 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -737,6 +737,7 @@ void OMPClauseProfiler::VisitOMPThreadLimitClause( Profiler->VisitStmt(C->getThreadLimit()); } void OMPClauseProfiler::VisitOMPPriorityClause(const OMPPriorityClause *C) { + VistOMPClauseWithPreInit(C); if (C->getPriority()) Profiler->VisitStmt(C->getPriority()); } |

