clang  6.0.0svn
Classes | Namespaces | Typedefs | Functions | Variables
OpenMPClause.h File Reference

This file defines OpenMP AST classes for clauses. More...

#include "clang/AST/Decl.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Expr.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtIterator.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/OpenMPKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/TrailingObjects.h"
#include <cassert>
#include <cstddef>
#include <iterator>
#include <utility>
Include dependency graph for OpenMPClause.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::OMPClause
 This is a basic class for representing single OpenMP clause. More...
 
class  clang::OMPClauseWithPreInit
 Class that handles pre-initialization statement for some clauses, like 'shedule', 'firstprivate' etc. More...
 
class  clang::OMPClauseWithPostUpdate
 Class that handles post-update expression for some clauses, like 'lastprivate', 'reduction' etc. More...
 
class  clang::OMPVarListClause< T >
 This represents clauses with the list of variables like 'private', 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the '#pragma omp ...' directives. More...
 
class  clang::OMPIfClause
 This represents 'if' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPFinalClause
 This represents 'final' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPNumThreadsClause
 This represents 'num_threads' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPSafelenClause
 This represents 'safelen' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPSimdlenClause
 This represents 'simdlen' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPCollapseClause
 This represents 'collapse' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPDefaultClause
 This represents 'default' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPProcBindClause
 This represents 'proc_bind' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPScheduleClause
 This represents 'schedule' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPOrderedClause
 This represents 'ordered' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPNowaitClause
 This represents 'nowait' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPUntiedClause
 This represents 'untied' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPMergeableClause
 This represents 'mergeable' clause in the '#pragma omp ...' directive. More...
 
class  clang::OMPReadClause
 This represents 'read' clause in the '#pragma omp atomic' directive. More...
 
class  clang::OMPWriteClause
 This represents 'write' clause in the '#pragma omp atomic' directive. More...
 
class  clang::OMPUpdateClause
 This represents 'update' clause in the '#pragma omp atomic' directive. More...
 
class  clang::OMPCaptureClause
 This represents 'capture' clause in the '#pragma omp atomic' directive. More...
 
class  clang::OMPSeqCstClause
 This represents 'seq_cst' clause in the '#pragma omp atomic' directive. More...
 
class  clang::OMPPrivateClause
 This represents clause 'private' in the '#pragma omp ...' directives. More...
 
class  clang::OMPFirstprivateClause
 This represents clause 'firstprivate' in the '#pragma omp ...' directives. More...
 
class  clang::OMPLastprivateClause
 This represents clause 'lastprivate' in the '#pragma omp ...' directives. More...
 
class  clang::OMPSharedClause
 This represents clause 'shared' in the '#pragma omp ...' directives. More...
 
class  clang::OMPReductionClause
 This represents clause 'reduction' in the '#pragma omp ...' directives. More...
 
class  clang::OMPTaskReductionClause
 This represents clause 'task_reduction' in the '#pragma omp taskgroup' directives. More...
 
class  clang::OMPInReductionClause
 This represents clause 'in_reduction' in the '#pragma omp task' directives. More...
 
class  clang::OMPLinearClause
 This represents clause 'linear' in the '#pragma omp ...' directives. More...
 
class  OMPAlignedClause
 This represents clause 'aligned' in the '#pragma omp ...' directives. More...
 
class  OMPCopyinClause
 This represents clause 'copyin' in the '#pragma omp ...' directives. More...
 
class  OMPCopyprivateClause
 This represents clause 'copyprivate' in the '#pragma omp ...' directives. More...
 
class  OMPFlushClause
 This represents implicit clause 'flush' for the '#pragma omp flush' directive. More...
 
class  OMPDependClause
 This represents implicit clause 'depend' for the '#pragma omp task' directive. More...
 
class  OMPDeviceClause
 This represents 'device' clause in the '#pragma omp ...' directive. More...
 
class  OMPThreadsClause
 This represents 'threads' clause in the '#pragma omp ...' directive. More...
 
class  OMPSIMDClause
 This represents 'simd' clause in the '#pragma omp ...' directive. More...
 
class  OMPClauseMappableExprCommon
 Struct that defines common infrastructure to handle mappable expressions used in OpenMP clauses. More...
 
class  OMPClauseMappableExprCommon::MappableComponent
 
class  OMPMappableExprListClause< T >
 This represents clauses with a list of expressions that are mappable. More...
 
class  OMPMappableExprListClause< T >::const_component_lists_iterator
 Iterator that browse the components by lists. More...
 
class  OMPMapClause
 This represents clause 'map' in the '#pragma omp ...' directives. More...
 
class  OMPNumTeamsClause
 This represents 'num_teams' clause in the '#pragma omp ...' directive. More...
 
class  OMPThreadLimitClause
 This represents 'thread_limit' clause in the '#pragma omp ...' directive. More...
 
class  OMPPriorityClause
 This represents 'priority' clause in the '#pragma omp ...' directive. More...
 
class  OMPGrainsizeClause
 This represents 'grainsize' clause in the '#pragma omp ...' directive. More...
 
class  OMPNogroupClause
 This represents 'nogroup' clause in the '#pragma omp ...' directive. More...
 
class  OMPNumTasksClause
 This represents 'num_tasks' clause in the '#pragma omp ...' directive. More...
 
class  OMPHintClause
 This represents 'hint' clause in the '#pragma omp ...' directive. More...
 
class  OMPDistScheduleClause
 This represents 'dist_schedule' clause in the '#pragma omp ...' directive. More...
 
class  OMPDefaultmapClause
 This represents 'defaultmap' clause in the '#pragma omp ...' directive. More...
 
class  OMPToClause
 This represents clause 'to' in the '#pragma omp ...' directives. More...
 
class  OMPFromClause
 This represents clause 'from' in the '#pragma omp ...' directives. More...
 
class  OMPUseDevicePtrClause
 This represents clause 'use_device_ptr' in the '#pragma omp ...' directives. More...
 
class  OMPIsDevicePtrClause
 This represents clause 'is_device_ptr' in the '#pragma omp ...' directives. More...
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 

Typedefs

using clang::privates_iterator = MutableArrayRef< Expr * >::iterator
 
using clang::privates_const_iterator = ArrayRef< const Expr * >::iterator
 
using clang::privates_range = llvm::iterator_range< privates_iterator >
 
using clang::privates_const_range = llvm::iterator_range< privates_const_iterator >
 
using clang::inits_iterator = MutableArrayRef< Expr * >::iterator
 
using clang::inits_const_iterator = ArrayRef< const Expr * >::iterator
 
using clang::inits_range = llvm::iterator_range< inits_iterator >
 
using clang::inits_const_range = llvm::iterator_range< inits_const_iterator >
 
using clang::updates_iterator = MutableArrayRef< Expr * >::iterator
 
using clang::updates_const_iterator = ArrayRef< const Expr * >::iterator
 
using clang::updates_range = llvm::iterator_range< updates_iterator >
 
using clang::updates_const_range = llvm::iterator_range< updates_const_iterator >
 
using clang::finals_iterator = MutableArrayRef< Expr * >::iterator
 
using clang::finals_const_iterator = ArrayRef< const Expr * >::iterator
 
using clang::finals_range = llvm::iterator_range< finals_iterator >
 
using clang::finals_const_range = llvm::iterator_range< finals_const_iterator >
 

Functions

clang::OMPLinearClause OMPVarListClause, OMPClauseWithPostUpdate, llvm::TrailingObjects clang::getPrivates ()
 
void setStep (Expr *Step)
 Sets the linear step for clause. More...
 
void setCalcStep (Expr *CalcStep)
 Sets the expression to calculate linear step for clause. More...
 
 OMPLinearClause (SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars)
 Build 'linear' clause with given number of variables NumVars. More...
 
 OMPLinearClause (unsigned NumVars)
 Build an empty clause. More...
 
MutableArrayRef< Expr * > clang::getInits ()
 
MutableArrayRef< Expr * > clang::getUpdates ()
 Sets the list of update expressions for linear variables. More...
 
MutableArrayRef< Expr * > clang::getFinals ()
 Sets the list of final update expressions for linear variables. More...
 
void clang::setPrivates (ArrayRef< Expr *> PL)
 Sets the list of the copies of original linear variables. More...
 
void clang::setInits (ArrayRef< Expr *> IL)
 Sets the list of the initial values for linear variables. More...
 
static OMPLinearClauseclang::Create (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, 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. More...
 
static OMPLinearClauseclang::CreateEmpty (const ASTContext &C, unsigned NumVars)
 Creates an empty clause with the place for NumVars variables. More...
 
void clang::setModifier (OpenMPLinearClauseKind Kind)
 Set modifier. More...
 
OpenMPLinearClauseKind clang::getModifier () const
 Return modifier. More...
 
void clang::setModifierLoc (SourceLocation Loc)
 Set modifier location. More...
 
SourceLocation clang::getModifierLoc () const
 Return modifier location. More...
 
void clang::setColonLoc (SourceLocation Loc)
 Sets the location of ':'. More...
 
SourceLocation clang::getColonLoc () const
 Returns the location of ':'. More...
 
Expr * clang::getStep ()
 Returns linear step. More...
 
Expr * clang::getCalcStep ()
 Returns expression to calculate linear step. More...
 
void clang::setUpdates (ArrayRef< Expr *> UL)
 Sets the list of update expressions for linear variables. More...
 
void clang::setFinals (ArrayRef< Expr *> FL)
 Sets the list of final update expressions for linear variables. More...
 
privates_range clang::privates ()
 
inits_range clang::inits ()
 
updates_range clang::updates ()
 
finals_range clang::finals ()
 
child_range clang::children ()
 
static bool clang::classof (const OMPClause *T)
 

Variables

friend OMPVarListClause
 
friend TrailingObjects
 
OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val
 Modifier of 'linear' clause. More...
 
SourceLocation ModifierLoc
 Location of linear modifier if any. More...
 
SourceLocation ColonLoc
 Location of ':'. More...
 
 Privates []
 Gets the list of initial values for linear variables. More...
 
 Inits []
 
 Updates []
 
Finals []
 
 Step
 
 CalcStep
 

Detailed Description

This file defines OpenMP AST classes for clauses.

There are clauses for executable directives, clauses for declarative directives and clauses which can be used in both kinds of directives.

Definition in file OpenMPClause.h.

Function Documentation

◆ OMPLinearClause() [1/2]

getPrivates::OMPLinearClause ( SourceLocation  StartLoc,
SourceLocation  LParenLoc,
OpenMPLinearClauseKind  Modifier,
SourceLocation  ModifierLoc,
SourceLocation  ColonLoc,
SourceLocation  EndLoc,
unsigned  NumVars 
)

Build 'linear' clause with given number of variables NumVars.

Parameters
StartLocStarting location of the clause.
LParenLocLocation of '('.
ColonLocLocation of ':'.
EndLocEnding location of the clause.
NumVarsNumber of variables.

Definition at line 108 of file OpenMPClause.h.

Referenced by clang::OMPSharedClause::CreateEmpty().

◆ OMPLinearClause() [2/2]

getPrivates::OMPLinearClause ( unsigned  NumVars)
explicit

Build an empty clause.

Parameters
NumVarsNumber of variables.

Definition at line 120 of file OpenMPClause.h.

◆ setCalcStep()

void getPrivates::setCalcStep ( Expr *  CalcStep)

Sets the expression to calculate linear step for clause.

Definition at line 99 of file OpenMPClause.h.

◆ setStep()

void getPrivates::setStep ( Expr *  Step)

Sets the linear step for clause.

Definition at line 96 of file OpenMPClause.h.

Variable Documentation

◆ CalcStep

CalcStep

◆ ColonLoc

SourceLocation ColonLoc

◆ Finals

* Finals[]

Definition at line 137 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

◆ Inits

Inits[]

◆ Modifier

OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val

◆ ModifierLoc

SourceLocation ModifierLoc

Location of linear modifier if any.

Definition at line 90 of file OpenMPClause.h.

Referenced by clang::OMPSharedClause::CreateEmpty(), OMPDefaultmapClause::getDefaultmapModifierLoc(), and clang::getModifierLoc().

◆ OMPVarListClause

friend OMPVarListClause

Definition at line 83 of file OpenMPClause.h.

◆ Privates

Privates[]

Gets the list of initial values for linear variables.

There are NumVars expressions with initial values allocated after the varlist, they are followed by NumVars update expressions (used to update the linear variable's value on current iteration) and they are followed by NumVars final expressions (used to calculate the linear variable's value after the loop body). After these lists, there are 2 helper expressions - linear step and a helper to calculate it before the loop body (used when the linear step is not constant):

{ Vars[] /* in OMPVarListClause

Definition at line 136 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPLinearClause(), buildDeclareReductionRef(), clang::OMPReductionClause::CreateEmpty(), OMPCopyprivateClause::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseFinal(), clang::CodeGen::CodeGenFunction::EmitOMPReductionClauseInit(), emitReductionCombiner(), clang::CodeGen::emitTaskInit(), and clang::CodeGen::CGOpenMPRuntimeNVPTX::getOutlinedHelperName().

◆ Step

Step

◆ TrailingObjects

friend TrailingObjects

Definition at line 84 of file OpenMPClause.h.

◆ Updates

Updates[]