]> granicus.if.org Git - clang/commit
[OpenMP] Support for the if-clause on the combined directive 'target parallel'.
authorArpith Chacko Jacob <acjacob@us.ibm.com>
Wed, 18 Jan 2017 20:40:48 +0000 (20:40 +0000)
committerArpith Chacko Jacob <acjacob@us.ibm.com>
Wed, 18 Jan 2017 20:40:48 +0000 (20:40 +0000)
commitec7d9933a4129ae9f38a27670b6c965b0fd27681
treef2ec24d144a83b3f4fabf7ee492645cda59361aa
parentea8cb15f12c2505c01b050dae144d33475b74ca5
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292437 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/OpenMPClause.h
include/clang/AST/RecursiveASTVisitor.h
lib/AST/OpenMPClause.cpp
lib/AST/StmtProfile.cpp
lib/CodeGen/CGStmtOpenMP.cpp
lib/Sema/SemaOpenMP.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
test/OpenMP/target_parallel_if_codegen.cpp [new file with mode: 0644]
tools/libclang/CIndex.cpp