diff options
author | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2017-01-18 20:40:48 +0000 |
---|---|---|
committer | Arpith Chacko Jacob <acjacob@us.ibm.com> | 2017-01-18 20:40:48 +0000 |
commit | fe4890a68bc807c057f917285a95d0992f67b9d8 (patch) | |
tree | 53debdaf94f6cd7584a2358c7ed69b0a250231a5 /clang/lib/AST/OpenMPClause.cpp | |
parent | 9c982440a22f2212d749bc9550bf991a3896d7a6 (diff) |
[OpenMP] Support for the if-clause on the combined directive 'target parallel'.
The if-clause on the combined directive potentially applies to both the
'target' and the 'parallel' regions. Codegen'ing the if-clause on the
combined directive requires additional support because the expression in
the clause must be captured by the 'target' capture statement but not
the 'parallel' capture statement. Note that this situation arises for
other clauses such as num_threads.
The OMPIfClause class inherits OMPClauseWithPreInit to support capturing
of expressions in the clause. A member CaptureRegion is added to
OMPClauseWithPreInit to indicate which captured statement (in this case
'target' but not 'parallel') captures these expressions.
To ensure correct codegen of captured expressions in the presence of
combined 'target' directives, OMPParallelScope was added to 'parallel'
codegen.
Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28781
llvm-svn: 292437
Diffstat (limited to 'clang/lib/AST/OpenMPClause.cpp')
-rw-r--r-- | clang/lib/AST/OpenMPClause.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp index a28b9f3b6d64..52da57f633e6 100644 --- a/clang/lib/AST/OpenMPClause.cpp +++ b/clang/lib/AST/OpenMPClause.cpp @@ -48,9 +48,10 @@ const OMPClauseWithPreInit *OMPClauseWithPreInit::get(const OMPClause *C) { return static_cast<const OMPReductionClause *>(C); case OMPC_linear: return static_cast<const OMPLinearClause *>(C); + case OMPC_if: + return static_cast<const OMPIfClause *>(C); case OMPC_default: case OMPC_proc_bind: - case OMPC_if: case OMPC_final: case OMPC_num_threads: case OMPC_safelen: |