diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 05:39:01 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 05:39:01 +0000 |
commit | f56f98c925521f4ed0f3b5adeb27e78477d96407 (patch) | |
tree | 899c8a4ae57add5b0398fae1484cb7b24760a7b3 /clang/tools/libclang | |
parent | 38e8953352c60f0052efa090ee2b18940e3f6ad3 (diff) | |
download | bcm5719-llvm-f56f98c925521f4ed0f3b5adeb27e78477d96407.tar.gz bcm5719-llvm-f56f98c925521f4ed0f3b5adeb27e78477d96407.zip |
[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.
Emits the following code for the clause at the beginning of the outlined function for implicit threads:
if (<not a master thread>) {
...
<thread local copy of var> = <master thread local copy of var>;
...
}
<sync point>;
Checking for a non-master thread is performed by comparing of the address of the thread local variable with the address of the master's variable. Master thread always uses original variables, so you always know the address of the variable in the master thread.
Differential Revision: http://reviews.llvm.org/D9026
llvm-svn: 235075
Diffstat (limited to 'clang/tools/libclang')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index eaecd64dbe8..5a7a9cf3f69 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -2070,6 +2070,15 @@ void OMPClauseEnqueue::VisitOMPAlignedClause(const OMPAlignedClause *C) { } void OMPClauseEnqueue::VisitOMPCopyinClause(const OMPCopyinClause *C) { VisitOMPClauseList(C); + for (auto *E : C->source_exprs()) { + Visitor->AddStmt(E); + } + for (auto *E : C->destination_exprs()) { + Visitor->AddStmt(E); + } + for (auto *E : C->assignment_ops()) { + Visitor->AddStmt(E); + } } void OMPClauseEnqueue::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) { |