clang 22.0.0git
clang::OMPReductionClause Class Referencefinal

This represents clause 'reduction' in the '#pragma omp ...' directives. More...

#include "clang/AST/OpenMPClause.h"

Inheritance diagram for clang::OMPReductionClause:
[legend]

Public Types

using helper_expr_iterator = MutableArrayRef<Expr *>::iterator
using helper_expr_const_iterator = ArrayRef<const Expr *>::iterator
using helper_expr_range = llvm::iterator_range<helper_expr_iterator>
using helper_expr_const_range
using helper_flag_iterator = MutableArrayRef<bool>::iterator
using helper_flag_const_iterator = ArrayRef<bool>::iterator
using helper_flag_range = llvm::iterator_range<helper_flag_iterator>
using helper_flag_const_range
Public Types inherited from clang::OMPVarListClause< OMPReductionClause >
using varlist_iterator
using varlist_const_iterator
using varlist_range
using varlist_const_range
Public Types inherited from clang::OMPClause
using child_iterator = StmtIterator
using const_child_iterator = ConstStmtIterator
using child_range = llvm::iterator_range<child_iterator>
using const_child_range = llvm::iterator_range<const_child_iterator>

Public Member Functions

OpenMPReductionClauseModifier getModifier () const
 Returns modifier.
OpenMPOriginalSharingModifier getOriginalSharingModifier () const
 Returns Original Sharing Modifier.
SourceLocation getModifierLoc () const
 Returns modifier location.
SourceLocation getColonLoc () const
 Gets location of ':' symbol in clause.
const DeclarationNameInfogetNameInfo () const
 Gets the name info for specified reduction identifier.
NestedNameSpecifierLoc getQualifierLoc () const
 Gets the nested name specifier.
helper_expr_const_range privates () const
helper_expr_range privates ()
helper_expr_const_range lhs_exprs () const
helper_expr_range lhs_exprs ()
helper_expr_const_range rhs_exprs () const
helper_expr_range rhs_exprs ()
helper_flag_const_range private_var_reduction_flags () const
helper_flag_range private_var_reduction_flags ()
helper_expr_const_range reduction_ops () const
helper_expr_range reduction_ops ()
helper_expr_const_range copy_ops () const
helper_expr_range copy_ops ()
helper_expr_const_range copy_array_temps () const
helper_expr_range copy_array_temps ()
helper_expr_const_range copy_array_elems () const
helper_expr_range copy_array_elems ()
child_range children ()
const_child_range children () const
child_range used_children ()
const_child_range used_children () const
Public Member Functions inherited from clang::OMPVarListClause< OMPReductionClause >
unsigned varlist_size () const
bool varlist_empty () const
varlist_range varlist ()
varlist_iterator varlist_begin ()
varlist_iterator varlist_end ()
void setLParenLoc (SourceLocation Loc)
 Sets the location of '('.
SourceLocation getLParenLoc () const
 Returns the location of '('.
Public Member Functions inherited from clang::OMPClause
SourceLocation getBeginLoc () const
 Returns the starting location of the clause.
SourceLocation getEndLoc () const
 Returns the ending location of the clause.
void setLocStart (SourceLocation Loc)
 Sets the starting location of the clause.
void setLocEnd (SourceLocation Loc)
 Sets the ending location of the clause.
OpenMPClauseKind getClauseKind () const
 Returns kind of OpenMP clause (private, shared, reduction, etc.).
bool isImplicit () const
child_range children ()
const_child_range children () const
child_range used_children ()
 Get the iterator range for the expressions used in the clauses.
const_child_range used_children () const
Public Member Functions inherited from clang::OMPClauseWithPostUpdate
const ExprgetPostUpdateExpr () const
 Get post-update expression for the clause.
ExprgetPostUpdateExpr ()
 Get post-update expression for the clause.
Public Member Functions inherited from clang::OMPClauseWithPreInit
const StmtgetPreInitStmt () const
 Get pre-initialization statement for the clause.
StmtgetPreInitStmt ()
 Get pre-initialization statement for the clause.
OpenMPDirectiveKind getCaptureRegion () const
 Get capture region for the stmt in the clause.

Static Public Member Functions

static OMPReductionClauseCreate (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, OpenMPReductionClauseModifier Modifier, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > Privates, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps, ArrayRef< Expr * > CopyOps, ArrayRef< Expr * > CopyArrayTemps, ArrayRef< Expr * > CopyArrayElems, Stmt *PreInit, Expr *PostUpdate, ArrayRef< bool > IsPrivateVarReduction, OpenMPOriginalSharingModifier OriginalSharingModifier)
 Creates clause with a list of variables VL.
static OMPReductionClauseCreateEmpty (const ASTContext &C, unsigned N, OpenMPReductionClauseModifier Modifier)
 Creates an empty clause with the place for N variables.
static bool classof (const OMPClause *T)
Static Public Member Functions inherited from clang::OMPClause
static bool classof (const OMPClause *)
Static Public Member Functions inherited from clang::OMPClauseWithPostUpdate
static OMPClauseWithPostUpdateget (OMPClause *C)
static const OMPClauseWithPostUpdateget (const OMPClause *C)
Static Public Member Functions inherited from clang::OMPClauseWithPreInit
static OMPClauseWithPreInitget (OMPClause *C)
static const OMPClauseWithPreInitget (const OMPClause *C)

Friends

class OMPClauseReader

Additional Inherited Members

Protected Member Functions inherited from clang::OMPVarListClause< OMPReductionClause >
 OMPVarListClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
 Build a clause with N variables.
MutableArrayRef< Expr * > getVarRefs ()
 Fetches list of variables associated with this clause.
void setVarRefs (ArrayRef< Expr * > VL)
 Sets the list of variables for this clause.
Protected Member Functions inherited from clang::OMPClause
 OMPClause (OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
Protected Member Functions inherited from clang::OMPClauseWithPostUpdate
 OMPClauseWithPostUpdate (const OMPClause *This)
void setPostUpdateExpr (Expr *S)
 Set pre-initialization statement for the clause.
Protected Member Functions inherited from clang::OMPClauseWithPreInit
 OMPClauseWithPreInit (const OMPClause *This)
void setPreInitStmt (Stmt *S, OpenMPDirectiveKind ThisRegion=llvm::omp::OMPD_unknown)
 Set pre-initialization statement for the clause.

Detailed Description

This represents clause 'reduction' in the '#pragma omp ...' directives.

#pragma omp parallel reduction(+:a,b)

In this example directive '#pragma omp parallel' has clause 'reduction' with operator '+' and the variables 'a' and 'b'.

Definition at line 3906 of file OpenMPClause.h.

Member Typedef Documentation

◆ helper_expr_const_iterator

Definition at line 4183 of file OpenMPClause.h.

◆ helper_expr_const_range

Initial value:
llvm::iterator_range<helper_expr_const_iterator>

Definition at line 4185 of file OpenMPClause.h.

◆ helper_expr_iterator

◆ helper_expr_range

Definition at line 4184 of file OpenMPClause.h.

◆ helper_flag_const_iterator

◆ helper_flag_const_range

Initial value:
llvm::iterator_range<helper_flag_const_iterator>

Definition at line 4190 of file OpenMPClause.h.

◆ helper_flag_iterator

◆ helper_flag_range

Definition at line 4189 of file OpenMPClause.h.

Member Function Documentation

◆ children() [1/2]

child_range clang::OMPReductionClause::children ( )
inline

◆ children() [2/2]

const_child_range clang::OMPReductionClause::children ( ) const
inline

Definition at line 4272 of file OpenMPClause.h.

References Children, and children().

◆ classof()

bool clang::OMPReductionClause::classof ( const OMPClause * T)
inlinestatic

Definition at line 4286 of file OpenMPClause.h.

References clang::T.

◆ copy_array_elems() [1/2]

helper_expr_range clang::OMPReductionClause::copy_array_elems ( )
inline

Definition at line 4262 of file OpenMPClause.h.

◆ copy_array_elems() [2/2]

helper_expr_const_range clang::OMPReductionClause::copy_array_elems ( ) const
inline

Definition at line 4257 of file OpenMPClause.h.

◆ copy_array_temps() [1/2]

helper_expr_range clang::OMPReductionClause::copy_array_temps ( )
inline

Definition at line 4252 of file OpenMPClause.h.

◆ copy_array_temps() [2/2]

helper_expr_const_range clang::OMPReductionClause::copy_array_temps ( ) const
inline

Definition at line 4247 of file OpenMPClause.h.

◆ copy_ops() [1/2]

helper_expr_range clang::OMPReductionClause::copy_ops ( )
inline

Definition at line 4242 of file OpenMPClause.h.

◆ copy_ops() [2/2]

helper_expr_const_range clang::OMPReductionClause::copy_ops ( ) const
inline

Definition at line 4237 of file OpenMPClause.h.

◆ Create()

OMPReductionClause * OMPReductionClause::Create ( const ASTContext & C,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation ModifierLoc,
SourceLocation ColonLoc,
SourceLocation EndLoc,
OpenMPReductionClauseModifier Modifier,
ArrayRef< Expr * > VL,
NestedNameSpecifierLoc QualifierLoc,
const DeclarationNameInfo & NameInfo,
ArrayRef< Expr * > Privates,
ArrayRef< Expr * > LHSExprs,
ArrayRef< Expr * > RHSExprs,
ArrayRef< Expr * > ReductionOps,
ArrayRef< Expr * > CopyOps,
ArrayRef< Expr * > CopyArrayTemps,
ArrayRef< Expr * > CopyArrayElems,
Stmt * PreInit,
Expr * PostUpdate,
ArrayRef< bool > IsPrivateVarReduction,
OpenMPOriginalSharingModifier OriginalSharingModifier )
static

Creates clause with a list of variables VL.

Parameters
StartLocStarting location of the clause.
LParenLocLocation of '('.
ModifierLocModifier location.
ColonLocLocation of ':'.
EndLocEnding location of the clause.
VLThe variables in the clause.
QualifierLocThe nested-name qualifier with location information
NameInfoThe full name info for reduction identifier.
PrivatesList of helper expressions for proper generation of private copies.
LHSExprsList of helper expressions for proper generation of assignment operation required for copyprivate clause. This list represents LHSs of the reduction expressions.
RHSExprsList of helper expressions for proper generation of assignment operation required for copyprivate clause. This list represents RHSs of the reduction expressions. Also, variables in these expressions are used for proper initialization of reduction copies.
ReductionOpsList of helper expressions that represents reduction expressions:
LHSExprs binop RHSExprs;
operator binop(LHSExpr, RHSExpr);
<CutomReduction>(LHSExpr, RHSExpr);
Required for proper codegen of final reduction operation performed by the reduction clause.
CopyOpsList of copy operations for inscan reductions:
TempExprs = LHSExprs;
CopyArrayTempsTemp arrays for prefix sums.
CopyArrayElemsTemp arrays for prefix sums.
PreInitStatement that must be executed before entering the OpenMP region with this clause.
PostUpdateExpression that must be executed after exit from the OpenMP region with this clause.
IsPrivateVarReductionarray for private variable reduction flags

Definition at line 804 of file OpenMPClause.cpp.

References clang::C.

Referenced by clang::SemaOpenMP::ActOnOpenMPReductionClause().

◆ CreateEmpty()

OMPReductionClause * OMPReductionClause::CreateEmpty ( const ASTContext & C,
unsigned N,
OpenMPReductionClauseModifier Modifier )
static

Creates an empty clause with the place for N variables.

Parameters
CAST context.
NThe number of variables.
ModifierReduction modifier.

Definition at line 844 of file OpenMPClause.cpp.

References clang::C.

Referenced by clang::OMPClauseReader::readClause().

◆ getColonLoc()

SourceLocation clang::OMPReductionClause::getColonLoc ( ) const
inline

Gets location of ':' symbol in clause.

Definition at line 4174 of file OpenMPClause.h.

◆ getModifier()

OpenMPReductionClauseModifier clang::OMPReductionClause::getModifier ( ) const
inline

Returns modifier.

Definition at line 4163 of file OpenMPClause.h.

◆ getModifierLoc()

SourceLocation clang::OMPReductionClause::getModifierLoc ( ) const
inline

Returns modifier location.

Definition at line 4171 of file OpenMPClause.h.

◆ getNameInfo()

const DeclarationNameInfo & clang::OMPReductionClause::getNameInfo ( ) const
inline

Gets the name info for specified reduction identifier.

Definition at line 4177 of file OpenMPClause.h.

◆ getOriginalSharingModifier()

OpenMPOriginalSharingModifier clang::OMPReductionClause::getOriginalSharingModifier ( ) const
inline

Returns Original Sharing Modifier.

Definition at line 4166 of file OpenMPClause.h.

◆ getQualifierLoc()

NestedNameSpecifierLoc clang::OMPReductionClause::getQualifierLoc ( ) const
inline

Gets the nested name specifier.

Definition at line 4180 of file OpenMPClause.h.

◆ lhs_exprs() [1/2]

helper_expr_range clang::OMPReductionClause::lhs_exprs ( )
inline

Definition at line 4205 of file OpenMPClause.h.

◆ lhs_exprs() [2/2]

helper_expr_const_range clang::OMPReductionClause::lhs_exprs ( ) const
inline

Definition at line 4201 of file OpenMPClause.h.

◆ private_var_reduction_flags() [1/2]

helper_flag_range clang::OMPReductionClause::private_var_reduction_flags ( )
inline

Definition at line 4222 of file OpenMPClause.h.

◆ private_var_reduction_flags() [2/2]

helper_flag_const_range clang::OMPReductionClause::private_var_reduction_flags ( ) const
inline

Definition at line 4217 of file OpenMPClause.h.

◆ privates() [1/2]

helper_expr_range clang::OMPReductionClause::privates ( )
inline

Definition at line 4197 of file OpenMPClause.h.

◆ privates() [2/2]

helper_expr_const_range clang::OMPReductionClause::privates ( ) const
inline

Definition at line 4193 of file OpenMPClause.h.

◆ reduction_ops() [1/2]

helper_expr_range clang::OMPReductionClause::reduction_ops ( )
inline

Definition at line 4232 of file OpenMPClause.h.

◆ reduction_ops() [2/2]

helper_expr_const_range clang::OMPReductionClause::reduction_ops ( ) const
inline

Definition at line 4227 of file OpenMPClause.h.

◆ rhs_exprs() [1/2]

helper_expr_range clang::OMPReductionClause::rhs_exprs ( )
inline

Definition at line 4213 of file OpenMPClause.h.

◆ rhs_exprs() [2/2]

helper_expr_const_range clang::OMPReductionClause::rhs_exprs ( ) const
inline

Definition at line 4209 of file OpenMPClause.h.

◆ used_children() [1/2]

child_range clang::OMPReductionClause::used_children ( )
inline

◆ used_children() [2/2]

const_child_range clang::OMPReductionClause::used_children ( ) const
inline

Definition at line 4281 of file OpenMPClause.h.

References Children, and used_children().

◆ OMPClauseReader


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