16 #ifndef LLVM_CLANG_AST_OPENMPCLAUSE_H
17 #define LLVM_CLANG_AST_OPENMPCLAUSE_H
42 : StartLoc(StartLoc), EndLoc(EndLoc),
Kind(K) {}
81 reinterpret_cast<Expr **
>(
82 reinterpret_cast<char *
>(
this) +
83 llvm::RoundUpToAlignment(
sizeof(T), llvm::alignOf<Expr *>())),
89 assert(VL.size() == NumVars &&
90 "Number of variables is not the same as the preallocated buffer");
93 reinterpret_cast<Expr **
>(
94 reinterpret_cast<char *
>(
this) +
95 llvm::RoundUpToAlignment(
sizeof(T), llvm::alignOf<Expr *>())));
108 :
OMPClause(K, StartLoc, EndLoc), LParenLoc(LParenLoc), NumVars(N) {}
138 return llvm::makeArrayRef(
139 reinterpret_cast<const Expr *const *>(
140 reinterpret_cast<const char *>(
this) +
141 llvm::RoundUpToAlignment(
sizeof(T), llvm::alignOf<const Expr *>())),
163 void setCondition(
Expr *Cond) { Condition = Cond; }
175 :
OMPClause(OMPC_if, StartLoc, EndLoc), LParenLoc(LParenLoc),
216 void setCondition(
Expr *Cond) { Condition = Cond; }
228 :
OMPClause(OMPC_final, StartLoc, EndLoc), LParenLoc(LParenLoc),
264 SourceLocation LParenLoc;
270 void setNumThreads(Expr *NThreads) { NumThreads = NThreads; }
282 :
OMPClause(OMPC_num_threads, StartLoc, EndLoc), LParenLoc(LParenLoc),
283 NumThreads(NumThreads) {}
288 :
OMPClause(OMPC_num_threads, SourceLocation(), SourceLocation()),
289 LParenLoc(SourceLocation()), NumThreads(nullptr) {}
303 StmtRange
children() {
return StmtRange(&NumThreads, &NumThreads + 1); }
327 void setSafelen(
Expr *Len) { Safelen = Len; }
338 :
OMPClause(OMPC_safelen, StartLoc, EndLoc), LParenLoc(LParenLoc),
382 void setNumForLoops(
Expr *Num) { NumForLoops = Num; }
394 :
OMPClause(OMPC_collapse, StartLoc, EndLoc), LParenLoc(LParenLoc),
445 void setDefaultKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
459 :
OMPClause(OMPC_default, StartLoc, EndLoc), LParenLoc(LParenLoc),
460 Kind(A), KindKwLoc(ALoc) {}
515 void setProcBindKindKwLoc(
SourceLocation KLoc) { KindKwLoc = KLoc; }
530 :
OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
531 Kind(A), KindKwLoc(ALoc) {}
578 enum { CHUNK_SIZE, HELPER_CHUNK_SIZE, NUM_EXPRS };
579 Stmt *ChunkSizes[NUM_EXPRS];
590 void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
595 void setScheduleKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
600 void setCommaLoc(SourceLocation Loc) { CommaLoc = Loc; }
605 void setChunkSize(Expr *E) { ChunkSizes[CHUNK_SIZE] = E; }
610 void setHelperChunkSize(Expr *E) { ChunkSizes[HELPER_CHUNK_SIZE] = E; }
628 Expr *ChunkSize,
Expr *HelperChunkSize)
629 :
OMPClause(OMPC_schedule, StartLoc, EndLoc), LParenLoc(LParenLoc),
630 Kind(Kind), KindLoc(KLoc), CommaLoc(CommaLoc) {
631 ChunkSizes[CHUNK_SIZE] = ChunkSize;
632 ChunkSizes[HELPER_CHUNK_SIZE] = HelperChunkSize;
640 ChunkSizes[CHUNK_SIZE] =
nullptr;
641 ChunkSizes[HELPER_CHUNK_SIZE] =
nullptr;
662 return dyn_cast_or_null<Expr>(ChunkSizes[CHUNK_SIZE]);
667 return dyn_cast_or_null<Expr>(ChunkSizes[HELPER_CHUNK_SIZE]);
672 return dyn_cast_or_null<Expr>(ChunkSizes[HELPER_CHUNK_SIZE]);
680 return StmtRange(&ChunkSizes[CHUNK_SIZE], &ChunkSizes[CHUNK_SIZE] + 1);
699 :
OMPClause(OMPC_ordered, StartLoc, EndLoc) {}
728 :
OMPClause(OMPC_nowait, StartLoc, EndLoc) {}
757 :
OMPClause(OMPC_untied, StartLoc, EndLoc) {}
787 :
OMPClause(OMPC_mergeable, StartLoc, EndLoc) {}
816 :
OMPClause(OMPC_read, StartLoc, EndLoc) {}
844 :
OMPClause(OMPC_write, StartLoc, EndLoc) {}
874 :
OMPClause(OMPC_update, StartLoc, EndLoc) {}
904 :
OMPClause(OMPC_capture, StartLoc, EndLoc) {}
934 :
OMPClause(OMPC_seq_cst, StartLoc, EndLoc) {}
982 void setPrivateCopies(ArrayRef<Expr *> VL);
986 MutableArrayRef<Expr *> getPrivateCopies() {
989 ArrayRef<const Expr *> getPrivateCopies()
const {
1003 static OMPPrivateClause *
Create(
const ASTContext &
C, SourceLocation StartLoc,
1004 SourceLocation LParenLoc,
1005 SourceLocation EndLoc, ArrayRef<Expr *> VL,
1006 ArrayRef<Expr *> PrivateVL);
1012 static OMPPrivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1017 typedef llvm::iterator_range<private_copies_const_iterator>
1022 getPrivateCopies().end());
1026 getPrivateCopies().end());
1061 LParenLoc, EndLoc, N) {}
1074 void setPrivateCopies(ArrayRef<Expr *> VL);
1078 MutableArrayRef<Expr *> getPrivateCopies() {
1081 ArrayRef<const Expr *> getPrivateCopies()
const {
1088 void setInits(ArrayRef<Expr *> VL);
1092 MutableArrayRef<Expr *>
getInits() {
1093 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
1095 ArrayRef<const Expr *>
getInits()
const {
1096 return llvm::makeArrayRef(getPrivateCopies().end(),
varlist_size());
1112 static OMPFirstprivateClause *
1113 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1114 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> PrivateVL,
1115 ArrayRef<Expr *> InitVL);
1121 static OMPFirstprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1126 typedef llvm::iterator_range<private_copies_const_iterator>
1131 getPrivateCopies().end());
1135 getPrivateCopies().end());
1198 LParenLoc, EndLoc, N) {}
1211 MutableArrayRef<Expr *> getPrivateCopies() {
1214 ArrayRef<const Expr *> getPrivateCopies()
const {
1222 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
1225 MutableArrayRef<Expr *> getSourceExprs() {
1226 return MutableArrayRef<Expr *>(getPrivateCopies().end(),
varlist_size());
1228 ArrayRef<const Expr *> getSourceExprs()
const {
1229 return llvm::makeArrayRef(getPrivateCopies().end(),
varlist_size());
1236 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
1239 MutableArrayRef<Expr *> getDestinationExprs() {
1240 return MutableArrayRef<Expr *>(getSourceExprs().end(),
varlist_size());
1242 ArrayRef<const Expr *> getDestinationExprs()
const {
1243 return llvm::makeArrayRef(getSourceExprs().end(),
varlist_size());
1249 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
1252 MutableArrayRef<Expr *> getAssignmentOps() {
1253 return MutableArrayRef<Expr *>(getDestinationExprs().end(),
varlist_size());
1255 ArrayRef<const Expr *> getAssignmentOps()
const {
1256 return llvm::makeArrayRef(getDestinationExprs().end(),
varlist_size());
1282 static OMPLastprivateClause *
1283 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1284 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
1285 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
1291 static OMPLastprivateClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1296 typedef llvm::iterator_range<helper_expr_const_iterator>
1305 getPrivateCopies().end());
1309 getPrivateCopies().end());
1313 getSourceExprs().end());
1320 getDestinationExprs().end());
1324 getDestinationExprs().end());
1328 getAssignmentOps().end());
1332 getAssignmentOps().end());
1437 LParenLoc, EndLoc, N),
1438 ColonLoc(ColonLoc), QualifierLoc(QualifierLoc), NameInfo(NameInfo) {}
1448 ColonLoc(), QualifierLoc(), NameInfo() {}
1453 void setNameInfo(DeclarationNameInfo DNI) { NameInfo = DNI; }
1455 void setQualifierLoc(NestedNameSpecifierLoc NSL) { QualifierLoc = NSL; }
1460 void setLHSExprs(ArrayRef<Expr *> LHSExprs);
1463 MutableArrayRef<Expr *> getLHSExprs() {
1466 ArrayRef<const Expr *> getLHSExprs()
const {
1475 void setRHSExprs(ArrayRef<Expr *> RHSExprs);
1478 MutableArrayRef<Expr *> getRHSExprs() {
1479 return MutableArrayRef<Expr *>(getLHSExprs().end(),
varlist_size());
1481 ArrayRef<const Expr *> getRHSExprs()
const {
1482 return llvm::makeArrayRef(getLHSExprs().end(),
varlist_size());
1489 void setReductionOps(ArrayRef<Expr *> ReductionOps);
1492 MutableArrayRef<Expr *> getReductionOps() {
1493 return MutableArrayRef<Expr *>(getRHSExprs().end(),
varlist_size());
1495 ArrayRef<const Expr *> getReductionOps()
const {
1496 return llvm::makeArrayRef(getRHSExprs().end(),
varlist_size());
1527 static OMPReductionClause *
1528 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1529 SourceLocation
ColonLoc, SourceLocation EndLoc, ArrayRef<Expr *> VL,
1530 NestedNameSpecifierLoc QualifierLoc,
1531 const DeclarationNameInfo &NameInfo, ArrayRef<Expr *> LHSExprs,
1532 ArrayRef<Expr *> RHSExprs, ArrayRef<Expr *> ReductionOps);
1538 static OMPReductionClause *
CreateEmpty(
const ASTContext &
C,
unsigned N);
1550 typedef llvm::iterator_range<helper_expr_const_iterator>
1567 getReductionOps().end());
1571 getReductionOps().end());
1613 SourceLocation
ColonLoc, SourceLocation EndLoc,
1617 ColonLoc(ColonLoc) {}
1625 SourceLocation(), SourceLocation(),
1645 ArrayRef<const Expr *>
getInits()
const {
1661 ArrayRef<const Expr *>
getFinals()
const {
1667 void setInits(ArrayRef<Expr *> IL);
1683 SourceLocation LParenLoc,
1684 SourceLocation
ColonLoc, SourceLocation EndLoc,
1685 ArrayRef<Expr *> VL, ArrayRef<Expr *> IL,
1686 Expr *Step, Expr *CalcStep);
1778 void setAlignment(Expr *A) { *varlist_end() = A; }
1789 SourceLocation
ColonLoc, SourceLocation EndLoc,
1793 ColonLoc(ColonLoc) {}
1801 SourceLocation(), SourceLocation(),
1816 SourceLocation LParenLoc,
1818 SourceLocation EndLoc, ArrayRef<Expr *> VL,
1839 return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()),
1840 reinterpret_cast<Stmt **>(varlist_end()));
1844 return T->getClauseKind() == OMPC_aligned;
1879 SourceLocation EndLoc,
unsigned N)
1889 SourceLocation(), SourceLocation(),
1895 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
1898 MutableArrayRef<Expr *> getSourceExprs() {
1899 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
1901 ArrayRef<const Expr *> getSourceExprs()
const {
1902 return llvm::makeArrayRef(varlist_end(), varlist_size());
1908 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
1911 MutableArrayRef<Expr *> getDestinationExprs() {
1912 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
1914 ArrayRef<const Expr *> getDestinationExprs()
const {
1915 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
1922 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
1925 MutableArrayRef<Expr *> getAssignmentOps() {
1926 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
1928 ArrayRef<const Expr *> getAssignmentOps()
const {
1929 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
1956 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
1957 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
1958 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
1969 typedef llvm::iterator_range<helper_expr_const_iterator>
1974 getSourceExprs().end());
1981 getDestinationExprs().end());
1985 getDestinationExprs().end());
1989 getAssignmentOps().end());
1993 getAssignmentOps().end());
1997 return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()),
1998 reinterpret_cast<Stmt **>(varlist_end()));
2002 return T->getClauseKind() == OMPC_copyin;
2025 SourceLocation EndLoc,
unsigned N)
2027 LParenLoc, EndLoc, N) {}
2035 OMPC_copyprivate, SourceLocation(), SourceLocation(),
2036 SourceLocation(), N) {}
2041 void setSourceExprs(ArrayRef<Expr *> SrcExprs);
2044 MutableArrayRef<Expr *> getSourceExprs() {
2045 return MutableArrayRef<Expr *>(varlist_end(), varlist_size());
2047 ArrayRef<const Expr *> getSourceExprs()
const {
2048 return llvm::makeArrayRef(varlist_end(), varlist_size());
2054 void setDestinationExprs(ArrayRef<Expr *> DstExprs);
2057 MutableArrayRef<Expr *> getDestinationExprs() {
2058 return MutableArrayRef<Expr *>(getSourceExprs().end(), varlist_size());
2060 ArrayRef<const Expr *> getDestinationExprs()
const {
2061 return llvm::makeArrayRef(getSourceExprs().end(), varlist_size());
2068 void setAssignmentOps(ArrayRef<Expr *> AssignmentOps);
2071 MutableArrayRef<Expr *> getAssignmentOps() {
2072 return MutableArrayRef<Expr *>(getDestinationExprs().end(), varlist_size());
2074 ArrayRef<const Expr *> getAssignmentOps()
const {
2075 return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size());
2101 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2102 SourceLocation EndLoc, ArrayRef<Expr *> VL, ArrayRef<Expr *> SrcExprs,
2103 ArrayRef<Expr *> DstExprs, ArrayRef<Expr *> AssignmentOps);
2114 typedef llvm::iterator_range<helper_expr_const_iterator>
2119 getSourceExprs().end());
2126 getDestinationExprs().end());
2130 getDestinationExprs().end());
2134 getAssignmentOps().end());
2138 getAssignmentOps().end());
2142 return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()),
2143 reinterpret_cast<Stmt **>(varlist_end()));
2147 return T->getClauseKind() == OMPC_copyprivate;
2172 OMPFlushClause(SourceLocation StartLoc, SourceLocation LParenLoc,
2173 SourceLocation EndLoc,
unsigned N)
2183 SourceLocation(), SourceLocation(),
2196 SourceLocation LParenLoc, SourceLocation EndLoc,
2197 ArrayRef<Expr *> VL);
2206 return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()),
2207 reinterpret_cast<Stmt **>(varlist_end()));
2211 return T->getClauseKind() == OMPC_flush;
2229 SourceLocation DepLoc;
2240 SourceLocation EndLoc,
unsigned N)
2251 SourceLocation(), SourceLocation(),
2258 void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; }
2276 Create(
const ASTContext &
C, SourceLocation StartLoc, SourceLocation LParenLoc,
2278 SourceLocation DepLoc, SourceLocation
ColonLoc, ArrayRef<Expr *> VL);
2294 return StmtRange(reinterpret_cast<Stmt **>(varlist_begin()),
2295 reinterpret_cast<Stmt **>(varlist_end()));
2299 return T->getClauseKind() == OMPC_depend;
static OMPPrivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL)
Creates clause with a list of variables VL.
OMPCaptureClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'capture' clause.
private_copies_const_range private_copies() const
varlist_const_range varlists() const
helper_expr_range source_exprs()
OMPUntiedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'untied' clause.
llvm::iterator_range< private_copies_iterator > private_copies_range
OMPSeqCstClause()
Build an empty clause.
This represents clause 'copyin' in the '#pragma omp ...' directives.
helper_expr_range source_exprs()
SourceLocation getColonLoc() const
Get colon location.
helper_expr_const_range source_exprs() const
static bool classof(const OMPClause *T)
MutableArrayRef< Expr * >::iterator inits_iterator
SourceLocation getCommaLoc()
Get location of ','.
private_copies_range private_copies()
OMPIfClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'if' clause with condition Cond.
OMPUpdateClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'update' clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
OpenMPProcBindClauseKind getProcBindKind() const
Returns kind of the clause.
static OMPFirstprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
static bool classof(const OMPClause *T)
This represents 'if' clause in the '#pragma omp ...' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getColonLoc() const
Returns the location of ':'.
This represents 'update' clause in the '#pragma omp atomic' directive.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
ArrayRef< const Expr * > getVarRefs() const
Fetches list of all variables in the clause.
Expr * getAlignment()
Returns alignment.
static OMPReductionClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
Expr * getHelperChunkSize() const
Get helper chunk size.
static bool classof(const OMPClause *T)
This represents 'read' clause in the '#pragma omp atomic' directive.
OMPFinalClause()
Build an empty clause.
helper_expr_range source_exprs()
This represents clause 'private' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
ArrayRef< const Expr * >::iterator private_copies_const_iterator
This represents 'num_threads' clause in the '#pragma omp ...' directive.
bool varlist_empty() const
This represents implicit clause 'flush' for the '#pragma omp flush' directive. This clause does not e...
llvm::iterator_range< private_copies_iterator > private_copies_range
This represents 'safelen' clause in the '#pragma omp ...' directive.
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
Expr * getNumThreads() const
Returns number of threads.
This represents clauses with the list of variables like 'private', 'firstprivate', 'copyin', 'shared', or 'reduction' clauses in the '#pragma omp ...' directives.
OMPProcBindClause()
Build an empty clause.
static OMPSharedClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL)
Creates clause with a list of variables VL.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
ArrayRef< const Expr * >::iterator updates_const_iterator
static OMPFirstprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > PrivateVL, ArrayRef< Expr * > InitVL)
Creates clause with a list of variables VL.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
ArrayRef< const Expr * >::iterator finals_const_iterator
static bool classof(const OMPClause *T)
helper_expr_range assignment_ops()
This represents clause 'lastprivate' in the '#pragma omp ...' directives.
void setUpdates(ArrayRef< Expr * > UL)
Sets the list of update expressions for linear variables.
SourceLocation getLocStart() const
Returns the starting location of the clause.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OMPVarListClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, unsigned N)
Build a clause with N variables.
varlist_iterator varlist_begin()
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
ArrayRef< const Expr * >::iterator private_copies_const_iterator
private_copies_const_range private_copies() const
Defines some OpenMP-specific enums and functions.
llvm::iterator_range< varlist_const_iterator > varlist_const_range
const DeclarationNameInfo & getNameInfo() const
Gets the name info for specified reduction identifier.
llvm::iterator_range< updates_iterator > updates_range
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
OMPSafelenClause()
Build an empty clause.
llvm::iterator_range< varlist_iterator > varlist_range
This represents clause 'copyprivate' in the '#pragma omp ...' directives.
helper_expr_range destination_exprs()
helper_expr_const_range private_copies() const
void setFinals(ArrayRef< Expr * > FL)
Sets the list of final update expressions for linear variables.
helper_expr_const_range source_exprs() const
OpenMPScheduleClauseKind getScheduleKind() const
Get kind of the clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
Expr * getChunkSize() const
Get chunk size.
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > IL, Expr *Step, Expr *CalcStep)
Creates clause with a list of variables VL and a linear step Step.
void setCalcStep(Expr *CalcStep)
Sets the expression to calculate linear step for clause.
This represents 'default' clause in the '#pragma omp ...' directive.
OMPProcBindClause(OpenMPProcBindClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'proc_bind' clause with argument A ('master', 'close' or 'spread').
OMPWriteClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'write' clause.
static OMPReductionClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, ArrayRef< Expr * > LHSExprs, ArrayRef< Expr * > RHSExprs, ArrayRef< Expr * > ReductionOps)
Creates clause with a list of variables VL.
This represents 'final' clause in the '#pragma omp ...' directive.
This represents 'mergeable' clause in the '#pragma omp ...' directive.
MutableArrayRef< Expr * > getFinals()
Sets the list of final update expressions for linear variables.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
This represents clause 'reduction' in the '#pragma omp ...' directives.
void setColonLoc(SourceLocation Loc)
Sets the location of ':'.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
llvm::iterator_range< finals_const_iterator > finals_const_range
OMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'seq_cst' clause.
OMPScheduleClause()
Build an empty clause.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
OpenMPDefaultClauseKind getDefaultKind() const
Returns kind of the clause.
OpenMPClauseKind getClauseKind() const
Returns kind of OpenMP clause (private, shared, reduction, etc.).
OpenMPDependClauseKind getDependencyKind() const
Get dependency type.
OMPCollapseClause(Expr *Num, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'collapse' clause.
SourceLocation getLocEnd() const
Returns the ending location of the clause.
static bool classof(const OMPClause *)
llvm::iterator_range< inits_const_iterator > inits_const_range
friend class OMPClauseReader
helper_expr_range assignment_ops()
SourceLocation getDefaultKindKwLoc() const
Returns location of clause kind.
OMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'nowait' clause.
This represents clause 'aligned' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
void setLocEnd(SourceLocation Loc)
Sets the ending location of the clause.
OMPWriteClause()
Build an empty clause.
MutableArrayRef< Expr * >::iterator varlist_iterator
OMPCaptureClause()
Build an empty clause.
static bool classof(const OMPClause *T)
OMPSafelenClause(Expr *Len, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'safelen' clause.
varlist_const_iterator varlist_end() const
helper_expr_range assignment_ops()
This represents implicit clause 'depend' for the '#pragma omp task' directive.
Expr * getStep()
Returns linear step.
SourceLocation getColonLoc() const
Gets location of ':' symbol in clause.
This represents 'proc_bind' clause in the '#pragma omp ...' directive.
This represents 'capture' clause in the '#pragma omp atomic' directive.
llvm::iterator_range< inits_iterator > inits_range
helper_expr_const_range assignment_ops() const
MutableArrayRef< Expr * > getUpdates()
Sets the list of update expressions for linear variables.
SourceLocation getScheduleKindLoc()
Get kind location.
Expr * getCondition() const
Returns condition.
MutableArrayRef< Expr * > getVarRefs()
Fetches list of variables associated with this clause.
const Expr * getAlignment() const
Returns alignment.
void setInits(ArrayRef< Expr * > IL)
Sets the list of the initial values for linear variables.
OMPScheduleClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation KLoc, SourceLocation CommaLoc, SourceLocation EndLoc, OpenMPScheduleClauseKind Kind, Expr *ChunkSize, Expr *HelperChunkSize)
Build 'schedule' clause with schedule kind Kind and chunk size expression ChunkSize.
OpenMPClauseKind
OpenMP clauses.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
MutableArrayRef< Expr * >::iterator private_copies_iterator
static bool classof(const OMPClause *T)
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents 'ordered' clause in the '#pragma omp ...' directive.
Expr * getCalcStep()
Returns expression to calculate linear step.
OMPLinearClause(SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, unsigned NumVars)
Build 'linear' clause with given number of variables NumVars.
ArrayRef< const Expr * >::iterator varlist_const_iterator
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc() const
Returns the location of '('.
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
void setPrivateCopies(ArrayRef< Expr * > PrivateCopies)
Set list of helper expressions, required for generation of private copies of original lastprivate var...
inits_const_range inits() const
static OMPPrivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
This represents 'collapse' clause in the '#pragma omp ...' directive.
This represents clause 'firstprivate' in the '#pragma omp ...' directives.
llvm::iterator_range< helper_expr_iterator > helper_expr_range
MutableArrayRef< Expr * >::iterator helper_expr_iterator
SourceLocation getProcBindKindKwLoc() const
Returns location of clause kind.
NestedNameSpecifierLoc getQualifierLoc() const
Gets the nested name specifier.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
llvm::iterator_range< inits_const_iterator > inits_const_range
helper_expr_range destination_exprs()
helper_expr_const_range destination_exprs() const
This represents 'seq_cst' clause in the '#pragma omp atomic' directive.
This represents 'untied' clause in the '#pragma omp ...' directive.
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_range lhs_exprs()
static bool classof(const OMPClause *T)
ArrayRef< const Expr * >::iterator inits_const_iterator
OMPMergeableClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'mergeable' clause.
static bool classof(const OMPClause *T)
static bool classof(const OMPClause *T)
SourceLocation getLParenLoc()
Get location of '('.
helper_expr_range destination_exprs()
OMPNumThreadsClause(Expr *NumThreads, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'num_threads' clause with condition NumThreads.
helper_expr_range private_copies()
ArrayRef< const Expr * >::iterator inits_const_iterator
OMPCollapseClause()
Build an empty clause.
static bool classof(const OMPClause *T)
Expr * getNumForLoops() const
Return the number of associated for-loops.
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
helper_expr_const_range reduction_ops() const
clang::OMPLinearClause OMPVarListClause getInits()
helper_expr_range rhs_exprs()
private_copies_range private_copies()
void setVarRefs(ArrayRef< Expr * > VL)
Sets the list of variables for this clause.
Expr * getCondition() const
Returns condition.
helper_expr_const_range lhs_exprs() const
This represents 'schedule' clause in the '#pragma omp ...' directive.
OMPMergeableClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
This represents clause 'shared' in the '#pragma omp ...' directives.
varlist_const_iterator varlist_begin() const
MutableArrayRef< Expr * >::iterator helper_expr_iterator
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
This is a basic class for representing single OpenMP clause.
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
SourceLocation getDependencyLoc() const
Get dependency type location.
helper_expr_range reduction_ops()
llvm::iterator_range< private_copies_const_iterator > private_copies_const_range
static bool classof(const OMPClause *T)
llvm::iterator_range< helper_expr_iterator > helper_expr_range
helper_expr_const_range rhs_exprs() const
static bool classof(const OMPClause *T)
OMPNumThreadsClause()
Build an empty clause.
This represents clause 'linear' in the '#pragma omp ...' directives.
static bool classof(const OMPClause *T)
ConstStmtRange children() const
SourceLocation getColonLoc() const
Returns the location of '('.
static bool classof(const OMPClause *T)
void setLocStart(SourceLocation Loc)
Sets the starting location of the clause.
static OMPSharedClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with N variables.
static bool classof(const OMPClause *T)
llvm::iterator_range< inits_iterator > inits_range
llvm::iterator_range< helper_expr_iterator > helper_expr_range
Expr * getSafelen() const
Return safe iteration space distance.
void setStep(Expr *Step)
Sets the linear step for clause.
OMPDefaultClause(OpenMPDefaultClauseKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'default' clause with argument A ('none' or 'shared').
MutableArrayRef< Expr * >::iterator helper_expr_iterator
OMPReadClause()
Build an empty clause.
SourceLocation getLParenLoc() const
Returns the location of '('.
SourceLocation getLParenLoc() const
Returns the location of '('.
OMPUntiedClause()
Build an empty clause.
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
OMPFinalClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc)
Build 'final' clause with condition Cond.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
OMPNowaitClause()
Build an empty clause.
MutableArrayRef< Expr * >::iterator helper_expr_iterator
This represents 'write' clause in the '#pragma omp atomic' directive.
MutableArrayRef< Expr * >::iterator inits_iterator
MutableArrayRef< Expr * >::iterator private_copies_iterator
SourceLocation getLParenLoc() const
Returns the location of '('.
helper_expr_const_range destination_exprs() const
Defines the clang::SourceLocation class and associated facilities.
This represents 'nowait' clause in the '#pragma omp ...' directive.
varlist_iterator varlist_end()
MutableArrayRef< Expr * >::iterator finals_iterator
MutableArrayRef< Expr * >::iterator updates_iterator
OMPClause(OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation EndLoc)
llvm::iterator_range< helper_expr_const_iterator > helper_expr_const_range
helper_expr_const_range assignment_ops() const
OMPIfClause()
Build an empty clause.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
OMPUpdateClause()
Build an empty clause.
Expr * getHelperChunkSize()
Get helper chunk size.
llvm::iterator_range< updates_const_iterator > updates_const_range
static bool classof(const OMPClause *T)
Expr * getChunkSize()
Get chunk size.
llvm::iterator_range< finals_iterator > finals_range
OMPReadClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'read' clause.
helper_expr_const_range destination_exprs() const
ArrayRef< const Expr * >::iterator helper_expr_const_iterator
static OMPLastprivateClause * CreateEmpty(const ASTContext &C, unsigned N)
Creates an empty clause with the place for N variables.
SourceLocation ColonLoc
Location of ':'.
void setLParenLoc(SourceLocation Loc)
Sets the location of '('.
unsigned varlist_size() const
OMPOrderedClause()
Build an empty clause.
OMPOrderedClause(SourceLocation StartLoc, SourceLocation EndLoc)
Build 'ordered' clause.
OMPDefaultClause()
Build an empty clause.
static bool classof(const OMPClause *T)
helper_expr_const_range assignment_ops() const
helper_expr_const_range source_exprs() const
static OMPLastprivateClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef< Expr * > VL, ArrayRef< Expr * > SrcExprs, ArrayRef< Expr * > DstExprs, ArrayRef< Expr * > AssignmentOps)
Creates clause with a list of variables VL.