[PATCH] D18110: [OpenMP] Fix SEMA bug in the capture of global variables in template functions.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 11 16:29:17 PST 2016


sfantao created this revision.
sfantao added reviewers: ABataev, hfinkel, carlo.bertolli, arpith-jacob, kkwli0.
sfantao added subscribers: fraggamuffin, caomhin, cfe-commits.

Target regions require globals to be captured. The capturing scope has been determine by matching the scope of the captured region and the data sharing attribute stack (DSA stack). However, if the code is in a templated function, the scope is set to null and can no longer be used to  determine scopes.

This patch fixes the issue by matching the SEMA parent contexts (that are always defined) of the region scope and DSA scope.

http://reviews.llvm.org/D18110

Files:
  lib/Sema/SemaOpenMP.cpp
  test/OpenMP/target_codegen_global_capture.cpp
  test/OpenMP/teams_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18110.50498.patch
Type: text/x-patch
Size: 19317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160312/28aaf798/attachment-0001.bin>


More information about the cfe-commits mailing list