clang 24.0.0git
OMPUnrollDirective Class Referencefinal

This represents the '#pragma omp unroll' loop transformation directive. More...

#include "clang/AST/StmtOpenMP.h"

Inheritance diagram for OMPUnrollDirective:
[legend]

Public Member Functions

Stmt * getTransformedStmt () const
 Get the de-sugared associated loops after unrolling.
Stmt * getPreInits () const
 Return the pre-init statements.
Stmt * getFinals () const
 Return finals statement, used when an enclosing loop transformation consumes the unrolled loop.
Public Member Functions inherited from OMPCanonicalLoopNestTransformationDirective
unsigned getNumAssociatedLoops () const
 Return the number of associated (consumed) loops.
Stmt * getTransformedStmt () const
 Get the de-sugared statements after the loop transformation.
Stmt * getPreInits () const
 Return preinits statement.
Stmt * getFinals () const
 Return loop variable finalization statement, or nullptr if the concrete transformation does not produce one (e.g. unroll).
Public Member Functions inherited from OMPLoopTransformationDirective
unsigned getNumGeneratedTopLevelLoops () const
Stmt * getDirective () const
 Returns the specific directive related to this loop transformation.
Stmt * getTransformedStmt () const
 Get the de-sugared statements after the loop transformation.
Stmt * getPreInits () const
 Return preinits statement.
Stmt * getFinals () const
 Return loop variable finalization statement, or nullptr if the concrete transformation does not produce one (e.g. unroll).

Static Public Member Functions

static OMPUnrollDirective * Create (const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, unsigned NumGeneratedTopLevelLoops, Stmt *TransformedStmt, Stmt *PreInits, Stmt *Finals)
 Create a new AST node representation for '#pragma omp unroll'.
static OMPUnrollDirective * CreateEmpty (const ASTContext &C, unsigned NumClauses)
 Build an empty '#pragma omp unroll' AST node for deserialization.
static bool classof (const Stmt *T)
Static Public Member Functions inherited from OMPCanonicalLoopNestTransformationDirective
static bool classof (const Stmt *T)
Static Public Member Functions inherited from OMPLoopTransformationDirective
static bool classof (const Stmt *T)

Friends

class ASTStmtReader
class OMPExecutableDirective

Additional Inherited Members

Protected Member Functions inherited from OMPCanonicalLoopNestTransformationDirective
 OMPCanonicalLoopNestTransformationDirective (StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned NumAssociatedLoops)
Protected Member Functions inherited from OMPLoopTransformationDirective
void setNumGeneratedTopLevelLoops (unsigned N)
 OMPLoopTransformationDirective (Stmt *S)

Detailed Description

This represents the '#pragma omp unroll' loop transformation directive.

#pragma omp unroll
for (int i = 0; i < 64; ++i)

Definition at line 5876 of file StmtOpenMP.h.

Member Function Documentation

◆ classof()

bool OMPUnrollDirective::classof ( const Stmt * T)
inlinestatic

Definition at line 5948 of file StmtOpenMP.h.

◆ Create()

OMPUnrollDirective * OMPUnrollDirective::Create ( const ASTContext & C,
SourceLocation StartLoc,
SourceLocation EndLoc,
ArrayRef< OMPClause * > Clauses,
Stmt * AssociatedStmt,
unsigned NumGeneratedTopLevelLoops,
Stmt * TransformedStmt,
Stmt * PreInits,
Stmt * Finals )
static

Create a new AST node representation for '#pragma omp unroll'.

Parameters
CContext of the AST.
StartLocLocation of the introducer (e.g. the 'omp' token).
EndLocLocation of the directive's end (e.g. the tok::eod).
ClausesThe directive's clauses.
AssociatedStmtThe outermost associated loop.
TransformedStmtThe loop nest after tiling, or nullptr in dependent contexts.
PreInitsHelper preinits statements for the loop nest.
FinalsLoop variable finalization statements.

Definition at line 625 of file StmtOpenMP.cpp.

References clang::C.

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

◆ CreateEmpty()

OMPUnrollDirective * OMPUnrollDirective::CreateEmpty ( const ASTContext & C,
unsigned NumClauses )
static

Build an empty '#pragma omp unroll' AST node for deserialization.

Parameters
CContext of the AST.
NumClausesNumber of clauses to allocate.

Definition at line 642 of file StmtOpenMP.cpp.

References clang::C.

◆ getFinals()

Stmt * OMPUnrollDirective::getFinals ( ) const
inline

Return finals statement, used when an enclosing loop transformation consumes the unrolled loop.

Definition at line 5946 of file StmtOpenMP.h.

◆ getPreInits()

Stmt * OMPUnrollDirective::getPreInits ( ) const
inline

Return the pre-init statements.

Definition at line 5942 of file StmtOpenMP.h.

◆ getTransformedStmt()

Stmt * OMPUnrollDirective::getTransformedStmt ( ) const
inline

Get the de-sugared associated loops after unrolling.

This is only used if the unrolled loop becomes an associated loop of another directive, otherwise the loop is emitted directly using loop transformation metadata. When the unrolled loop cannot be used by another directive (e.g. because of the full clause), the transformed stmt can also be nullptr.

Definition at line 5937 of file StmtOpenMP.h.

◆ ASTStmtReader

friend class ASTStmtReader
friend

Definition at line 5878 of file StmtOpenMP.h.

References ASTStmtReader.

Referenced by ASTStmtReader.

◆ OMPExecutableDirective

friend class OMPExecutableDirective
friend

Definition at line 5879 of file StmtOpenMP.h.

References OMPExecutableDirective.

Referenced by OMPExecutableDirective.


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