clang  6.0.0svn
Public Member Functions | List of all members
clang::CodeGen::CodeGenFunction::OMPPrivateScope Class Reference

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 "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h"

Inheritance diagram for clang::CodeGen::CodeGenFunction::OMPPrivateScope:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGen::CodeGenFunction::OMPPrivateScope:
Collaboration graph
[legend]

Public Member Functions

 OMPPrivateScope (CodeGenFunction &CGF)
 Enter a new OpenMP private scope. More...
 
bool addPrivate (const VarDecl *LocalVD, llvm::function_ref< Address()> PrivateGen)
 Registers LocalVD variable as a private and apply PrivateGen function for it to generate corresponding private variable. More...
 
bool Privatize ()
 Privatizes local variables previously registered as private. More...
 
void ForceCleanup ()
 
 ~OMPPrivateScope ()
 Exit scope - all the mapped variables are restored. More...
 
bool isGlobalVarCaptured (const VarDecl *VD) const
 Checks if the global variable is captured in current function. More...
 
- Public Member Functions inherited from clang::CodeGen::CodeGenFunction::RunCleanupsScope
 RunCleanupsScope (CodeGenFunction &CGF)
 Enter a new cleanup scope. More...
 
 ~RunCleanupsScope ()
 Exit this cleanup scope, emitting any accumulated cleanups. More...
 
bool requiresCleanups () const
 Determine whether this scope requires any cleanups. More...
 
void ForceCleanup (std::initializer_list< llvm::Value **> ValuesToReload={})
 Force the emission of cleanups now, instead of waiting until this object is destroyed. More...
 

Additional Inherited Members

- Protected Attributes inherited from clang::CodeGen::CodeGenFunction::RunCleanupsScope
bool PerformCleanup
 
CodeGenFunctionCGF
 

Detailed 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.

Definition at line 694 of file CodeGenFunction.h.

Constructor & Destructor Documentation

◆ OMPPrivateScope()

clang::CodeGen::CodeGenFunction::OMPPrivateScope::OMPPrivateScope ( CodeGenFunction CGF)
inlineexplicit

Enter a new OpenMP private scope.

Definition at line 704 of file CodeGenFunction.h.

◆ ~OMPPrivateScope()

clang::CodeGen::CodeGenFunction::OMPPrivateScope::~OMPPrivateScope ( )
inline

Exit scope - all the mapped variables are restored.

Definition at line 762 of file CodeGenFunction.h.

Member Function Documentation

◆ addPrivate()

bool clang::CodeGen::CodeGenFunction::OMPPrivateScope::addPrivate ( const VarDecl LocalVD,
llvm::function_ref< Address()>  PrivateGen 
)
inline

◆ ForceCleanup()

void clang::CodeGen::CodeGenFunction::OMPPrivateScope::ForceCleanup ( )
inline

Definition at line 755 of file CodeGenFunction.h.

Referenced by emitCombinerOrInitializer().

◆ isGlobalVarCaptured()

bool clang::CodeGen::CodeGenFunction::OMPPrivateScope::isGlobalVarCaptured ( const VarDecl VD) const
inline

Checks if the global variable is captured in current function.

Definition at line 768 of file CodeGenFunction.h.

References clang::VarDecl::getCanonicalDecl(), and clang::VarDecl::isLocalVarDeclOrParm().

◆ Privatize()

bool clang::CodeGen::CodeGenFunction::OMPPrivateScope::Privatize ( )
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.

Returns
true if at least one variable was privatized, false otherwise.

Definition at line 749 of file CodeGenFunction.h.

Referenced by emitCombinerOrInitializer(), clang::CodeGen::CodeGenFunction::EmitOMPCopy(), clang::CodeGen::CodeGenFunction::EmitOMPFlushDirective(), clang::CodeGen::CodeGenFunction::EmitOMPWorksharingLoop(), emitPreCond(), emitPrivatesInit(), and emitReduceCombFunction().


The documentation for this class was generated from the following file: