@@ -2212,6 +2212,94 @@ class OMPFlushClause : public OMPVarListClause<OMPFlushClause> {
2212
2212
}
2213
2213
};
2214
2214
2215
+ // / \brief This represents implicit clause 'depend' for the '#pragma omp task'
2216
+ // / directive.
2217
+ // /
2218
+ // / \code
2219
+ // / #pragma omp task depend(in:a,b)
2220
+ // / \endcode
2221
+ // / In this example directive '#pragma omp task' with clause 'depend' with the
2222
+ // / variables 'a' and 'b' with dependency 'in'.
2223
+ // /
2224
+ class OMPDependClause : public OMPVarListClause <OMPDependClause> {
2225
+ friend class OMPClauseReader ;
2226
+ // / \brief Dependency type (one of in, out, inout).
2227
+ OpenMPDependClauseKind DepKind;
2228
+ // / \brief Dependency type location.
2229
+ SourceLocation DepLoc;
2230
+ // / \brief Colon location.
2231
+ SourceLocation ColonLoc;
2232
+ // / \brief Build clause with number of variables \a N.
2233
+ // /
2234
+ // / \param StartLoc Starting location of the clause.
2235
+ // / \param LParenLoc Location of '('.
2236
+ // / \param EndLoc Ending location of the clause.
2237
+ // / \param N Number of the variables in the clause.
2238
+ // /
2239
+ OMPDependClause (SourceLocation StartLoc, SourceLocation LParenLoc,
2240
+ SourceLocation EndLoc, unsigned N)
2241
+ : OMPVarListClause<OMPDependClause>(OMPC_depend, StartLoc, LParenLoc,
2242
+ EndLoc, N),
2243
+ DepKind (OMPC_DEPEND_unknown) {}
2244
+
2245
+ // / \brief Build an empty clause.
2246
+ // /
2247
+ // / \param N Number of variables.
2248
+ // /
2249
+ explicit OMPDependClause (unsigned N)
2250
+ : OMPVarListClause<OMPDependClause>(OMPC_depend, SourceLocation(),
2251
+ SourceLocation(), SourceLocation(),
2252
+ N),
2253
+ DepKind(OMPC_DEPEND_unknown) {}
2254
+ // / \brief Set dependency kind.
2255
+ void setDependencyKind (OpenMPDependClauseKind K) { DepKind = K; }
2256
+
2257
+ // / \brief Set dependency kind and its location.
2258
+ void setDependencyLoc (SourceLocation Loc) { DepLoc = Loc; }
2259
+
2260
+ // / \brief Set colon location.
2261
+ void setColonLoc (SourceLocation Loc) { ColonLoc = Loc; }
2262
+
2263
+ public:
2264
+ // / \brief Creates clause with a list of variables \a VL.
2265
+ // /
2266
+ // / \param C AST context.
2267
+ // / \param StartLoc Starting location of the clause.
2268
+ // / \param LParenLoc Location of '('.
2269
+ // / \param EndLoc Ending location of the clause.
2270
+ // / \param DepKind Dependency type.
2271
+ // / \param DepLoc Location of the dependency type.
2272
+ // / \param ColonLoc Colon location.
2273
+ // / \param VL List of references to the variables.
2274
+ // /
2275
+ static OMPDependClause *
2276
+ Create (const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc,
2277
+ SourceLocation EndLoc, OpenMPDependClauseKind DepKind,
2278
+ SourceLocation DepLoc, SourceLocation ColonLoc, ArrayRef<Expr *> VL);
2279
+ // / \brief Creates an empty clause with \a N variables.
2280
+ // /
2281
+ // / \param C AST context.
2282
+ // / \param N The number of variables.
2283
+ // /
2284
+ static OMPDependClause *CreateEmpty (const ASTContext &C, unsigned N);
2285
+
2286
+ // / \brief Get dependency type.
2287
+ OpenMPDependClauseKind getDependencyKind () const { return DepKind; }
2288
+ // / \brief Get dependency type location.
2289
+ SourceLocation getDependencyLoc () const { return DepLoc; }
2290
+ // / \brief Get colon location.
2291
+ SourceLocation getColonLoc () const { return ColonLoc; }
2292
+
2293
+ StmtRange children () {
2294
+ return StmtRange (reinterpret_cast <Stmt **>(varlist_begin ()),
2295
+ reinterpret_cast <Stmt **>(varlist_end ()));
2296
+ }
2297
+
2298
+ static bool classof (const OMPClause *T) {
2299
+ return T->getClauseKind () == OMPC_depend;
2300
+ }
2301
+ };
2302
+
2215
2303
} // end namespace clang
2216
2304
2217
2305
#endif
0 commit comments