class OMPReductionClause

Declaration

class OMPReductionClause : public OMPVarListClause,
                           public OMPClauseWithPostUpdate,
                           private TrailingObjects { /* full declaration omitted */ };

Description

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

Declared at: clang/include/clang/AST/OpenMPClause.h:3039

Inherits from: OMPVarListClause, OMPClauseWithPostUpdate, TrailingObjects

Member Variables

private clang::OpenMPReductionClauseModifier Modifier = OMPC_REDUCTION_unknown
Reduction modifier.
private clang::SourceLocation ModifierLoc
Reduction modifier location.
private clang::SourceLocation ColonLoc
Location of ':'.
private clang::NestedNameSpecifierLoc QualifierLoc
Nested name specifier for C++.
private clang::DeclarationNameInfo NameInfo
Name of custom operator.

Method Overview

  • public static clang::OMPReductionClause * Create(const clang::ASTContext & C, clang::SourceLocation StartLoc, clang::SourceLocation LParenLoc, clang::SourceLocation ModifierLoc, clang::SourceLocation ColonLoc, clang::SourceLocation EndLoc, clang::OpenMPReductionClauseModifier Modifier, ArrayRef<clang::Expr *> VL, clang::NestedNameSpecifierLoc QualifierLoc, const clang::DeclarationNameInfo & NameInfo, ArrayRef<clang::Expr *> Privates, ArrayRef<clang::Expr *> LHSExprs, ArrayRef<clang::Expr *> RHSExprs, ArrayRef<clang::Expr *> ReductionOps, ArrayRef<clang::Expr *> CopyOps, ArrayRef<clang::Expr *> CopyArrayTemps, ArrayRef<clang::Expr *> CopyArrayElems, clang::Stmt * PreInit, clang::Expr * PostUpdate)
  • public static clang::OMPReductionClause * CreateEmpty(const clang::ASTContext & C, unsigned int N, clang::OpenMPReductionClauseModifier Modifier)
  • private OMPReductionClause(unsigned int N)
  • private OMPReductionClause(clang::SourceLocation StartLoc, clang::SourceLocation LParenLoc, clang::SourceLocation ModifierLoc, clang::SourceLocation ColonLoc, clang::SourceLocation EndLoc, clang::OpenMPReductionClauseModifier Modifier, unsigned int N, clang::NestedNameSpecifierLoc QualifierLoc, const clang::DeclarationNameInfo & NameInfo)
  • public clang::OMPClause::const_child_range children() const
  • public clang::OMPClause::child_range children()
  • public static bool classof(const clang::OMPClause * T)
  • public clang::OMPReductionClause::helper_expr_range copy_array_elems()
  • public clang::OMPReductionClause::helper_expr_const_range copy_array_elems() const
  • public clang::OMPReductionClause::helper_expr_range copy_array_temps()
  • public clang::OMPReductionClause::helper_expr_const_range copy_array_temps() const
  • public clang::OMPReductionClause::helper_expr_range copy_ops()
  • public clang::OMPReductionClause::helper_expr_const_range copy_ops() const
  • public clang::SourceLocation getColonLoc() const
  • private MutableArrayRef<clang::Expr *> getInscanCopyArrayElems()
  • private ArrayRef<const clang::Expr *> getInscanCopyArrayElems() const
  • private MutableArrayRef<clang::Expr *> getInscanCopyArrayTemps()
  • private ArrayRef<const clang::Expr *> getInscanCopyArrayTemps() const
  • private MutableArrayRef<clang::Expr *> getInscanCopyOps()
  • private ArrayRef<const clang::Expr *> getInscanCopyOps() const
  • private ArrayRef<const clang::Expr *> getLHSExprs() const
  • private MutableArrayRef<clang::Expr *> getLHSExprs()
  • public clang::OpenMPReductionClauseModifier getModifier() const
  • public clang::SourceLocation getModifierLoc() const
  • public const clang::DeclarationNameInfo & getNameInfo() const
  • private MutableArrayRef<clang::Expr *> getPrivates()
  • private ArrayRef<const clang::Expr *> getPrivates() const
  • public clang::NestedNameSpecifierLoc getQualifierLoc() const
  • private MutableArrayRef<clang::Expr *> getRHSExprs()
  • private ArrayRef<const clang::Expr *> getRHSExprs() const
  • private ArrayRef<const clang::Expr *> getReductionOps() const
  • private MutableArrayRef<clang::Expr *> getReductionOps()
  • public clang::OMPReductionClause::helper_expr_range lhs_exprs()
  • public clang::OMPReductionClause::helper_expr_const_range lhs_exprs() const
  • public clang::OMPReductionClause::helper_expr_const_range privates() const
  • public clang::OMPReductionClause::helper_expr_range privates()
  • public clang::OMPReductionClause::helper_expr_range reduction_ops()
  • public clang::OMPReductionClause::helper_expr_const_range reduction_ops() const
  • public clang::OMPReductionClause::helper_expr_const_range rhs_exprs() const
  • public clang::OMPReductionClause::helper_expr_range rhs_exprs()
  • private void setColonLoc(clang::SourceLocation CL)
  • private void setInscanCopyArrayElems(ArrayRef<clang::Expr *> CopyArrayElems)
  • private void setInscanCopyArrayTemps(ArrayRef<clang::Expr *> CopyArrayTemps)
  • private void setInscanCopyOps(ArrayRef<clang::Expr *> Ops)
  • private void setLHSExprs(ArrayRef<clang::Expr *> LHSExprs)
  • private void setModifier(clang::OpenMPReductionClauseModifier M)
  • private void setModifierLoc(clang::SourceLocation Loc)
  • private void setNameInfo(clang::DeclarationNameInfo DNI)
  • private void setPrivates(ArrayRef<clang::Expr *> Privates)
  • private void setQualifierLoc(clang::NestedNameSpecifierLoc NSL)
  • private void setRHSExprs(ArrayRef<clang::Expr *> RHSExprs)
  • private void setReductionOps(ArrayRef<clang::Expr *> ReductionOps)
  • public clang::OMPClause::child_range used_children()
  • public clang::OMPClause::const_child_range used_children() const

Inherited from OMPClauseWithPostUpdate:

Inherited from OMPClauseWithPreInit:

Methods

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

Description

Creates clause with a list of variables \a VL. Required for proper codegen of final reduction operation performed by the reduction clause.

Declared at: clang/include/clang/AST/OpenMPClause.h:3239

Parameters

const clang::ASTContext& C
clang::SourceLocation StartLoc
Starting location of the clause.
clang::SourceLocation LParenLoc
Location of '('.
clang::SourceLocation ModifierLoc
Modifier location.
clang::SourceLocation ColonLoc
Location of ':'.
clang::SourceLocation EndLoc
Ending location of the clause.
clang::OpenMPReductionClauseModifier Modifier
ArrayRef<clang::Expr*> VL
The variables in the clause.
clang::NestedNameSpecifierLoc QualifierLoc
The nested-name qualifier with location information
const clang::DeclarationNameInfo& NameInfo
The full name info for reduction identifier.
ArrayRef<clang::Expr*> Privates
List of helper expressions for proper generation of private copies.
ArrayRef<clang::Expr*> LHSExprs
List of helper expressions for proper generation of assignment operation required for copyprivate clause. This list represents LHSs of the reduction expressions.
ArrayRef<clang::Expr*> RHSExprs
List 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.
ArrayRef<clang::Expr*> ReductionOps
List of helper expressions that represents reduction expressions:
ArrayRef<clang::Expr*> CopyOps
List of copy operations for inscan reductions:
ArrayRef<clang::Expr*> CopyArrayTemps
Temp arrays for prefix sums.
ArrayRef<clang::Expr*> CopyArrayElems
Temp arrays for prefix sums.
clang::Stmt* PreInit
Statement that must be executed before entering the OpenMP region with this clause.
clang::Expr* PostUpdate
Expression that must be executed after exit from the OpenMP region with this clause.

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

Description

Creates an empty clause with the place for \a N variables.

Declared at: clang/include/clang/AST/OpenMPClause.h:3255

Parameters

const clang::ASTContext& C
AST context.
unsigned int N
The number of variables.
clang::OpenMPReductionClauseModifier Modifier
Reduction modifier.

OMPReductionClause(unsigned int N)

Description

Build an empty clause.

Declared at: clang/include/clang/AST/OpenMPClause.h:3087

Parameters

unsigned int N
Number of variables.

OMPReductionClause(
    clang::SourceLocation StartLoc,
    clang::SourceLocation LParenLoc,
    clang::SourceLocation ModifierLoc,
    clang::SourceLocation ColonLoc,
    clang::SourceLocation EndLoc,
    clang::OpenMPReductionClauseModifier Modifier,
    unsigned int N,
    clang::NestedNameSpecifierLoc QualifierLoc,
    const clang::DeclarationNameInfo& NameInfo)

Description

Build clause with number of variables \a N.

Declared at: clang/include/clang/AST/OpenMPClause.h:3072

Parameters

clang::SourceLocation StartLoc
Starting location of the clause.
clang::SourceLocation LParenLoc
Location of '('.
clang::SourceLocation ModifierLoc
Modifier location.
clang::SourceLocation ColonLoc
Location of ':'.
clang::SourceLocation EndLoc
Ending location of the clause.
clang::OpenMPReductionClauseModifier Modifier
unsigned int N
Number of the variables in the clause.
clang::NestedNameSpecifierLoc QualifierLoc
The nested-name qualifier with location information
const clang::DeclarationNameInfo& NameInfo
The full name info for reduction identifier.

clang::OMPClause::const_child_range children()
    const

Declared at: clang/include/clang/AST/OpenMPClause.h:3348

clang::OMPClause::child_range children()

Declared at: clang/include/clang/AST/OpenMPClause.h:3343

static bool classof(const clang::OMPClause* T)

Declared at: clang/include/clang/AST/OpenMPClause.h:3362

Parameters

const clang::OMPClause* T

clang::OMPReductionClause::helper_expr_range
copy_array_elems()

Declared at: clang/include/clang/AST/OpenMPClause.h:3338

clang::OMPReductionClause::helper_expr_const_range
copy_array_elems() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3333

clang::OMPReductionClause::helper_expr_range
copy_array_temps()

Declared at: clang/include/clang/AST/OpenMPClause.h:3328

clang::OMPReductionClause::helper_expr_const_range
copy_array_temps() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3323

clang::OMPReductionClause::helper_expr_range
copy_ops()

Declared at: clang/include/clang/AST/OpenMPClause.h:3318

clang::OMPReductionClause::helper_expr_const_range
copy_ops() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3313

clang::SourceLocation getColonLoc() const

Description

Gets location of ':' symbol in clause.

Declared at: clang/include/clang/AST/OpenMPClause.h:3265

MutableArrayRef<clang::Expr*>
getInscanCopyArrayElems()

Description

Get the list of helper inscan copy temps.

Declared at: clang/include/clang/AST/OpenMPClause.h:3190

ArrayRef<const clang::Expr*>
getInscanCopyArrayElems() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3194

MutableArrayRef<clang::Expr*>
getInscanCopyArrayTemps()

Description

Get the list of helper inscan copy temps.

Declared at: clang/include/clang/AST/OpenMPClause.h:3179

ArrayRef<const clang::Expr*>
getInscanCopyArrayTemps() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3182

MutableArrayRef<clang::Expr*> getInscanCopyOps()

Description

Get the list of helper inscan copy operations.

Declared at: clang/include/clang/AST/OpenMPClause.h:3168

ArrayRef<const clang::Expr*> getInscanCopyOps()
    const

Declared at: clang/include/clang/AST/OpenMPClause.h:3171

ArrayRef<const clang::Expr*> getLHSExprs() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3130

MutableArrayRef<clang::Expr*> getLHSExprs()

Description

Get the list of helper LHS expressions.

Declared at: clang/include/clang/AST/OpenMPClause.h:3127

clang::OpenMPReductionClauseModifier getModifier()
    const

Description

Returns modifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3259

clang::SourceLocation getModifierLoc() const

Description

Returns modifier location.

Declared at: clang/include/clang/AST/OpenMPClause.h:3262

const clang::DeclarationNameInfo& getNameInfo()
    const

Description

Gets the name info for specified reduction identifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3268

MutableArrayRef<clang::Expr*> getPrivates()

Description

Get the list of helper privates.

Declared at: clang/include/clang/AST/OpenMPClause.h:3114

ArrayRef<const clang::Expr*> getPrivates() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3117

clang::NestedNameSpecifierLoc getQualifierLoc()
    const

Description

Gets the nested name specifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3271

MutableArrayRef<clang::Expr*> getRHSExprs()

Description

Get the list of helper destination expressions.

Declared at: clang/include/clang/AST/OpenMPClause.h:3142

ArrayRef<const clang::Expr*> getRHSExprs() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3145

ArrayRef<const clang::Expr*> getReductionOps()
    const

Declared at: clang/include/clang/AST/OpenMPClause.h:3159

MutableArrayRef<clang::Expr*> getReductionOps()

Description

Get the list of helper reduction expressions.

Declared at: clang/include/clang/AST/OpenMPClause.h:3156

clang::OMPReductionClause::helper_expr_range
lhs_exprs()

Declared at: clang/include/clang/AST/OpenMPClause.h:3291

clang::OMPReductionClause::helper_expr_const_range
lhs_exprs() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3287

clang::OMPReductionClause::helper_expr_const_range
privates() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3279

clang::OMPReductionClause::helper_expr_range
privates()

Declared at: clang/include/clang/AST/OpenMPClause.h:3283

clang::OMPReductionClause::helper_expr_range
reduction_ops()

Declared at: clang/include/clang/AST/OpenMPClause.h:3308

clang::OMPReductionClause::helper_expr_const_range
reduction_ops() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3303

clang::OMPReductionClause::helper_expr_const_range
rhs_exprs() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3295

clang::OMPReductionClause::helper_expr_range
rhs_exprs()

Declared at: clang/include/clang/AST/OpenMPClause.h:3299

void setColonLoc(clang::SourceLocation CL)

Description

Sets location of ':' symbol in clause.

Declared at: clang/include/clang/AST/OpenMPClause.h:3100

Parameters

clang::SourceLocation CL

void setInscanCopyArrayElems(
    ArrayRef<clang::Expr*> CopyArrayElems)

Description

Set list of helper temp elements vars for inscan copy array operations.

Declared at: clang/include/clang/AST/OpenMPClause.h:3187

Parameters

ArrayRef<clang::Expr*> CopyArrayElems

void setInscanCopyArrayTemps(
    ArrayRef<clang::Expr*> CopyArrayTemps)

Description

Set list of helper temp vars for inscan copy array operations.

Declared at: clang/include/clang/AST/OpenMPClause.h:3176

Parameters

ArrayRef<clang::Expr*> CopyArrayTemps

void setInscanCopyOps(ArrayRef<clang::Expr*> Ops)

Description

Set list of helper copy operations for inscan reductions. The form is: Temps[i] = LHS[i];

Declared at: clang/include/clang/AST/OpenMPClause.h:3165

Parameters

ArrayRef<clang::Expr*> Ops

void setLHSExprs(ArrayRef<clang::Expr*> LHSExprs)

Description

Set list of helper expressions, required for proper codegen of the clause. These expressions represent LHS expression in the final reduction expression performed by the reduction clause.

Declared at: clang/include/clang/AST/OpenMPClause.h:3124

Parameters

ArrayRef<clang::Expr*> LHSExprs

void setModifier(
    clang::OpenMPReductionClauseModifier M)

Description

Sets reduction modifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3094

Parameters

clang::OpenMPReductionClauseModifier M

void setModifierLoc(clang::SourceLocation Loc)

Description

Sets location of the modifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3097

Parameters

clang::SourceLocation Loc

void setNameInfo(clang::DeclarationNameInfo DNI)

Description

Sets the name info for specified reduction identifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3103

Parameters

clang::DeclarationNameInfo DNI

void setPrivates(ArrayRef<clang::Expr*> Privates)

Description

Set list of helper expressions, required for proper codegen of the clause. These expressions represent private copy of the reduction variable.

Declared at: clang/include/clang/AST/OpenMPClause.h:3111

Parameters

ArrayRef<clang::Expr*> Privates

void setQualifierLoc(
    clang::NestedNameSpecifierLoc NSL)

Description

Sets the nested name specifier.

Declared at: clang/include/clang/AST/OpenMPClause.h:3106

Parameters

clang::NestedNameSpecifierLoc NSL

void setRHSExprs(ArrayRef<clang::Expr*> RHSExprs)

Description

Set list of helper expressions, required for proper codegen of the clause. These expressions represent RHS expression in the final reduction expression performed by the reduction clause. Also, variables in these expressions are used for proper initialization of reduction copies.

Declared at: clang/include/clang/AST/OpenMPClause.h:3139

Parameters

ArrayRef<clang::Expr*> RHSExprs

void setReductionOps(
    ArrayRef<clang::Expr*> ReductionOps)

Description

Set list of helper reduction expressions, required for proper codegen of the clause. These expressions are binary expressions or operator/custom reduction call that calculates new value from source helper expressions to destination helper expressions.

Declared at: clang/include/clang/AST/OpenMPClause.h:3153

Parameters

ArrayRef<clang::Expr*> ReductionOps

clang::OMPClause::child_range used_children()

Declared at: clang/include/clang/AST/OpenMPClause.h:3353

clang::OMPClause::const_child_range
used_children() const

Declared at: clang/include/clang/AST/OpenMPClause.h:3357