[OPENMP]Fix capturing of global variables in OpenMP regions.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Apr 2020 13:49:10 +0000 (09:49 -0400)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 9 Apr 2020 14:36:09 +0000 (10:36 -0400)
commit56c3b2b091bf94ed5c3d614f3d10e8e973a72d17
treee7e60a935565535cb30d388751a33049d44ecfd4
parent5b5a74f7d1626466885879a746d9cafdd088196b
[OPENMP]Fix capturing of global variables in OpenMP regions.

Summary:
The global variable should be captured in the region only if it was
privitized in the region or in any of the outer regions. Otherwise, it
should not be captured.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77731
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/parallel_codegen.cpp