@@ -1424,6 +1424,86 @@ class OMPDefaultClause : public OMPClause {
14241424 }
14251425};
14261426
1427+ // / This represents 'threadset' clause in the '#pragma omp task ...' directive.
1428+ // /
1429+ // / \code
1430+ // / #pragma omp task threadset(omp_pool)
1431+ // / \endcode
1432+ // / In this example directive '#pragma omp task' has simple 'threadset'
1433+ // / clause with kind 'omp_pool'.
1434+ class OMPThreadsetClause final : public OMPClause {
1435+ friend class OMPClauseReader ;
1436+
1437+ // / Location of '('.
1438+ SourceLocation LParenLoc;
1439+
1440+ // / A kind of the 'threadset' clause.
1441+ OpenMPThreadsetKind Kind = OMPC_THREADSET_unknown;
1442+
1443+ // / Start location of the kind in source code.
1444+ SourceLocation KindLoc;
1445+
1446+ // / Set kind of the clauses.
1447+ // /
1448+ // / \param K Argument of clause.
1449+ void setThreadsetKind (OpenMPThreadsetKind K) { Kind = K; }
1450+
1451+ // / Set argument location.
1452+ // /
1453+ // / \param KLoc Argument location.
1454+ void setThreadsetKindLoc (SourceLocation KLoc) { KindLoc = KLoc; }
1455+
1456+ public:
1457+ // / Build 'threadset' clause with argument \a A ('omp_team' or 'omp_pool').
1458+ // /
1459+ // / \param A Argument of the clause ('omp_team' or 'omp_pool').
1460+ // / \param ALoc Starting location of the argument.
1461+ // / \param StartLoc Starting location of the clause.
1462+ // / \param LParenLoc Location of '('.
1463+ // / \param EndLoc Ending location of the clause.
1464+ OMPThreadsetClause (OpenMPThreadsetKind A, SourceLocation ALoc,
1465+ SourceLocation StartLoc, SourceLocation LParenLoc,
1466+ SourceLocation EndLoc)
1467+ : OMPClause(llvm::omp::OMPC_threadset, StartLoc, EndLoc),
1468+ LParenLoc (LParenLoc), Kind(A), KindLoc(ALoc) {}
1469+
1470+ // / Build an empty clause.
1471+ OMPThreadsetClause ()
1472+ : OMPClause(llvm::omp::OMPC_threadset, SourceLocation(),
1473+ SourceLocation()) {}
1474+
1475+ // / Sets the location of '('.
1476+ void setLParenLoc (SourceLocation Loc) { LParenLoc = Loc; }
1477+
1478+ // / Returns the location of '('.
1479+ SourceLocation getLParenLoc () const { return LParenLoc; }
1480+
1481+ // / Returns kind of the clause.
1482+ OpenMPThreadsetKind getThreadsetKind () const { return Kind; }
1483+
1484+ // / Returns location of clause kind.
1485+ SourceLocation getThreadsetKindLoc () const { return KindLoc; }
1486+
1487+ child_range children () {
1488+ return child_range (child_iterator (), child_iterator ());
1489+ }
1490+
1491+ const_child_range children () const {
1492+ return const_child_range (const_child_iterator (), const_child_iterator ());
1493+ }
1494+
1495+ child_range used_children () {
1496+ return child_range (child_iterator (), child_iterator ());
1497+ }
1498+ const_child_range used_children () const {
1499+ return const_child_range (const_child_iterator (), const_child_iterator ());
1500+ }
1501+
1502+ static bool classof (const OMPClause *T) {
1503+ return T->getClauseKind () == llvm::omp::OMPC_threadset;
1504+ }
1505+ };
1506+
14271507// / This represents 'proc_bind' clause in the '#pragma omp ...'
14281508// / directive.
14291509// /
0 commit comments