clang 24.0.0git
clang::OMPNumThreadsClause Class Referencefinal

This represents 'num_threads' clause in the '#pragma omp ...' directive. More...

#include "clang/AST/OpenMPClause.h"

Inheritance diagram for clang::OMPNumThreadsClause:
[legend]

Public Member Functions

ArrayRef< Expr * > getNumThreads ()
 Return NumThreads expressions.
ArrayRef< Expr * > getNumThreads () const
OpenMPNumThreadsClauseModifier getPrescriptivenessModifier () const
 Returns the prescriptiveness modifier.
SourceLocation getPrescriptivenessModifierLoc () const
 Returns the location of the prescriptiveness modifier.
OpenMPNumThreadsClauseModifier getDimsModifier () const
 Returns the dims modifier.
SourceLocation getDimsModifierLoc () const
 Returns the location of the dims modifier.
bool hasDimsModifier () const
 Checks if the clause has the dims modifier.
ExprgetDimsModifierExpr ()
 Returns the dims modifier expression if present.
const ExprgetDimsModifierExpr () const
 Returns the dims modifier expression if present.
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< OMPNumThreadsClause >
unsigned varlist_size () const
bool varlist_empty () const
varlist_range varlist ()
varlist_iterator varlist_begin ()
varlist_iterator varlist_end ()
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::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 OMPNumThreadsClauseCreate (const ASTContext &C, OpenMPDirectiveKind CaptureRegion, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, OpenMPNumThreadsClauseModifier PrescriptivenessModifier, OpenMPNumThreadsClauseModifier DimsModifier, SourceLocation PrescriptivenessModifierLoc, SourceLocation DimsModifierLoc, Expr *DimsModifierExpr, Stmt *PreInit)
 Creates clause with a list of variables/expressions.
static OMPNumThreadsClauseCreateEmpty (const ASTContext &C, unsigned N)
 Creates an empty clause with the place for N expressions.
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::OMPClauseWithPreInit
static OMPClauseWithPreInitget (OMPClause *C)
static const OMPClauseWithPreInitget (const OMPClause *C)

Friends

class OMPVarListClause< OMPNumThreadsClause >
class OMPClauseReader

Additional Inherited Members

Public Types inherited from clang::OMPVarListClause< OMPNumThreadsClause >
using varlist_iterator
using varlist_const_iterator
using varlist_range
using varlist_const_range
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>
Protected Member Functions inherited from clang::OMPVarListClause< OMPNumThreadsClause >
 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::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 'num_threads' clause in the '#pragma omp ...' directive.

#pragma omp parallel num_threads(n)

In this example directive '#pragma omp parallel' has 'num_threads' clause requesting 'n' threads.

#pragma omp parallel num_threads(strict: n)

In this example directive '#pragma omp parallel' has 'num_threads' clause requesting 'n' threads strictly with the 'strict' modifier.

#pragma omp parallel num_threads(dims(2): x, y)

In this example directive '#pragma omp parallel' has clause 'num_threads' with the 'dims' modifier specifying two dimensions. The list specifies the number of threads in each dimension.

Definition at line 830 of file OpenMPClause.h.

Member Function Documentation

◆ children() [1/2]

child_range clang::OMPNumThreadsClause::children ( )
inline

◆ children() [2/2]

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

Definition at line 964 of file OpenMPClause.h.

References children().

◆ classof()

bool clang::OMPNumThreadsClause::classof ( const OMPClause * T)
inlinestatic

Definition at line 975 of file OpenMPClause.h.

References clang::T.

◆ Create()

OMPNumThreadsClause * OMPNumThreadsClause::Create ( const ASTContext & C,
OpenMPDirectiveKind CaptureRegion,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc,
ArrayRef< Expr * > VL,
OpenMPNumThreadsClauseModifier PrescriptivenessModifier,
OpenMPNumThreadsClauseModifier DimsModifier,
SourceLocation PrescriptivenessModifierLoc,
SourceLocation DimsModifierLoc,
Expr * DimsModifierExpr,
Stmt * PreInit )
static

Creates clause with a list of variables/expressions.

Parameters
CAST context.
CaptureRegionThe captured region for the pre-init statements.
StartLocStarting location of the clause.
LParenLocLocation of '('.
EndLocEnding location of the clause.
VLList of references to the expressions.
PrescriptivenessModifierThe prescriptiveness modifier.
DimsModifierThe dims modifier.
PrescriptivenessModifierLocLocation of the prescriptiveness modifier.
DimsModifierLocLocation of the dims modifier.
DimsModifierExprThe expression of the number of dimensions.
PreInit

Definition at line 1992 of file OpenMPClause.cpp.

References clang::C.

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

◆ CreateEmpty()

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

Creates an empty clause with the place for N expressions.

Parameters
CAST context.
NThe number of expressions.

Definition at line 2014 of file OpenMPClause.cpp.

References clang::C.

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

◆ getDimsModifier()

OpenMPNumThreadsClauseModifier clang::OMPNumThreadsClause::getDimsModifier ( ) const
inline

Returns the dims modifier.

Definition at line 940 of file OpenMPClause.h.

◆ getDimsModifierExpr() [1/2]

Expr * clang::OMPNumThreadsClause::getDimsModifierExpr ( )
inline

Returns the dims modifier expression if present.

Definition at line 952 of file OpenMPClause.h.

References hasDimsModifier(), and clang::OMPVarListClause< OMPNumThreadsClause >::varlist_end().

Referenced by getDimsModifierExpr().

◆ getDimsModifierExpr() [2/2]

const Expr * clang::OMPNumThreadsClause::getDimsModifierExpr ( ) const
inline

Returns the dims modifier expression if present.

Definition at line 956 of file OpenMPClause.h.

References getDimsModifierExpr().

◆ getDimsModifierLoc()

SourceLocation clang::OMPNumThreadsClause::getDimsModifierLoc ( ) const
inline

Returns the location of the dims modifier.

Definition at line 944 of file OpenMPClause.h.

◆ getNumThreads() [1/2]

ArrayRef< Expr * > clang::OMPNumThreadsClause::getNumThreads ( )
inline

Return NumThreads expressions.

Definition at line 925 of file OpenMPClause.h.

References clang::OMPVarListClause< OMPNumThreadsClause >::getVarRefs().

Referenced by getNumThreads().

◆ getNumThreads() [2/2]

ArrayRef< Expr * > clang::OMPNumThreadsClause::getNumThreads ( ) const
inline

Definition at line 926 of file OpenMPClause.h.

References getNumThreads().

◆ getPrescriptivenessModifier()

OpenMPNumThreadsClauseModifier clang::OMPNumThreadsClause::getPrescriptivenessModifier ( ) const
inline

Returns the prescriptiveness modifier.

Definition at line 931 of file OpenMPClause.h.

◆ getPrescriptivenessModifierLoc()

SourceLocation clang::OMPNumThreadsClause::getPrescriptivenessModifierLoc ( ) const
inline

Returns the location of the prescriptiveness modifier.

Definition at line 935 of file OpenMPClause.h.

◆ hasDimsModifier()

bool clang::OMPNumThreadsClause::hasDimsModifier ( ) const
inline

Checks if the clause has the dims modifier.

Definition at line 947 of file OpenMPClause.h.

Referenced by getDimsModifierExpr().

◆ used_children() [1/2]

child_range clang::OMPNumThreadsClause::used_children ( )
inline

Definition at line 968 of file OpenMPClause.h.

◆ used_children() [2/2]

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

Definition at line 971 of file OpenMPClause.h.

◆ OMPClauseReader

friend class OMPClauseReader
friend

Definition at line 836 of file OpenMPClause.h.

References OMPClauseReader.

Referenced by OMPClauseReader.

◆ OMPVarListClause< OMPNumThreadsClause >

friend class OMPVarListClause< OMPNumThreadsClause >
friend

Definition at line 804 of file OpenMPClause.h.

References clang::OMPFinalClause::used_children().


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