clang 23.0.0git
OpenMPClause.h File Reference

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

#include "clang/AST/ASTFwd.h"
#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/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Frontend/OpenMP/OMPAssume.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
#include "llvm/Frontend/OpenMP/OMPContext.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 "llvm/Frontend/OpenMP/OMP.inc"

Go to the source code of this file.

Classes

class  clang::OMPClause
 This is a basic class for representing single OpenMP clause. More...
struct  clang::OMPNoChildClause< ClauseKind >
class  clang::OMPOneStmtClause< ClauseKind, Base >
class  clang::OMPClauseWithPreInit
 Class that handles pre-initialization statement for some clauses, like 'schedule', '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::OMPDirectiveListClause< T >
 Class that represents a list of directive kinds (parallel, target, etc.) as used in absent, contains clauses. More...
class  clang::OMPAllocatorClause
 This represents 'allocator' clause in the '#pragma omp ...' directive. More...
class  clang::OMPAlignClause
 This represents the 'align' clause in the '#pragma omp allocate' 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::OMPSizesClause
 This represents the 'sizes' clause in the '#pragma omp tile' directive. More...
class  clang::OMPPermutationClause
 This class represents the 'permutation' clause in the '#pragma omp interchange' directive. More...
class  clang::OMPFullClause
 Representation of the 'full' clause of the '#pragma omp unroll' directive. More...
class  clang::OMPLoopRangeClause
 This class represents the 'looprange' clause in the '#pragma omp fuse' directive. More...
class  clang::OMPPartialClause
 Representation of the 'partial' clause of the '#pragma omp unroll' 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::OMPThreadsetClause
 This represents 'threadset' clause in the '#pragma omp task ...' directive. 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. This clause does not exist by itself, it can be only as a part of 'omp flush' directive. This clause is introduced to keep the original structure of OMPExecutableDirective class and its derivatives and to use the existing infrastructure of clauses with the list of variables. More...
class  OMPDepobjClause
 This represents implicit clause 'depobj' for the '#pragma omp depobj' directive. This clause does not exist by itself, it can be only as a part of 'omp depobj' directive. This clause is introduced to keep the original structure of OMPExecutableDirective class and its derivatives and to use the existing infrastructure of clauses with the list of variables. More...
class  OMPDependClause
 This represents implicit clause 'depend' for the '#pragma omp task' directive. More...
struct  OMPDependClause::DependDataTy
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. E.g. for an expression S.a, the first component is a declaration reference expression associated with 'S' and the second is a member expression associated with the field declaration 'a'. If the expression is an array subscript it may not have any associated declaration. In that case the associated declaration is set to nullptr. 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. Examples of these clauses are 'map' in '#pragma omp target [enter|exit] [data]...' directives, and 'to' and 'from in '#pragma omp target update...' directives. More...
class  OMPMappableExprListClause< T >::const_component_lists_iterator
 Iterator that browse the components by lists. It also allows browsing components of a single declaration. 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  OMPUseDeviceAddrClause
 This represents clause 'use_device_addr' in the '#pragma omp ...' directives. More...
class  OMPIsDevicePtrClause
 This represents clause 'is_device_ptr' in the '#pragma omp ...' directives. More...
class  OMPHasDeviceAddrClause
 This represents clause 'has_device_ptr' in the '#pragma omp ...' directives. More...
class  OMPNontemporalClause
 This represents clause 'nontemporal' in the '#pragma omp ...' directives. More...
class  OMPOrderClause
 This represents 'order' clause in the '#pragma omp ...' directive. More...
class  OMPInitClause
 This represents the 'init' clause in '#pragma omp ...' directives. More...
class  OMPUseClause
 This represents the 'use' clause in '#pragma omp ...' directives. More...
class  OMPDestroyClause
 This represents 'destroy' clause in the '#pragma omp depobj' directive or the '#pragma omp interop' directive.. More...
class  OMPNovariantsClause
 This represents 'novariants' clause in the '#pragma omp ...' directive. More...
class  OMPNocontextClause
 This represents 'nocontext' clause in the '#pragma omp ...' directive. More...
class  OMPDetachClause
 This represents 'detach' clause in the '#pragma omp task' directive. More...
class  OMPInclusiveClause
 This represents clause 'inclusive' in the '#pragma omp scan' directive. More...
class  OMPExclusiveClause
 This represents clause 'exclusive' in the '#pragma omp scan' directive. More...
class  OMPUsesAllocatorsClause
 This represents clause 'uses_allocators' in the '#pragma omp target'-based directives. More...
struct  OMPUsesAllocatorsClause::Data
 Data for list of allocators. More...
class  OMPAffinityClause
 This represents clause 'affinity' in the '#pragma omp task'-based directives. More...
class  OMPFilterClause
 This represents 'filter' clause in the '#pragma omp ...' directive. More...
class  OMPBindClause
 This represents 'bind' clause 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
struct  OMPTraitProperty
struct  OMPTraitSelector
struct  OMPTraitSet
class  OMPTraitInfo
struct  TargetOMPContext
 Clang specific specialization of the OMPContext to lookup target features. More...
class  OMPChildren
 Contains data for OpenMP directives: clauses, children expressions/statements (helpers for codegen) and associated statement, if any. More...
class  OMPXDynCGroupMemClause
 This represents 'ompx_dyn_cgroup_mem' clause in the '#pragma omp target ...' directive. More...
class  OMPDynGroupprivateClause
 This represents 'dyn_groupprivate' clause in '#pragma omp target ...' and '#pragma omp teams ...' directives. More...
class  OMPDoacrossClause
 This represents the 'doacross' clause for the '#pragma omp ordered' directive. More...
class  OMPXAttributeClause
 This represents 'ompx_attribute' clause in a directive that might generate an outlined function. More...
class  OMPXBareClause
 This represents 'ompx_bare' clause in the '#pragma omp target teams ...' directive. More...

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.

Macros

#define PTR(CLASS)
#define DISPATCH(CLASS)
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class)
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class)
#define CLAUSE_NO_CLASS(Enum, Str)
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class)

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
using clang::used_expressions_const_range
template<typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>

Functions

MutableArrayRef< Expr * > clang::getPrivates ()
 Finals[]; Step; CalcStep; }.
MutableArrayRef< Expr * > clang::getInits ()
MutableArrayRef< Expr * > clang::getUpdates ()
 Sets the list of update expressions for linear variables.
MutableArrayRef< Expr * > clang::getFinals ()
 Sets the list of final update expressions for linear variables.
MutableArrayRef< Expr * > clang::getUsedExprs ()
 Gets the list of used expressions for linear variables.
void clang::setPrivates (ArrayRef< Expr * > PL)
 Sets the list of the copies of original linear variables.
void clang::setInits (ArrayRef< Expr * > IL)
 Sets the list of the initial values for linear variables.
static OMPLinearClause * clang::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)
 Creates clause with a list of variables VL and a linear step Step.
static OMPLinearClause * clang::CreateEmpty (const ASTContext &C, unsigned NumVars)
 Creates an empty clause with the place for NumVars variables.
void clang::setModifier (OpenMPLinearClauseKind Kind)
 Set modifier.
OpenMPLinearClauseKind clang::getModifier () const
 Return modifier.
void clang::setModifierLoc (SourceLocation Loc)
 Set modifier location.
SourceLocation clang::getModifierLoc () const
 Return modifier location.
void clang::setColonLoc (SourceLocation Loc)
 Sets the location of ':'.
void clang::setStepModifierLoc (SourceLocation Loc)
 Sets the location of 'step' modifier.
SourceLocation clang::getColonLoc () const
 Returns the location of ':'.
SourceLocation clang::getStepModifierLoc () const
 Returns the location of 'step' modifier.
Exprclang::getStep ()
 Returns linear step.
Exprclang::getCalcStep ()
 Returns expression to calculate linear step.
void clang::setUpdates (ArrayRef< Expr * > UL)
 Sets the list of update expressions for linear variables.
void clang::setFinals (ArrayRef< Expr * > FL)
 Sets the list of final update expressions for linear variables.
void clang::setUsedExprs (ArrayRef< Expr * > UE)
 Sets the list of used expressions for the linear clause.
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)
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, const OMPTraitInfo &TI)
llvm::raw_ostream & operator<< (llvm::raw_ostream &OS, const OMPTraitInfo *TI)

Variables

 clang::Privates []
 This class represents the 'transparent' clause in the '#pragma omp task' directive.
 clang::Inits []
 clang::Updates []
*collection of selector sets
 Helper data structure representing the traits in a match clause of an declare variant or metadirective. The outer level is an ordered.
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a an optional score condition

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

◆ CLAUSE_CLASS [1/3]

#define CLAUSE_CLASS ( Enum,
Str,
Class )
Value:
RetTy Visit##Class(PTR(Class) S) { \
return static_cast<ImplClass *>(this)->VisitOMPClause(S); \
}
#define PTR(CLASS)
Definition AttrVisitor.h:27

Definition at line 9633 of file OpenMPClause.h.

◆ CLAUSE_CLASS [2/3]

#define CLAUSE_CLASS ( Enum,
Str,
Class )
Value:
case llvm::omp::Clause::Enum: \
DISPATCH(Class);

Definition at line 9633 of file OpenMPClause.h.

◆ CLAUSE_CLASS [3/3]

#define CLAUSE_CLASS ( Enum,
Str,
Class )
Value:
void Visit##Class(Class *S);

Definition at line 9633 of file OpenMPClause.h.

◆ CLAUSE_NO_CLASS

#define CLAUSE_NO_CLASS ( Enum,
Str )
Value:
case llvm::omp::Clause::Enum: \
break;

◆ DISPATCH

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

Definition at line 9629 of file OpenMPClause.h.

◆ GEN_CLANG_CLAUSE_CLASS [1/3]

#define GEN_CLANG_CLAUSE_CLASS

Definition at line 9632 of file OpenMPClause.h.

◆ GEN_CLANG_CLAUSE_CLASS [2/3]

#define GEN_CLANG_CLAUSE_CLASS

Definition at line 9632 of file OpenMPClause.h.

◆ GEN_CLANG_CLAUSE_CLASS [3/3]

#define GEN_CLANG_CLAUSE_CLASS

Definition at line 9632 of file OpenMPClause.h.

◆ PTR

#define PTR ( CLASS)
Value:
Ptr<CLASS>

Definition at line 9628 of file OpenMPClause.h.

Typedef Documentation

◆ const_ptr

template<typename T>
using const_ptr = std::add_pointer_t<std::add_const_t<T>>

Definition at line 9658 of file OpenMPClause.h.

Function Documentation

◆ operator<<() [1/2]

llvm::raw_ostream & operator<< ( llvm::raw_ostream & OS,
const OMPTraitInfo & TI )

◆ operator<<() [2/2]

llvm::raw_ostream & operator<< ( llvm::raw_ostream & OS,
const OMPTraitInfo * TI )

Variable Documentation

◆ condition

* collection of selector each with an associated kind and an ordered* collection of selectors A selector has a an optional score condition

◆ kind

* collection of selector each with an associated kind and an ordered* collection of selectors A selector has a kind

Definition at line 9709 of file OpenMPClause.h.

Referenced by clang::ento::BasicValueFactory::accumCXXBase(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::api_notes::FunctionInfo::addParamTypeInfo(), clang::api_notes::FunctionInfo::addReturnTypeInfo(), clang::api_notes::FunctionInfo::addTypeInfo(), ArrayTypeTraitFromTokKind(), clang::AsanDtorKindToString(), clang::ento::BugReport::BugReport(), clang::CastExpr::CastExpr(), clang::CFGElement::CFGElement(), clang::CFGImplicitDtor::CFGElement, clang::CFGScopeBegin::CFGElement, clang::CFGScopeEnd::CFGElement, clang::CFGImplicitDtor::CFGImplicitDtor(), clang::CharacterLiteral::CharacterLiteral(), clang::CharLiteralParser::CharLiteralParser(), clang::SemaBPF::CheckBPFBuiltinFunctionCall(), clang_getBinaryOperatorKindSpelling(), clang_getCompletionParent(), clang_getTUResourceUsageName(), clang_getUnaryOperatorKindSpelling(), ClassifyInternal(), cir::direct::convertCmpKindToFCmpPredicate(), cir::direct::convertCmpKindToICmpPredicate(), cir::CIRBaseBuilderTy::createBinop(), cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createCast(), cir::CIRBaseBuilderTy::createCompare(), cir::CIRBaseBuilderTy::createUnaryOp(), cir::CIRBaseBuilderTy::createVecCompare(), clang::CXXNamedCastExpr::CXXNamedCastExpr(), clang::syntax::Token::dumpForTests(), clang::syntax::TokenBuffer::dumpForTests(), clang::CIRGen::EHScope::EHScope(), clang::CodeGen::EHScope::EHScope(), clang::CIRGen::CIRGenFunction::emitCaseDefaultCascade(), clang::CIRGen::CIRGenFunction::emitCaseDefaultCascade(), clang::CIRGen::CIRGenFunction::emitCaseStmt(), clang::CIRGen::CIRGenFunction::emitComplexToScalarConversion(), clang::CIRGen::CIRGenFunction::emitScalarPrePostIncDec(), emitSuspendExpr(), emitSuspendExpression(), clang::CIRGen::CIRGenFunction::emitUnaryOpLValue(), clang::ExplicitCastExpr::ExplicitCastExpr(), ExpressionTraitFromTokKind(), findPeephole(), clang::FunctionEffect::flags(), clang::CIRGen::CIRGenBuilderTy::getAnonRecordTy(), getCharWidth(), clang::CIRGen::CIRGenFunction::getCleanupKind(), clang::CodeGen::CodeGenFunction::getCleanupKind(), clang::CIRGen::CIRGenBuilderTy::getCompleteNamedRecordType(), clang::CIRGen::CIRGenFunction::getDestroyer(), clang::CodeGen::CodeGenFunction::getDestroyer(), getEncodingPrefixLen(), clang::NamedDecl::getExplicitVisibility(), getExplicitVisibility(), getExplicitVisibilityAux(), clang::CIRGen::CIRGenBuilderTy::getIncompleteRecordTy(), clang::getNullabilitySpelling(), getObjCEncodingForPrimitiveType(), clang::CIRGen::CIRGenBuilderTy::getRecordKind(), getVisibilityOf(), clang::ImplicitCastExpr::ImplicitCastExpr(), clang::SemaObjC::inferObjCARCLifetime(), isIntOrBoolCast(), makeBinaryAtomicValue(), mapNullabilityAttrKind(), clang::CIRGen::CIRGenFunction::needsEHCleanup(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), clang::ObjCRuntime::ObjCRuntime(), clang::analyze_os_log::OSLogBufferItem::OSLogBufferItem(), ProcessAPINotes(), clang::CIRGen::EHScopeStack::pushCleanup(), clang::CIRGen::CIRGenFunction::pushFullExprCleanup(), clang::CodeGen::CodeGenFunction::pushFullExprCleanup(), clang::CIRGen::CIRGenFunction::pushStackRestore(), clang::serialization::DataStreamBasicReader< Impl >::readNestedNameSpecifier(), recordNullabilitySeen(), clang::ObjCRuntime::set(), clang::TargetCXXABI::set(), clang::CIRGen::CIRGenModule::setCXXSpecialMemberAttr(), clang::CharacterLiteral::setKind(), clang::ObjCDeclSpec::setNullability(), clang::api_notes::VariableInfo::setNullabilityAudited(), SetupCleanupBlockActivation(), clang::dataflow::simplifyConstraints(), clang::syntax::Token::str(), clang::TargetCXXABI::TargetCXXABI(), clang::ObjCRuntime::tryParse(), TypeTraitFromTokKind(), clang::FunctionType::ExtParameterInfo::withABI(), and clang::serialization::DataStreamBasicWriter< Impl >::writeNestedNameSpecifier().

◆ sets

* collection of selector sets

Helper data structure representing the traits in a match clause of an declare variant or metadirective. The outer level is an ordered.

Definition at line 9708 of file OpenMPClause.h.