clang  3.9.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
clang::OMPLoopDirective Class Reference

This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc.). More...

#include <StmtOpenMP.h>

Inheritance diagram for clang::OMPLoopDirective:
[legend]
Collaboration diagram for clang::OMPLoopDirective:
[legend]

Classes

struct  HelperExprs
 The expressions built for the OpenMP loop CodeGen for the whole collapsed loop nest. More...
 

Public Member Functions

unsigned getCollapsedNumber () const
 Get number of collapsed loops. More...
 
ExprgetIterationVariable () const
 
ExprgetLastIteration () const
 
ExprgetCalcLastIteration () const
 
ExprgetPreCond () const
 
ExprgetCond () const
 
ExprgetInit () const
 
ExprgetInc () const
 
const StmtgetPreInits () const
 
StmtgetPreInits ()
 
ExprgetIsLastIterVariable () const
 
ExprgetLowerBoundVariable () const
 
ExprgetUpperBoundVariable () const
 
ExprgetStrideVariable () const
 
ExprgetEnsureUpperBound () const
 
ExprgetNextLowerBound () const
 
ExprgetNextUpperBound () const
 
ExprgetNumIterations () const
 
ExprgetPrevLowerBoundVariable () const
 
ExprgetPrevUpperBoundVariable () const
 
const StmtgetBody () const
 
ArrayRef< Expr * > counters ()
 
ArrayRef< Expr * > counters () const
 
ArrayRef< Expr * > private_counters ()
 
ArrayRef< Expr * > private_counters () const
 
ArrayRef< Expr * > inits ()
 
ArrayRef< Expr * > inits () const
 
ArrayRef< Expr * > updates ()
 
ArrayRef< Expr * > updates () const
 
ArrayRef< Expr * > finals ()
 
ArrayRef< Expr * > finals () const
 
- Public Member Functions inherited from clang::OMPExecutableDirective
template<typename SpecificClause >
llvm::iterator_range
< specific_clause_iterator
< SpecificClause > > 
getClausesOfKind () const
 
template<typename SpecificClause >
const SpecificClause * getSingleClause () const
 Gets a single clause of the specified kind 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). More...
 
template<typename SpecificClause >
bool hasClausesOfKind () const
 Returns true if the current directive has one or more clauses of a specific kind. More...
 
SourceLocation getLocStart () const
 Returns starting location of directive kind. More...
 
SourceLocation getLocEnd () const
 Returns ending location of directive. More...
 
void setLocStart (SourceLocation Loc)
 Set starting location of directive kind. More...
 
void setLocEnd (SourceLocation Loc)
 Set ending location of directive. More...
 
unsigned getNumClauses () const
 Get number of clauses. More...
 
OMPClausegetClause (unsigned i) const
 Returns specified clause. More...
 
bool hasAssociatedStmt () const
 Returns true if directive has associated statement. More...
 
StmtgetAssociatedStmt () const
 Returns statement associated with the directive. More...
 
OpenMPDirectiveKind getDirectiveKind () const
 
child_range children ()
 
ArrayRef< OMPClause * > clauses ()
 
ArrayRef< OMPClause * > clauses () const
 

Static Public Member Functions

static bool classof (const Stmt *T)
 
- Static Public Member Functions inherited from clang::OMPExecutableDirective
template<typename SpecificClause >
static llvm::iterator_range
< specific_clause_iterator
< SpecificClause > > 
getClausesOfKind (ArrayRef< OMPClause * > Clauses)
 
static bool classof (const Stmt *S)
 

Protected Member Functions

template<typename T >
 OMPLoopDirective (const T *That, StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, unsigned NumClauses, unsigned NumSpecialChildren=0)
 Build instance of loop directive of class Kind. More...
 
void setIterationVariable (Expr *IV)
 
void setLastIteration (Expr *LI)
 
void setCalcLastIteration (Expr *CLI)
 
void setPreCond (Expr *PC)
 
void setCond (Expr *Cond)
 
void setInit (Expr *Init)
 
void setInc (Expr *Inc)
 
void setPreInits (Stmt *PreInits)
 
void setIsLastIterVariable (Expr *IL)
 
void setLowerBoundVariable (Expr *LB)
 
void setUpperBoundVariable (Expr *UB)
 
void setStrideVariable (Expr *ST)
 
void setEnsureUpperBound (Expr *EUB)
 
void setNextLowerBound (Expr *NLB)
 
void setNextUpperBound (Expr *NUB)
 
void setNumIterations (Expr *NI)
 
void setPrevLowerBoundVariable (Expr *PrevLB)
 
void setPrevUpperBoundVariable (Expr *PrevUB)
 
void setCounters (ArrayRef< Expr * > A)
 
void setPrivateCounters (ArrayRef< Expr * > A)
 
void setInits (ArrayRef< Expr * > A)
 
void setUpdates (ArrayRef< Expr * > A)
 
void setFinals (ArrayRef< Expr * > A)
 
- Protected Member Functions inherited from clang::OMPExecutableDirective
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. More...
 
void setClauses (ArrayRef< OMPClause * > Clauses)
 Sets the list of variables for this clause. More...
 
void setAssociatedStmt (Stmt *S)
 Set the associated statement for the directive. More...
 

Static Protected Member Functions

static unsigned getArraysOffset (OpenMPDirectiveKind Kind)
 Offset to the start of children expression arrays. More...
 
static unsigned numLoopChildren (unsigned CollapsedNum, OpenMPDirectiveKind Kind)
 Children number. More...
 

Friends

class ASTStmtReader
 

Detailed Description

This is a common base class for loop directives ('omp simd', 'omp for', 'omp for simd' etc.).

It is responsible for the loop code generation.

Definition at line 293 of file StmtOpenMP.h.

Constructor & Destructor Documentation

template<typename T >
clang::OMPLoopDirective::OMPLoopDirective ( const T *  That,
StmtClass  SC,
OpenMPDirectiveKind  Kind,
SourceLocation  StartLoc,
SourceLocation  EndLoc,
unsigned  CollapsedNum,
unsigned  NumClauses,
unsigned  NumSpecialChildren = 0 
)
inlineprotected

Build instance of loop directive of class Kind.

Parameters
SCStatement class.
KindKind of OpenMP directive.
StartLocStarting location of the directive (directive keyword).
EndLocEnding location of the directive.
CollapsedNumNumber of collapsed loops from 'collapse' clause.
NumClausesNumber of clauses.
NumSpecialChildrenNumber of additional directive-specific stmts.

Definition at line 388 of file StmtOpenMP.h.

Member Function Documentation

static bool clang::OMPLoopDirective::classof ( const Stmt T)
inlinestatic

Definition at line 763 of file StmtOpenMP.h.

ArrayRef<Expr *> clang::OMPLoopDirective::counters ( )
inline
ArrayRef<Expr *> clang::OMPLoopDirective::counters ( ) const
inline

Definition at line 735 of file StmtOpenMP.h.

ArrayRef<Expr *> clang::OMPLoopDirective::finals ( )
inline

Definition at line 757 of file StmtOpenMP.h.

ArrayRef<Expr *> clang::OMPLoopDirective::finals ( ) const
inline

Definition at line 759 of file StmtOpenMP.h.

static unsigned clang::OMPLoopDirective::getArraysOffset ( OpenMPDirectiveKind  Kind)
inlinestaticprotected

Offset to the start of children expression arrays.

Definition at line 398 of file StmtOpenMP.h.

References clang::isOpenMPDistributeDirective(), clang::isOpenMPTaskLoopDirective(), and clang::isOpenMPWorksharingDirective().

Referenced by numLoopChildren().

const Stmt* clang::OMPLoopDirective::getBody ( ) const
inline

Definition at line 722 of file StmtOpenMP.h.

References clang::OMPExecutableDirective::getAssociatedStmt().

Expr* clang::OMPLoopDirective::getCalcLastIteration ( ) const
inline
unsigned clang::OMPLoopDirective::getCollapsedNumber ( ) const
inline

Get number of collapsed loops.

Definition at line 608 of file StmtOpenMP.h.

Referenced by setCounters(), setFinals(), setInits(), setPrivateCounters(), and setUpdates().

Expr* clang::OMPLoopDirective::getCond ( ) const
inline
Expr* clang::OMPLoopDirective::getEnsureUpperBound ( ) const
inline
Expr* clang::OMPLoopDirective::getInc ( ) const
inline
Expr* clang::OMPLoopDirective::getInit ( ) const
inline
Expr* clang::OMPLoopDirective::getIsLastIterVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getIterationVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getLastIteration ( ) const
inline
Expr* clang::OMPLoopDirective::getLowerBoundVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getNextLowerBound ( ) const
inline
Expr* clang::OMPLoopDirective::getNextUpperBound ( ) const
inline
Expr* clang::OMPLoopDirective::getNumIterations ( ) const
inline
Expr* clang::OMPLoopDirective::getPreCond ( ) const
inline
const Stmt* clang::OMPLoopDirective::getPreInits ( ) const
inline

Definition at line 638 of file StmtOpenMP.h.

Stmt* clang::OMPLoopDirective::getPreInits ( )
inline

Definition at line 641 of file StmtOpenMP.h.

Expr* clang::OMPLoopDirective::getPrevLowerBoundVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getPrevUpperBoundVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getStrideVariable ( ) const
inline
Expr* clang::OMPLoopDirective::getUpperBoundVariable ( ) const
inline
ArrayRef<Expr *> clang::OMPLoopDirective::inits ( )
inline

Definition at line 745 of file StmtOpenMP.h.

Referenced by emitPreCond().

ArrayRef<Expr *> clang::OMPLoopDirective::inits ( ) const
inline

Definition at line 747 of file StmtOpenMP.h.

static unsigned clang::OMPLoopDirective::numLoopChildren ( unsigned  CollapsedNum,
OpenMPDirectiveKind  Kind 
)
inlinestaticprotected
ArrayRef<Expr *> clang::OMPLoopDirective::private_counters ( )
inline
ArrayRef<Expr *> clang::OMPLoopDirective::private_counters ( ) const
inline

Definition at line 741 of file StmtOpenMP.h.

void clang::OMPLoopDirective::setCalcLastIteration ( Expr CLI)
inlineprotected
void clang::OMPLoopDirective::setCond ( Expr Cond)
inlineprotected
void OMPLoopDirective::setCounters ( ArrayRef< Expr * >  A)
protected
void clang::OMPLoopDirective::setEnsureUpperBound ( Expr EUB)
inlineprotected
void OMPLoopDirective::setFinals ( ArrayRef< Expr * >  A)
protected
void clang::OMPLoopDirective::setInc ( Expr Inc)
inlineprotected
void clang::OMPLoopDirective::setInit ( Expr Init)
inlineprotected
void OMPLoopDirective::setInits ( ArrayRef< Expr * >  A)
protected
void clang::OMPLoopDirective::setIsLastIterVariable ( Expr IL)
inlineprotected
void clang::OMPLoopDirective::setIterationVariable ( Expr IV)
inlineprotected
void clang::OMPLoopDirective::setLastIteration ( Expr LI)
inlineprotected
void clang::OMPLoopDirective::setLowerBoundVariable ( Expr LB)
inlineprotected
void clang::OMPLoopDirective::setNextLowerBound ( Expr NLB)
inlineprotected
void clang::OMPLoopDirective::setNextUpperBound ( Expr NUB)
inlineprotected
void clang::OMPLoopDirective::setNumIterations ( Expr NI)
inlineprotected
void clang::OMPLoopDirective::setPreCond ( Expr PC)
inlineprotected
void clang::OMPLoopDirective::setPreInits ( Stmt PreInits)
inlineprotected
void clang::OMPLoopDirective::setPrevLowerBoundVariable ( Expr PrevLB)
inlineprotected
void clang::OMPLoopDirective::setPrevUpperBoundVariable ( Expr PrevUB)
inlineprotected
void OMPLoopDirective::setPrivateCounters ( ArrayRef< Expr * >  A)
protected
void clang::OMPLoopDirective::setStrideVariable ( Expr ST)
inlineprotected
void OMPLoopDirective::setUpdates ( ArrayRef< Expr * >  A)
protected
void clang::OMPLoopDirective::setUpperBoundVariable ( Expr UB)
inlineprotected
ArrayRef<Expr *> clang::OMPLoopDirective::updates ( )
inline

Definition at line 751 of file StmtOpenMP.h.

ArrayRef<Expr *> clang::OMPLoopDirective::updates ( ) const
inline

Definition at line 753 of file StmtOpenMP.h.

Friends And Related Function Documentation

friend class ASTStmtReader
friend

Definition at line 294 of file StmtOpenMP.h.


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