[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)
commitf841bd9fcd7b0f167687d007ea73a137ebfa3d13
tree65dded7aed48339f2baa6f582b496c8861147633
parente7029bce82c9048aa7c8730bda838d3d4a10c837
[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

llvm-svn: 224323
clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
clang/lib/Frontend/Rewrite/RewriteObjC.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/parallel_firstprivate_codegen.cpp
clang/test/OpenMP/parallel_private_codegen.cpp