class CodeGenFunction::OMPPrivateScope
Declaration
class CodeGenFunction::OMPPrivateScope : public RunCleanupsScope { /* full declaration omitted */ };
Description
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.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1066
Inherits from: CodeGenFunction::RunCleanupsScope
Member Variables
- private clang::CodeGen::CodeGenFunction::OMPMapVars MappedVars
Inherited from CodeGenFunction::RunCleanupsScope:
Method Overview
- public void ForceCleanup()
- private OMPPrivateScope(const clang::CodeGen::CodeGenFunction::OMPPrivateScope &)
- public OMPPrivateScope(clang::CodeGen::CodeGenFunction & CGF)
- public bool Privatize()
- public bool addPrivate(const clang::VarDecl * LocalVD, clang::CodeGen::Address Addr)
- public bool isGlobalVarCaptured(const clang::VarDecl * VD) const
- public void restoreMap()
- public ~OMPPrivateScope()
Inherited from CodeGenFunction::RunCleanupsScope:
Methods
¶void ForceCleanup()
void ForceCleanup()
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1095
¶OMPPrivateScope(
const clang::CodeGen::CodeGenFunction::
OMPPrivateScope&)
OMPPrivateScope(
const clang::CodeGen::CodeGenFunction::
OMPPrivateScope&)
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1068
Parameters
- const clang::CodeGen::CodeGenFunction:: OMPPrivateScope&
¶OMPPrivateScope(
clang::CodeGen::CodeGenFunction& CGF)
OMPPrivateScope(
clang::CodeGen::CodeGenFunction& CGF)
Description
Enter a new OpenMP private scope.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1073
Parameters
¶bool Privatize()
bool Privatize()
Description
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.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1093
Returns
true if at least one variable was privatized, false otherwise.
¶bool addPrivate(const clang::VarDecl* LocalVD,
clang::CodeGen::Address Addr)
bool addPrivate(const clang::VarDecl* LocalVD,
clang::CodeGen::Address Addr)
Description
Registers \p LocalVD variable as a private with \p Addr as the address of the corresponding private variable. \p PrivateGen is the address of the generated private variable.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1080
Parameters
- const clang::VarDecl* LocalVD
- clang::CodeGen::Address Addr
Returns
true if the variable is registered as private, false if it has been privatized already.
¶bool isGlobalVarCaptured(
const clang::VarDecl* VD) const
bool isGlobalVarCaptured(
const clang::VarDecl* VD) const
Description
Checks if the global variable is captured in current function.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1107
Parameters
- const clang::VarDecl* VD
¶void restoreMap()
void restoreMap()
Description
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.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1115
¶~OMPPrivateScope()
~OMPPrivateScope()
Description
Exit scope - all the mapped variables are restored.
Declared at: clang/lib/CodeGen/CodeGenFunction.h:1101