clang 20.0.0git
|
The scope used to remap some variables as private in the OpenMP loop body (or other captured region emitted without outlining), and to restore old vars back on exit. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/CodeGenFunction.h"
Public Member Functions | |
OMPPrivateScope (CodeGenFunction &CGF) | |
Enter a new OpenMP private scope. | |
bool | addPrivate (const VarDecl *LocalVD, Address Addr) |
Registers LocalVD variable as a private with Addr as the address of the corresponding private variable. | |
bool | Privatize () |
Privatizes local variables previously registered as private. | |
void | ForceCleanup () |
~OMPPrivateScope () | |
Exit scope - all the mapped variables are restored. | |
bool | isGlobalVarCaptured (const VarDecl *VD) const |
Checks if the global variable is captured in current function. | |
void | restoreMap () |
Restore all mapped variables w/o clean up. | |
Public Member Functions inherited from clang::CodeGen::CodeGenFunction::RunCleanupsScope | |
RunCleanupsScope (CodeGenFunction &CGF) | |
Enter a new cleanup scope. | |
~RunCleanupsScope () | |
Exit this cleanup scope, emitting any accumulated cleanups. | |
bool | requiresCleanups () const |
Determine whether this scope requires any cleanups. | |
void | ForceCleanup (std::initializer_list< llvm::Value ** > ValuesToReload={}) |
Force the emission of cleanups now, instead of waiting until this object is destroyed. | |
Additional Inherited Members | |
Protected Attributes inherited from clang::CodeGen::CodeGenFunction::RunCleanupsScope | |
bool | PerformCleanup |
CodeGenFunction & | CGF |
The scope used to remap some variables as private in the OpenMP loop body (or other captured region emitted without outlining), and to restore old vars back on exit.
Definition at line 1158 of file CodeGenFunction.h.
|
inlineexplicit |
Enter a new OpenMP private scope.
Definition at line 1165 of file CodeGenFunction.h.
|
inline |
Exit scope - all the mapped variables are restored.
Definition at line 1193 of file CodeGenFunction.h.
References ForceCleanup(), and clang::CodeGen::CodeGenFunction::RunCleanupsScope::PerformCleanup.
|
inline |
Registers LocalVD
variable as a private with Addr
as the address of the corresponding private variable.
PrivateGen
is the address of the generated private variable.
Definition at line 1172 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF, clang::CodeGen::CodeGenFunction::RunCleanupsScope::PerformCleanup, and clang::CodeGen::CodeGenFunction::OMPMapVars::setVarAddr().
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction().
|
inline |
Definition at line 1187 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::ForceCleanup(), and restoreMap().
Referenced by ~OMPPrivateScope().
|
inline |
Checks if the global variable is captured in current function.
Definition at line 1199 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF, clang::VarDecl::getCanonicalDecl(), and clang::VarDecl::isLocalVarDeclOrParm().
|
inline |
Privatizes local variables previously registered as private.
Registration is separate from the actual privatization to allow initializers use values of the original variables, not the private one. This is important, for example, if the private variable is a class variable initialized by a constructor that references other private variables. But at initialization original variables must be used, not private copies.
Definition at line 1185 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::OMPMapVars::apply(), and clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF.
Referenced by clang::CodeGen::CGOpenMPRuntime::emitReduction().
|
inline |
Restore all mapped variables w/o clean up.
This is usefully when we want to reference the original variables but don't want the clean up because that could emit lifetime end too early, causing backend issue #56913.
Definition at line 1207 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF, and clang::CodeGen::CodeGenFunction::OMPMapVars::restore().
Referenced by ForceCleanup().