clang  6.0.0svn
Classes | Public Member Functions | List of all members
clang::CodeGen::ReductionCodeGen Class Reference

Class intended to support codegen of all kind of the reduction clauses. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.h"

Public Member Functions

 ReductionCodeGen (ArrayRef< const Expr *> Shareds, ArrayRef< const Expr *> Privates, ArrayRef< const Expr *> ReductionOps)
 
void emitSharedLValue (CodeGenFunction &CGF, unsigned N)
 Emits lvalue for a reduction item. More...
 
void emitAggregateType (CodeGenFunction &CGF, unsigned N)
 Emits the code for the variable-modified type, if required. More...
 
void emitAggregateType (CodeGenFunction &CGF, unsigned N, llvm::Value *Size)
 Emits the code for the variable-modified type, if required. More...
 
void emitInitialization (CodeGenFunction &CGF, unsigned N, Address PrivateAddr, LValue SharedLVal, llvm::function_ref< bool(CodeGenFunction &)> DefaultInit)
 Performs initialization of the private copy for the reduction item. More...
 
bool needCleanups (unsigned N)
 Returns true if the private copy requires cleanups. More...
 
void emitCleanups (CodeGenFunction &CGF, unsigned N, Address PrivateAddr)
 Emits cleanup code for the reduction item. More...
 
Address adjustPrivateAddress (CodeGenFunction &CGF, unsigned N, Address PrivateAddr)
 Adjusts PrivatedAddr for using instead of the original variable address in normal operations. More...
 
LValue getSharedLValue (unsigned N) const
 Returns LValue for the reduction item. More...
 
std::pair< llvm::Value *, llvm::Value * > getSizes (unsigned N) const
 Returns the size of the reduction item (in chars and total number of elements in the item), or nullptr, if the size is a constant. More...
 
const VarDeclgetBaseDecl (unsigned N) const
 Returns the base declaration of the reduction item. More...
 
bool usesReductionInitializer (unsigned N) const
 Returns true if the initialization of the reduction item uses initializer from declare reduction construct. More...
 

Detailed Description

Class intended to support codegen of all kind of the reduction clauses.

Definition at line 113 of file CGOpenMPRuntime.h.

Constructor & Destructor Documentation

◆ ReductionCodeGen()

ReductionCodeGen::ReductionCodeGen ( ArrayRef< const Expr *>  Shareds,
ArrayRef< const Expr *>  Privates,
ArrayRef< const Expr *>  ReductionOps 
)

Definition at line 920 of file CGOpenMPRuntime.cpp.

Member Function Documentation

◆ adjustPrivateAddress()

Address ReductionCodeGen::adjustPrivateAddress ( CodeGenFunction CGF,
unsigned  N,
Address  PrivateAddr 
)

◆ emitAggregateType() [1/2]

void ReductionCodeGen::emitAggregateType ( CodeGenFunction CGF,
unsigned  N 
)

◆ emitAggregateType() [2/2]

void ReductionCodeGen::emitAggregateType ( CodeGenFunction CGF,
unsigned  N,
llvm::Value Size 
)

Emits the code for the variable-modified type, if required.

Parameters
NNumber of the reduction item.
SizeSize of the type in chars.

Definition at line 982 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::RValue::get(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), and clang::VariableArrayType::getSizeExpr().

◆ emitCleanups()

void ReductionCodeGen::emitCleanups ( CodeGenFunction CGF,
unsigned  N,
Address  PrivateAddr 
)

Emits cleanup code for the reduction item.

Parameters
NNumber of the reduction item.
PrivateAddrAddress of the corresponding private item.

Definition at line 1039 of file CGOpenMPRuntime.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), and clang::CodeGen::CodeGenFunction::pushDestroy().

Referenced by emitReduceFiniFunction().

◆ emitInitialization()

void ReductionCodeGen::emitInitialization ( CodeGenFunction CGF,
unsigned  N,
Address  PrivateAddr,
LValue  SharedLVal,
llvm::function_ref< bool(CodeGenFunction &)>  DefaultInit 
)

◆ emitSharedLValue()

void ReductionCodeGen::emitSharedLValue ( CodeGenFunction CGF,
unsigned  N 
)

Emits lvalue for a reduction item.

Parameters
NNumber of the reduction item.

Definition at line 936 of file CGOpenMPRuntime.cpp.

◆ getBaseDecl()

const VarDecl* clang::CodeGen::ReductionCodeGen::getBaseDecl ( unsigned  N) const
inline

Returns the base declaration of the reduction item.

Definition at line 193 of file CGOpenMPRuntime.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit().

◆ getSharedLValue()

LValue clang::CodeGen::ReductionCodeGen::getSharedLValue ( unsigned  N) const
inline

◆ getSizes()

std::pair<llvm::Value *, llvm::Value *> clang::CodeGen::ReductionCodeGen::getSizes ( unsigned  N) const
inline

Returns the size of the reduction item (in chars and total number of elements in the item), or nullptr, if the size is a constant.

Definition at line 189 of file CGOpenMPRuntime.h.

Referenced by emitReduceCombFunction(), emitReduceFiniFunction(), emitReduceInitFunction(), and clang::CodeGen::emitTaskReductionFixups().

◆ needCleanups()

bool ReductionCodeGen::needCleanups ( unsigned  N)

Returns true if the private copy requires cleanups.

Definition at line 1031 of file CGOpenMPRuntime.cpp.

References clang::QualType::DK_none.

Referenced by emitReduceFiniFunction().

◆ usesReductionInitializer()

bool ReductionCodeGen::usesReductionInitializer ( unsigned  N) const

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