clang API Documentation
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 <CodeGenFunction.h>
Public Member Functions | |
OMPPrivateScope (CodeGenFunction &CGF) | |
Enter a new OpenMP private scope. | |
bool | addPrivate (const VarDecl *LocalVD, const std::function< llvm::Value *()> &PrivateGen) |
Registers LocalVD variable as a private and apply PrivateGen function for it to generate corresponding private variable. PrivateGen returns an address of the generated private variable. | |
bool | Privatize () |
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. | |
void | ForceCleanup () |
Force the emission of cleanups now, instead of waiting until this object is destroyed. | |
~OMPPrivateScope () | |
Exit scope - all the mapped variables are restored. |
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 595 of file CodeGenFunction.h.
clang::CodeGen::CodeGenFunction::OMPPrivateScope::OMPPrivateScope | ( | CodeGenFunction & | CGF | ) | [inline, explicit] |
Enter a new OpenMP private scope.
Definition at line 606 of file CodeGenFunction.h.
Exit scope - all the mapped variables are restored.
Definition at line 652 of file CodeGenFunction.h.
References ForceCleanup().
bool clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate | ( | const VarDecl * | LocalVD, |
const std::function< llvm::Value *()> & | PrivateGen | ||
) | [inline] |
Registers LocalVD variable as a private and apply PrivateGen function for it to generate corresponding private variable. PrivateGen returns an address of the generated private variable.
Definition at line 614 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF, clang::VarDecl::isLocalVarDecl(), and clang::CodeGen::CodeGenFunction::RunCleanupsScope::PerformCleanup.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitOMPPrivateClause(), and EmitPrivateLoopCounters().
void clang::CodeGen::CodeGenFunction::OMPPrivateScope::ForceCleanup | ( | ) | [inline] |
Force the emission of cleanups now, instead of waiting until this object is destroyed.
Reimplemented from clang::CodeGen::CodeGenFunction::RunCleanupsScope.
Definition at line 642 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF.
Referenced by ~OMPPrivateScope().
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 634 of file CodeGenFunction.h.
References clang::CodeGen::CodeGenFunction::RunCleanupsScope::CGF.
Referenced by EmitPrivateLoopCounters().