[OPENMP] Initial codegen for 'omp task' directive.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 10 Mar 2015 07:28:44 +0000 (07:28 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 10 Mar 2015 07:28:44 +0000 (07:28 +0000)
commit62b63b197dc7f1c7eb80f3b15ede1626ec637ffb
treeb93d54731a2ca0dec6d0ec8fca4a35306f9f66fb
parent58364dc4dac58fbf0a3bb7cbf54d9bc9dfed550c
[OPENMP] Initial codegen for 'omp task' directive.
The task region is emmitted in several steps:

Emit a call to kmp_task_t *__kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry).
Here task_entry is a pointer to the function:
kmp_int32 .omp_task_entry.(kmp_int32 gtid, kmp_task_t *tt) {
    TaskFunction(gtid, tt->part_id, tt->shareds);
      return 0;
}
Copy a list of shared variables to field shareds of the resulting structure kmp_task_t returned by the previous call (if any).
Copy a pointer to destructions function to field destructions of the resulting structure kmp_task_t.
Emit a call to kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task), where new_task is a resulting structure from previous items.
Differential Revision: http://reviews.llvm.org/D7560

llvm-svn: 231762
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntime.h
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/task_codegen.cpp [new file with mode: 0644]