clang API Documentation
This is a basic class for representing single OpenMP executable directive. More...
#include <StmtOpenMP.h>
Classes | |
class | filtered_clause_iterator |
Iterates over a filtered subrange of clauses applied to a directive. More... | |
Public Member Functions | |
const OMPClause * | getSingleClause (OpenMPClauseKind K) const |
Gets a single clause of the specified kind K associated with the current directive iff there is only one clause of this kind (and assertion is fired if there is more than one clause is associated with the directive). Returns nullptr if no clause of kind K is associated with the directive. | |
SourceLocation | getLocStart () const |
Returns starting location of directive kind. | |
SourceLocation | getLocEnd () const |
Returns ending location of directive. | |
void | setLocStart (SourceLocation Loc) |
Set starting location of directive kind. | |
void | setLocEnd (SourceLocation Loc) |
Set ending location of directive. | |
unsigned | getNumClauses () const |
Get number of clauses. | |
OMPClause * | getClause (unsigned i) const |
Returns specified clause. | |
bool | hasAssociatedStmt () const |
Returns true if directive has associated statement. | |
Stmt * | getAssociatedStmt () const |
Returns statement associated with the directive. | |
OpenMPDirectiveKind | getDirectiveKind () const |
child_range | children () |
ArrayRef< OMPClause * > | clauses () |
ArrayRef< OMPClause * > | clauses () const |
Static Public Member Functions | |
static bool | classof (const Stmt *S) |
Protected Member Functions | |
template<typename T > | |
OMPExecutableDirective (const T *, StmtClass SC, OpenMPDirectiveKind K, SourceLocation StartLoc, SourceLocation EndLoc, unsigned NumClauses, unsigned NumChildren) | |
Build instance of directive of class K. | |
void | setClauses (ArrayRef< OMPClause * > Clauses) |
Sets the list of variables for this clause. | |
void | setAssociatedStmt (Stmt *S) |
Set the associated statement for the directive. | |
Friends | |
class | ASTStmtReader |
This is a basic class for representing single OpenMP executable directive.
Definition at line 33 of file StmtOpenMP.h.
clang::OMPExecutableDirective::OMPExecutableDirective | ( | const T * | , |
StmtClass | SC, | ||
OpenMPDirectiveKind | K, | ||
SourceLocation | StartLoc, | ||
SourceLocation | EndLoc, | ||
unsigned | NumClauses, | ||
unsigned | NumChildren | ||
) | [inline, protected] |
Build instance of directive of class K.
SC | Statement class. |
K | Kind of OpenMP directive. |
StartLoc | Starting location of the directive (directive keyword). |
EndLoc | Ending location of the directive. |
Definition at line 67 of file StmtOpenMP.h.
child_range clang::OMPExecutableDirective::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
Definition at line 179 of file StmtOpenMP.h.
References hasAssociatedStmt().
static bool clang::OMPExecutableDirective::classof | ( | const Stmt * | S | ) | [inline, static] |
Reimplemented in clang::OMPTeamsDirective, clang::OMPTargetDirective, clang::OMPAtomicDirective, clang::OMPOrderedDirective, clang::OMPFlushDirective, clang::OMPTaskwaitDirective, clang::OMPBarrierDirective, clang::OMPTaskyieldDirective, clang::OMPTaskDirective, clang::OMPParallelSectionsDirective, clang::OMPParallelForSimdDirective, clang::OMPParallelForDirective, clang::OMPCriticalDirective, clang::OMPMasterDirective, clang::OMPSingleDirective, clang::OMPSectionDirective, clang::OMPSectionsDirective, clang::OMPForSimdDirective, clang::OMPForDirective, clang::OMPSimdDirective, clang::OMPLoopDirective, and clang::OMPParallelDirective.
Definition at line 174 of file StmtOpenMP.h.
References clang::Stmt::getStmtClass().
ArrayRef<OMPClause *> clang::OMPExecutableDirective::clauses | ( | ) | [inline] |
Definition at line 186 of file StmtOpenMP.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitOMPPrivateClause(), clang::CodeGen::CodeGenFunction::EmitOMPSimdDirective(), getClause(), getSingleClause(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
ArrayRef<OMPClause *> clang::OMPExecutableDirective::clauses | ( | ) | const [inline] |
Definition at line 188 of file StmtOpenMP.h.
Stmt* clang::OMPExecutableDirective::getAssociatedStmt | ( | ) | const [inline] |
Returns statement associated with the directive.
Definition at line 167 of file StmtOpenMP.h.
References clang::Stmt::child_begin(), and hasAssociatedStmt().
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), clang::CodeGen::EmitOpenMPOutlinedFunction(), clang::OMPLoopDirective::getBody(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
OMPClause* clang::OMPExecutableDirective::getClause | ( | unsigned | i | ) | const [inline] |
Returns specified clause.
i | Number of clause. |
Definition at line 161 of file StmtOpenMP.h.
References clauses().
OpenMPDirectiveKind clang::OMPExecutableDirective::getDirectiveKind | ( | ) | const [inline] |
Definition at line 172 of file StmtOpenMP.h.
Referenced by clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
SourceLocation clang::OMPExecutableDirective::getLocEnd | ( | ) | const [inline] |
Returns ending location of directive.
Reimplemented from clang::Stmt.
Definition at line 141 of file StmtOpenMP.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
SourceLocation clang::OMPExecutableDirective::getLocStart | ( | ) | const [inline] |
Returns starting location of directive kind.
Reimplemented from clang::Stmt.
Definition at line 139 of file StmtOpenMP.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), EmitOMPParallelCall(), clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
unsigned clang::OMPExecutableDirective::getNumClauses | ( | ) | const [inline] |
const OMPClause * OMPExecutableDirective::getSingleClause | ( | OpenMPClauseKind | K | ) | const |
Gets a single clause of the specified kind K associated with the current directive iff there is only one clause of this kind (and assertion is fired if there is more than one clause is associated with the directive). Returns nullptr if no clause of kind K is associated with the directive.
Definition at line 1445 of file Stmt.cpp.
References AttributeLangSupport::C, and clauses().
Referenced by EmitOMPParallelCall(), and clang::CodeGen::CodeGenFunction::EmitOMPParallelDirective().
bool clang::OMPExecutableDirective::hasAssociatedStmt | ( | ) | const [inline] |
Returns true if directive has associated statement.
Definition at line 164 of file StmtOpenMP.h.
Referenced by children(), getAssociatedStmt(), setAssociatedStmt(), and clang::TreeTransform< Derived >::TransformOMPExecutableDirective().
void clang::OMPExecutableDirective::setAssociatedStmt | ( | Stmt * | S | ) | [inline, protected] |
Set the associated statement for the directive.
/param S Associated statement.
Definition at line 86 of file StmtOpenMP.h.
References clang::Stmt::child_begin(), hasAssociatedStmt(), and S.
Referenced by clang::OMPParallelDirective::Create(), clang::OMPSimdDirective::Create(), clang::OMPForDirective::Create(), clang::OMPForSimdDirective::Create(), clang::OMPSectionsDirective::Create(), clang::OMPSectionDirective::Create(), clang::OMPSingleDirective::Create(), clang::OMPMasterDirective::Create(), clang::OMPCriticalDirective::Create(), clang::OMPParallelForDirective::Create(), clang::OMPParallelForSimdDirective::Create(), clang::OMPParallelSectionsDirective::Create(), clang::OMPTaskDirective::Create(), clang::OMPOrderedDirective::Create(), clang::OMPAtomicDirective::Create(), clang::OMPTargetDirective::Create(), and clang::OMPTeamsDirective::Create().
void OMPExecutableDirective::setClauses | ( | ArrayRef< OMPClause * > | Clauses | ) | [protected] |
Sets the list of variables for this clause.
Clauses | The list of clauses for the directive. |
Definition at line 1378 of file Stmt.cpp.
References getNumClauses().
Referenced by clang::OMPParallelDirective::Create(), clang::OMPSimdDirective::Create(), clang::OMPForDirective::Create(), clang::OMPForSimdDirective::Create(), clang::OMPSectionsDirective::Create(), clang::OMPSingleDirective::Create(), clang::OMPParallelForDirective::Create(), clang::OMPParallelForSimdDirective::Create(), clang::OMPParallelSectionsDirective::Create(), clang::OMPTaskDirective::Create(), clang::OMPFlushDirective::Create(), clang::OMPAtomicDirective::Create(), clang::OMPTargetDirective::Create(), and clang::OMPTeamsDirective::Create().
void clang::OMPExecutableDirective::setLocEnd | ( | SourceLocation | Loc | ) | [inline] |
Set ending location of directive.
Loc | New ending location of directive. |
Definition at line 152 of file StmtOpenMP.h.
void clang::OMPExecutableDirective::setLocStart | ( | SourceLocation | Loc | ) | [inline] |
Set starting location of directive kind.
Loc | New starting location of directive. |
Definition at line 147 of file StmtOpenMP.h.
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
Reimplemented in clang::OMPTeamsDirective, clang::OMPTargetDirective, clang::OMPAtomicDirective, clang::OMPOrderedDirective, clang::OMPFlushDirective, clang::OMPTaskwaitDirective, clang::OMPBarrierDirective, clang::OMPTaskyieldDirective, clang::OMPTaskDirective, clang::OMPParallelSectionsDirective, clang::OMPParallelForSimdDirective, clang::OMPParallelForDirective, clang::OMPCriticalDirective, clang::OMPMasterDirective, clang::OMPSingleDirective, clang::OMPSectionDirective, clang::OMPSectionsDirective, clang::OMPForSimdDirective, clang::OMPForDirective, clang::OMPSimdDirective, and clang::OMPLoopDirective.
Definition at line 34 of file StmtOpenMP.h.