Defer capture initialization for captured regions until after we've left
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 31 May 2019 00:45:10 +0000 (00:45 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 31 May 2019 00:45:10 +0000 (00:45 +0000)
commit4c6199e026e6ff47812f39c9802313b23cd26107
tree73d695752aa2d1f891f98245dc5670141c59a2a5
parent00cfd3ff27bf1b2d323717402403086af1dc3237
Defer capture initialization for captured regions until after we've left
the captured region scope.

This removes a case where we would build expressions (and mark
declarations odr-used) in the wrong scope.

Remove the now-unused 'capture initializer' field on sema::Capture
(except for 'this' captures, which still need to be cleaned up).

No functionality change intended (except that we now very slightly more
precisely determine whether we need to use a capture or not when another
captured region encloses an OpenMP captured region).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362179 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/ScopeInfo.h
lib/Sema/ScopeInfo.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaLambda.cpp
lib/Sema/SemaOpenMP.cpp
lib/Sema/SemaStmt.cpp
test/OpenMP/for_lastprivate_codegen.cpp