]> granicus.if.org Git - clang/commit
[OPENMP] Bugfix for processing of global variables in OpenMP regions.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 16 Dec 2014 07:00:22 +0000 (07:00 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 16 Dec 2014 07:00:22 +0000 (07:00 +0000)
commit7c818bad8a72a60b7c86c90e9eca6bfa4aef2ce7
tree326186e7f200f32ecd1a46e44d852802455fdc0c
parentfa0d361201b53b2a395223e370c6377704c79b0c
[OPENMP] Bugfix for processing of global variables in OpenMP regions.
Currently, if global variable is marked as a private OpenMP variable, the compiler crashes in debug version or generates incorrect code in release version. It happens because in the OpenMP region the original global variable is used instead of the generated private copy. It happens because currently globals variables are not captured in the OpenMP region.
This patch adds capturing of global variables iff private copy of the global variable must be used in the OpenMP region.
Differential Revision: http://reviews.llvm.org/D6259

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224323 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGStmtOpenMP.cpp
lib/CodeGen/CodeGenFunction.h
lib/Frontend/Rewrite/RewriteModernObjC.cpp
lib/Frontend/Rewrite/RewriteObjC.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaOpenMP.cpp
test/OpenMP/parallel_firstprivate_codegen.cpp
test/OpenMP/parallel_private_codegen.cpp