clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::OMPLinearClause Class Referencefinal

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

#include "clang/AST/OpenMPClause.h"

Inheritance diagram for clang::OMPLinearClause:
Inheritance graph
[legend]

Public Types

using privates_iterator = MutableArrayRef< Expr * >::iterator
 
using privates_const_iterator = ArrayRef< const Expr * >::iterator
 
using privates_range = llvm::iterator_range< privates_iterator >
 
using privates_const_range = llvm::iterator_range< privates_const_iterator >
 
using inits_iterator = MutableArrayRef< Expr * >::iterator
 
using inits_const_iterator = ArrayRef< const Expr * >::iterator
 
using inits_range = llvm::iterator_range< inits_iterator >
 
using inits_const_range = llvm::iterator_range< inits_const_iterator >
 
using updates_iterator = MutableArrayRef< Expr * >::iterator
 
using updates_const_iterator = ArrayRef< const Expr * >::iterator
 
using updates_range = llvm::iterator_range< updates_iterator >
 
using updates_const_range = llvm::iterator_range< updates_const_iterator >
 
using finals_iterator = MutableArrayRef< Expr * >::iterator
 
using finals_const_iterator = ArrayRef< const Expr * >::iterator
 
using finals_range = llvm::iterator_range< finals_iterator >
 
using finals_const_range = llvm::iterator_range< finals_const_iterator >
 
using used_expressions_iterator = MutableArrayRef< Expr * >::iterator
 
using used_expressions_const_iterator = ArrayRef< const Expr * >::iterator
 
using used_expressions_range = llvm::iterator_range< used_expressions_iterator >
 
using used_expressions_const_range = llvm::iterator_range< used_expressions_const_iterator >
 
- Public Types inherited from clang::OMPVarListClause< OMPLinearClause >
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

void setModifier (OpenMPLinearClauseKind Kind)
 Set modifier.
 
OpenMPLinearClauseKind getModifier () const
 Return modifier.
 
void setModifierLoc (SourceLocation Loc)
 Set modifier location.
 
SourceLocation getModifierLoc () const
 Return modifier location.
 
void setColonLoc (SourceLocation Loc)
 Sets the location of ':'.
 
void setStepModifierLoc (SourceLocation Loc)
 Sets the location of 'step' modifier.
 
SourceLocation getColonLoc () const
 Returns the location of ':'.
 
SourceLocation getStepModifierLoc () const
 Returns the location of 'step' modifier.
 
ExprgetStep ()
 Returns linear step.
 
const ExprgetStep () const
 Returns linear step.
 
ExprgetCalcStep ()
 Returns expression to calculate linear step.
 
const ExprgetCalcStep () const
 Returns expression to calculate linear step.
 
void setUpdates (ArrayRef< Expr * > UL)
 Sets the list of update expressions for linear variables.
 
void setFinals (ArrayRef< Expr * > FL)
 Sets the list of final update expressions for linear variables.
 
void setUsedExprs (ArrayRef< Expr * > UE)
 Sets the list of used expressions for the linear clause.
 
privates_range privates ()
 
privates_const_range privates () const
 
inits_range inits ()
 
inits_const_range inits () const
 
updates_range updates ()
 
updates_const_range updates () const
 
finals_range finals ()
 
finals_const_range finals () const
 
used_expressions_range used_expressions ()
 
used_expressions_const_range used_expressions () const
 
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< OMPLinearClause >
ArrayRef< const Expr * > getVarRefs () const
 Fetches list of all variables in the clause.
 
unsigned varlist_size () const
 
bool varlist_empty () const
 
varlist_range varlist ()
 
varlist_const_range varlist () 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 '('.
 
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 OMPLinearClauseCreate (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation StepModifierLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
 Creates clause with a list of variables VL and a linear step Step.
 
static OMPLinearClauseCreateEmpty (const ASTContext &C, unsigned NumVars)
 Creates an empty clause with the place for NumVars 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< OMPLinearClause >
 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 'linear' in the '#pragma omp ...' directives.

#pragma omp simd linear(a,b : 2)

In this example directive '#pragma omp simd' has clause 'linear' with variables 'a', 'b' and linear step '2'.

Definition at line 4389 of file OpenMPClause.h.

Member Typedef Documentation

◆ finals_const_iterator

Definition at line 4622 of file OpenMPClause.h.

◆ finals_const_range

Definition at line 4624 of file OpenMPClause.h.

◆ finals_iterator

Definition at line 4621 of file OpenMPClause.h.

◆ finals_range

Definition at line 4623 of file OpenMPClause.h.

◆ inits_const_iterator

Definition at line 4596 of file OpenMPClause.h.

◆ inits_const_range

Definition at line 4598 of file OpenMPClause.h.

◆ inits_iterator

Definition at line 4595 of file OpenMPClause.h.

◆ inits_range

using clang::OMPLinearClause::inits_range = llvm::iterator_range<inits_iterator>

Definition at line 4597 of file OpenMPClause.h.

◆ privates_const_iterator

Definition at line 4583 of file OpenMPClause.h.

◆ privates_const_range

Definition at line 4585 of file OpenMPClause.h.

◆ privates_iterator

Definition at line 4582 of file OpenMPClause.h.

◆ privates_range

Definition at line 4584 of file OpenMPClause.h.

◆ updates_const_iterator

Definition at line 4609 of file OpenMPClause.h.

◆ updates_const_range

Definition at line 4611 of file OpenMPClause.h.

◆ updates_iterator

Definition at line 4608 of file OpenMPClause.h.

◆ updates_range

Definition at line 4610 of file OpenMPClause.h.

◆ used_expressions_const_iterator

Definition at line 4635 of file OpenMPClause.h.

◆ used_expressions_const_range

Definition at line 4638 of file OpenMPClause.h.

◆ used_expressions_iterator

Definition at line 4634 of file OpenMPClause.h.

◆ used_expressions_range

Definition at line 4636 of file OpenMPClause.h.

Member Function Documentation

◆ children() [1/2]

child_range clang::OMPLinearClause::children ( )
inline

◆ children() [2/2]

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

Definition at line 4654 of file OpenMPClause.h.

References children().

◆ classof()

static bool clang::OMPLinearClause::classof ( const OMPClause T)
inlinestatic

Definition at line 4666 of file OpenMPClause.h.

References clang::T.

◆ Create()

OMPLinearClause * OMPLinearClause::Create ( const ASTContext C,
SourceLocation  StartLoc,
SourceLocation  LParenLoc,
OpenMPLinearClauseKind  Modifier,
SourceLocation  ModifierLoc,
SourceLocation  ColonLoc,
SourceLocation  StepModifierLoc,
SourceLocation  EndLoc,
ArrayRef< Expr * >  VL,
ArrayRef< Expr * >  PL,
ArrayRef< Expr * >  IL,
Expr Step,
Expr CalcStep,
Stmt PreInit,
Expr PostUpdate 
)
static

Creates clause with a list of variables VL and a linear step Step.

Parameters
CAST Context.
StartLocStarting location of the clause.
LParenLocLocation of '('.
ModifierModifier of 'linear' clause.
ModifierLocModifier location.
ColonLocLocation of ':'.
StepModifierLocLocation of 'step' modifier.
EndLocEnding location of the clause.
VLList of references to the variables.
PLList of private copies of original variables.
ILList of initial values for the variables.
StepLinear step.
CalcStepCalculation of the linear step.
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.

Definition at line 584 of file OpenMPClause.cpp.

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

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

◆ CreateEmpty()

OMPLinearClause * OMPLinearClause::CreateEmpty ( const ASTContext C,
unsigned  NumVars 
)
static

Creates an empty clause with the place for NumVars variables.

Parameters
CAST context.
NumVarsNumber of variables.

Definition at line 616 of file OpenMPClause.cpp.

References clang::C.

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

◆ finals() [1/2]

finals_range clang::OMPLinearClause::finals ( )
inline

Definition at line 4626 of file OpenMPClause.h.

◆ finals() [2/2]

finals_const_range clang::OMPLinearClause::finals ( ) const
inline

Definition at line 4630 of file OpenMPClause.h.

◆ getCalcStep() [1/2]

Expr * clang::OMPLinearClause::getCalcStep ( )
inline

Returns expression to calculate linear step.

Definition at line 4566 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ getCalcStep() [2/2]

const Expr * clang::OMPLinearClause::getCalcStep ( ) const
inline

Returns expression to calculate linear step.

Definition at line 4569 of file OpenMPClause.h.

◆ getColonLoc()

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

Returns the location of ':'.

Definition at line 4554 of file OpenMPClause.h.

◆ getModifier()

OpenMPLinearClauseKind clang::OMPLinearClause::getModifier ( ) const
inline

Return modifier.

Definition at line 4539 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ getModifierLoc()

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

Return modifier location.

Definition at line 4545 of file OpenMPClause.h.

◆ getStep() [1/2]

Expr * clang::OMPLinearClause::getStep ( )
inline

Returns linear step.

Definition at line 4560 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ getStep() [2/2]

const Expr * clang::OMPLinearClause::getStep ( ) const
inline

Returns linear step.

Definition at line 4563 of file OpenMPClause.h.

◆ getStepModifierLoc()

SourceLocation clang::OMPLinearClause::getStepModifierLoc ( ) const
inline

Returns the location of 'step' modifier.

Definition at line 4557 of file OpenMPClause.h.

◆ inits() [1/2]

inits_range clang::OMPLinearClause::inits ( )
inline

Definition at line 4600 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ inits() [2/2]

inits_const_range clang::OMPLinearClause::inits ( ) const
inline

Definition at line 4604 of file OpenMPClause.h.

◆ privates() [1/2]

privates_range clang::OMPLinearClause::privates ( )
inline

Definition at line 4587 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ privates() [2/2]

privates_const_range clang::OMPLinearClause::privates ( ) const
inline

Definition at line 4591 of file OpenMPClause.h.

◆ setColonLoc()

void clang::OMPLinearClause::setColonLoc ( SourceLocation  Loc)
inline

Sets the location of ':'.

Definition at line 4548 of file OpenMPClause.h.

References Loc.

◆ setFinals()

void OMPLinearClause::setFinals ( ArrayRef< Expr * >  FL)

Sets the list of final update expressions for linear variables.

Parameters
FLList of expressions.

Definition at line 571 of file OpenMPClause.cpp.

References clang::OMPVarListClause< OMPLinearClause >::varlist_size().

Referenced by FinishOpenMPLinearClause().

◆ setModifier()

void clang::OMPLinearClause::setModifier ( OpenMPLinearClauseKind  Kind)
inline

Set modifier.

Definition at line 4536 of file OpenMPClause.h.

References Kind.

◆ setModifierLoc()

void clang::OMPLinearClause::setModifierLoc ( SourceLocation  Loc)
inline

Set modifier location.

Definition at line 4542 of file OpenMPClause.h.

References Loc.

◆ setStepModifierLoc()

void clang::OMPLinearClause::setStepModifierLoc ( SourceLocation  Loc)
inline

Sets the location of 'step' modifier.

Definition at line 4551 of file OpenMPClause.h.

References Loc.

◆ setUpdates()

void OMPLinearClause::setUpdates ( ArrayRef< Expr * >  UL)

Sets the list of update expressions for linear variables.

Parameters
ULList of expressions.

Definition at line 565 of file OpenMPClause.cpp.

References clang::OMPVarListClause< OMPLinearClause >::varlist_size().

Referenced by FinishOpenMPLinearClause().

◆ setUsedExprs()

void OMPLinearClause::setUsedExprs ( ArrayRef< Expr * >  UE)

Sets the list of used expressions for the linear clause.

Definition at line 577 of file OpenMPClause.cpp.

References clang::OMPVarListClause< OMPLinearClause >::varlist_size().

Referenced by FinishOpenMPLinearClause().

◆ updates() [1/2]

updates_range clang::OMPLinearClause::updates ( )
inline

Definition at line 4613 of file OpenMPClause.h.

◆ updates() [2/2]

updates_const_range clang::OMPLinearClause::updates ( ) const
inline

Definition at line 4617 of file OpenMPClause.h.

◆ used_children() [1/2]

OMPClause::child_range OMPLinearClause::used_children ( )

Definition at line 624 of file OpenMPClause.cpp.

Referenced by used_children().

◆ used_children() [2/2]

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

Definition at line 4661 of file OpenMPClause.h.

References used_children().

◆ used_expressions() [1/2]

used_expressions_range clang::OMPLinearClause::used_expressions ( )
inline

Definition at line 4641 of file OpenMPClause.h.

◆ used_expressions() [2/2]

used_expressions_const_range clang::OMPLinearClause::used_expressions ( ) const
inline

Definition at line 4645 of file OpenMPClause.h.

Friends And Related Function Documentation

◆ OMPClauseReader

friend class OMPClauseReader
friend

Definition at line 4393 of file OpenMPClause.h.


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