clang 8.0.0

Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
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]
Collaboration 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 = llvm::iterator_range< helper_expr_const_iterator >
Public Types inherited from clang::OMPVarListClause< OMPReductionClause >
using | varlist_iterator = MutableArrayRef< Expr *>::iterator
using | varlist_const_iterator = ArrayRef< const Expr *>::iterator
using | varlist_range = llvm::iterator_range< varlist_iterator >
using | varlist_const_range = llvm::iterator_range< varlist_const_iterator >
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
SourceLocation | getColonLoc () const
| Gets location of ':' symbol in clause. More...
const DeclarationNameInfo & | getNameInfo () const
| Gets the name info for specified reduction identifier. More...
NestedNameSpecifierLoc | getQualifierLoc () const
| Gets the nested name specifier. More...
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_expr_const_range | reduction_ops () const
helper_expr_range | reduction_ops ()
child_range | children ()
Public Member Functions inherited from clang::OMPVarListClause< OMPReductionClause >
ArrayRef< const Expr *> | getVarRefs () const
| Fetches list of all variables in the clause. More...
unsigned | varlist_size () const
bool | varlist_empty () const
varlist_range | varlists ()
varlist_const_range | varlists () const
varlist_iterator | varlist_begin ()
varlist_const_iterator | varlist_begin () const
varlist_iterator | varlist_end ()
varlist_const_iterator | varlist_end () const
void | setLParenLoc (SourceLocation Loc)
| Sets the location of '('. More...
SourceLocation | getLParenLoc () const
| Returns the location of '('. More...
Public Member Functions inherited from clang::OMPClause
SourceLocation | getBeginLoc () const
| Returns the starting location of the clause. More...
SourceLocation | getEndLoc () const
| Returns the ending location of the clause. More...
void | setLocStart (SourceLocation Loc)
| Sets the starting location of the clause. More...
void | setLocEnd (SourceLocation Loc)
| Sets the ending location of the clause. More...
OpenMPClauseKind | getClauseKind () const
| Returns kind of OpenMP clause (private, shared, reduction, etc.). More...
bool | isImplicit () const
child_range | children ()
const_child_range | children () const
Public Member Functions inherited from clang::OMPClauseWithPostUpdate
const Expr * | getPostUpdateExpr () const
| Get post-update expression for the clause. More...
Expr * | getPostUpdateExpr ()
| Get post-update expression for the clause. More...
Public Member Functions inherited from clang::OMPClauseWithPreInit
const Stmt * | getPreInitStmt () const
| Get pre-initialization statement for the clause. More...
Stmt * | getPreInitStmt ()
| Get pre-initialization statement for the clause. More...
OpenMPDirectiveKind | getCaptureRegion () const
| Get capture region for the stmt in the clause. More...

## Static Public Member Functions
static OMPReductionClause * | Create (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr *> Privates, ArrayRef< Expr *> LHSExprs, ArrayRef< Expr *> RHSExprs, ArrayRef< Expr *> ReductionOps, Stmt *PreInit, Expr *PostUpdate)
| Creates clause with a list of variables VL. More...
static OMPReductionClause * | CreateEmpty (const ASTContext &C, unsigned N)
| Creates an empty clause with the place for N variables. More...
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 OMPClauseWithPostUpdate * | get (OMPClause *C)
static const OMPClauseWithPostUpdate * | get (const OMPClause *C)
Static Public Member Functions inherited from clang::OMPClauseWithPreInit
static OMPClauseWithPreInit * | get (OMPClause *C)
static const OMPClauseWithPreInit * | get (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. More...
MutableArrayRef< Expr *> | getVarRefs ()
| Fetches list of variables associated with this clause. More...
void | setVarRefs (ArrayRef< Expr * > VL)
| Sets the list of variables for this clause. More...
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. More...
Protected Member Functions inherited from clang::OMPClauseWithPreInit
| OMPClauseWithPreInit (const OMPClause *This)
void | setPreInitStmt (Stmt *S, OpenMPDirectiveKind ThisRegion=OMPD_unknown)
| Set pre-initialization statement for the clause. More...

## 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 1921 of file OpenMPClause.h.

## Member Typedef Documentation

## ◆ helper_expr_const_iterator

using clang::OMPReductionClause::helper_expr_const_iterator = ArrayRef<const Expr *>::iterator

Definition at line 2086 of file OpenMPClause.h.

## ◆ helper_expr_const_range

using clang::OMPReductionClause::helper_expr_const_range = llvm::iterator_range<helper_expr_const_iterator>

Definition at line 2089 of file OpenMPClause.h.

## ◆ helper_expr_iterator

using clang::OMPReductionClause::helper_expr_iterator = MutableArrayRef<Expr *>::iterator

Definition at line 2085 of file OpenMPClause.h.

## ◆ helper_expr_range

using clang::OMPReductionClause::helper_expr_range = llvm::iterator_range<helper_expr_iterator>

Definition at line 2087 of file OpenMPClause.h.

## Member Function Documentation

## ◆ children()

child_range clang::OMPReductionClause::children | ( |  | ) |
| inline

Definition at line 2125 of file OpenMPClause.h.

## ◆ classof()

static bool clang::OMPReductionClause::classof | ( | const OMPClause * | T | ) |
| inline static

Definition at line 2130 of file OpenMPClause.h.

References clang::OMPClause::getClauseKind().

## ◆ Create()

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

Creates clause with a list of variables VL.

Parameters

  StartLoc | Starting location of the clause.
  LParenLoc | Location of '('.
  ColonLoc | Location of ':'.
  EndLoc | Ending location of the clause.
  VL | The variables in the clause.
  QualifierLoc | The nested-name qualifier with location information
  NameInfo | The full name info for reduction identifier.
  Privates | List of helper expressions for proper generation of private copies.
  LHSExprs | List of helper expressions for proper generation of assignment operation required for copyprivate clause. This list represents LHSs of the reduction expressions.
  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.
  ReductionOps | List 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.
  PreInit | Statement that must be executed before entering the OpenMP region with this clause.
  PostUpdate | Expression that must be executed after exit from the OpenMP region with this clause.

Definition at line 559 of file OpenMPClause.cpp.

References clang::ASTContext::Allocate(), clang::OMPClauseWithPostUpdate::setPostUpdateExpr(), clang::OMPClauseWithPreInit::setPreInitStmt(), and clang::OMPVarListClause< T >::setVarRefs().

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

## ◆ CreateEmpty()

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

Creates an empty clause with the place for N variables.

Parameters

  C | AST context.
  N | The number of variables.

Definition at line 579 of file OpenMPClause.cpp.

References clang::ASTContext::Allocate(), clang::getPrivates(), and Privates.

## ◆ getColonLoc()

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

Gets location of ':' symbol in clause.

Definition at line 2077 of file OpenMPClause.h.

References ColonLoc.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getNameInfo()

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

Gets the name info for specified reduction identifier.

Definition at line 2080 of file OpenMPClause.h.

Referenced by OMPIsDevicePtrClause::CreateEmpty(), clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ getQualifierLoc()

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

Gets the nested name specifier.

Definition at line 2083 of file OpenMPClause.h.

Referenced by OMPIsDevicePtrClause::CreateEmpty(), clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ lhs_exprs() [1/2]

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

Definition at line 2099 of file OpenMPClause.h.

Referenced by clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ lhs_exprs() [2/2]

helper_expr_range clang::OMPReductionClause::lhs_exprs | ( |  | ) |
| inline

Definition at line 2103 of file OpenMPClause.h.

## ◆ privates() [1/2]

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

Definition at line 2091 of file OpenMPClause.h.

References clang::getPrivates().

Referenced by clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ privates() [2/2]

helper_expr_range clang::OMPReductionClause::privates | ( |  | ) |
| inline

Definition at line 2095 of file OpenMPClause.h.

References clang::getPrivates().

## ◆ reduction_ops() [1/2]

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

Definition at line 2115 of file OpenMPClause.h.

Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective(), and clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ reduction_ops() [2/2]

helper_expr_range clang::OMPReductionClause::reduction_ops | ( |  | ) |
| inline

Definition at line 2120 of file OpenMPClause.h.

## ◆ rhs_exprs() [1/2]

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

Definition at line 2107 of file OpenMPClause.h.

Referenced by clang::OMPClauseWriter::VisitOMPClauseWithPostUpdate().

## ◆ rhs_exprs() [2/2]

helper_expr_range clang::OMPReductionClause::rhs_exprs | ( |  | ) |
| inline

Definition at line 2111 of file OpenMPClause.h.

## Friends And Related Function Documentation

## ◆ OMPClauseReader

friend class OMPClauseReader
| friend

Definition at line 1925 of file OpenMPClause.h.

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

- include/clang/AST/OpenMPClause.h
- lib/AST/OpenMPClause.cpp