clang 10.0.0git

Classes | Namespaces | Macros | 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/Frontend/OpenMP/OMPConstants.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 "clang/Basic/OpenMPKinds.def"`
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...
struct | clang::OMPVarListLocTy
| This structure contains most locations needed for by an OMPVarListClause. 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::OMPAllocatorClause
| This represents 'allocator' clause in the '#pragma omp ...' directive. More...
class | clang::OMPAllocateClause
| This represents clause 'allocate' 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::OMPUnifiedAddressClause
| This represents 'unified_address' clause in the '#pragma omp requires' directive. More...
class | clang::OMPUnifiedSharedMemoryClause
| This represents 'unified_shared_memory' clause in the '#pragma omp requires' directive. More...
class | clang::OMPReverseOffloadClause
| This represents 'reverse_offload' clause in the '#pragma omp requires' directive. More...
class | clang::OMPDynamicAllocatorsClause
| This represents 'dynamic_allocators' clause in the '#pragma omp requires' directive. More...
class | clang::OMPAtomicDefaultMemOrderClause
| This represents 'atomic_default_mem_order' clause in the '#pragma omp requires' 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 that represents a component of a mappable expression. More...
struct | OMPMappableExprListSizeTy
| This structure contains all sizes needed for by an OMPMappableExprListClause. More...
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...
class | OMPNontemporalClause
| This represents clause 'nontemporal' in the '#pragma omp ...' directives. More...
class | OMPClauseVisitorBase< ImplClass, Ptr, RetTy >
| This class implements a simple visitor for OMPClause subclasses. More...
class | OMPClauseVisitor< ImplClass, RetTy >
class | ConstOMPClauseVisitor< ImplClass, RetTy >
class | OMPClausePrinter

## Namespaces
| clang
| Dataflow Directional Tag Classes.

## Macros
#define | PTR(CLASS) typename Ptr<CLASS>::type
#define | DISPATCH(CLASS) return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))
#define | OPENMP_CLAUSE(Name, Class) RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); }
#define | OPENMP_CLAUSE(Name, Class) case OMPC_ ## Name : return Visit ## Class(static_cast<PTR(Class)>(S));
#define | OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S);

## 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 >
using | clang::used_expressions_iterator = MutableArrayRef< Expr * >::iterator
using | clang::used_expressions_const_iterator = ArrayRef< const Expr * >::iterator
using | clang::used_expressions_range = llvm::iterator_range< used_expressions_iterator >
using | clang::used_expressions_const_range = llvm::iterator_range< used_expressions_const_iterator >
template<typename T >
using | const_ptr = typename std::add_pointer< typename std::add_const< T >::type >

## 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...
MutableArrayRef< Expr * > | clang::getUsedExprs ()
| Gets the list of used 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 OMPLinearClause * | clang::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 OMPLinearClause * | clang::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...
void | clang::setUsedExprs (ArrayRef< Expr *> UE)
| Sets the list of used expressions for the linear clause. More...
privates_range | clang::privates ()
inits_range | clang::inits ()
updates_range | clang::updates ()
finals_range | clang::finals ()
used_expressions_range | clang::used_expressions ()
child_range | clang::children ()
child_range | clang::used_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.

## Macro Definition Documentation

## ◆ DISPATCH

#define DISPATCH | ( |  | CLASS | ) | return static_cast<ImplClass*>(this)->Visit##CLASS(static_cast<PTR(CLASS)>(S))

Definition at line 6376 of file OpenMPClause.h.

## ◆ OPENMP_CLAUSE [1/3]

#define OPENMP_CLAUSE | ( |  | Name,
|  |  | Class
| ) |  | RetTy Visit ## Class (PTR(Class) S) { DISPATCH(Class); }

Definition at line 6419 of file OpenMPClause.h.

## ◆ OPENMP_CLAUSE [2/3]

#define OPENMP_CLAUSE | ( |  | Name,
|  |  | Class
| ) |  | case OMPC_ ## Name : return Visit ## Class(static_cast<PTR(Class)>(S));

Definition at line 6419 of file OpenMPClause.h.

## ◆ OPENMP_CLAUSE [3/3]

#define OPENMP_CLAUSE | ( |  | Name,
|  |  | Class
| ) |  | void Visit##Class(Class *S);

Definition at line 6419 of file OpenMPClause.h.

## ◆ PTR

#define PTR | ( |  | CLASS | ) | typename Ptr<CLASS>::type

Definition at line 6375 of file OpenMPClause.h.

## Typedef Documentation

## ◆ const_ptr

template<typename T >

using const_ptr = typename std::add_pointer<typename std::add_const<T>::type>

Definition at line 6399 of 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

  StartLoc | Starting location of the clause.
  LParenLoc | Location of '('.
  ColonLoc | Location of ':'.
  EndLoc | Ending location of the clause.
  NumVars | Number of variables.

Definition at line 122 of file OpenMPClause.h.

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

## ◆ OMPLinearClause() [2/2]

getPrivates::OMPLinearClause | ( | unsigned | NumVars | ) |
| explicit

Build an empty clause.

Parameters

  NumVars | Number of variables.

Definition at line 134 of file OpenMPClause.h.

## ◆ setCalcStep()

void getPrivates::setCalcStep | ( | Expr * | CalcStep | ) |

Sets the expression to calculate linear step for clause.

Definition at line 113 of file OpenMPClause.h.

## ◆ setStep()

void getPrivates::setStep | ( | Expr * | Step | ) |

Sets the linear step for clause.

Definition at line 110 of file OpenMPClause.h.

## Variable Documentation

## ◆ CalcStep

CalcStep

Definition at line 151 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPLinearClause(), clang::OMPSharedClause::CreateEmpty(), and FinishOpenMPLinearClause().

## ◆ ColonLoc

SourceLocation ColonLoc

Location of ':'.

Definition at line 107 of file OpenMPClause.h.

Referenced by BuildNonArrayForRange(), CheckArrayDesignatorSyntax(), clang::OMPSharedClause::CreateEmpty(), clang::Sema::FunctionScopeRAII::disable(), clang::CXXForRangeStmt::getColonLoc(), clang::OMPAllocateClause::getColonLoc(), clang::OMPIfClause::getColonLoc(), clang::ObjCTypeParamDecl::getColonLoc(), clang::SwitchCase::getColonLoc(), clang::OMPLastprivateClause::getColonLoc(), clang::OMPReductionClause::getColonLoc(), clang::OMPTaskReductionClause::getColonLoc(), clang::OMPInReductionClause::getColonLoc(), clang::getColonLoc(), OMPAlignedClause::getColonLoc(), clang::AbstractConditionalOperator::getColonLoc(), OMPDependClause::getColonLoc(), OMPMapClause::getColonLoc(), clang::Parser::ParseConstraintLogicalOrExpression(), and takeDeclAttributes().

## ◆ Finals

* Finals[]

Definition at line 151 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().

## ◆ Inits

Inits[]

Definition at line 150 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), clang::ASTContext::addLazyModuleInitializers(), clang::ASTContext::addModuleInitializer(), clang::Sema::BuildCXXNew(), CheckConstexprFunctionBody(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DefineInheritingConstructor(), clang::ASTContext::getModuleInitializers(), getNumberOfModules(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().

## ◆ Modifier

OpenMPLinearClauseKind Modifier = OMPC_LINEAR_val

Modifier of 'linear' clause.

Definition at line 101 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPSingleExprWithArgClause(), addMonoNonMonoModifier(), clang::OMPSharedClause::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitCall(), EmitCommonNeonSISDBuiltinExpr(), OMPDefaultmapClause::getDefaultmapModifier(), clang::getModifier(), clang::Parser::ParseOpenMPParensExpr(), and clang::Parser::ParseOpenMPVarList().

## ◆ ModifierLoc

SourceLocation ModifierLoc

Location of linear modifier if any.

Definition at line 104 of file OpenMPClause.h.

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

## ◆ OMPVarListClause

friend OMPVarListClause

Definition at line 97 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 150 of file OpenMPClause.h.

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

## ◆ Step

Step

Definition at line 151 of file OpenMPClause.h.

Referenced by clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::ActOnOpenMPLinearClause(), buildCounterUpdate(), clang::OMPSharedClause::CreateEmpty(), clang::Sema::FindCompositePointerType(), FinishOpenMPLinearClause(), clang::InitializationSequence::Perform(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().

## ◆ TrailingObjects

friend TrailingObjects

Definition at line 98 of file OpenMPClause.h.

## ◆ Updates

Updates[]

Definition at line 150 of file OpenMPClause.h.

Referenced by FinishOpenMPLinearClause().