@@ -1540,6 +1540,41 @@ class TreeTransform {
1540
1540
Kind, AStmt, StartLoc, EndLoc);
1541
1541
}
1542
1542
1543
+ /// Build a new OmpSs 'if' clause.
1544
+ ///
1545
+ /// By default, performs semantic analysis to build the new OmpSs clause.
1546
+ /// Subclasses may override this routine to provide different behavior.
1547
+ OSSClause *RebuildOSSIfClause(Expr *Condition, SourceLocation StartLoc,
1548
+ SourceLocation LParenLoc,
1549
+ SourceLocation EndLoc) {
1550
+ return getSema().ActOnOmpSsIfClause(Condition, StartLoc, LParenLoc,
1551
+ EndLoc);
1552
+ }
1553
+
1554
+ /// Build a new OmpSs 'final' clause.
1555
+ ///
1556
+ /// By default, performs semantic analysis to build the new OmpSs clause.
1557
+ /// Subclasses may override this routine to provide different behavior.
1558
+ OSSClause *RebuildOSSFinalClause(Expr *Condition, SourceLocation StartLoc,
1559
+ SourceLocation LParenLoc,
1560
+ SourceLocation EndLoc) {
1561
+ return getSema().ActOnOmpSsFinalClause(Condition, StartLoc, LParenLoc,
1562
+ EndLoc);
1563
+ }
1564
+
1565
+ /// Build a new OmpSs 'depend' pseudo clause.
1566
+ ///
1567
+ /// By default, performs semantic analysis to build the new OmpSs clause.
1568
+ /// Subclasses may override this routine to provide different behavior.
1569
+ OSSClause *
1570
+ RebuildOSSDependClause(ArrayRef<OmpSsDependClauseKind> DepKinds, SourceLocation DepLoc,
1571
+ SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1572
+ SourceLocation StartLoc, SourceLocation LParenLoc,
1573
+ SourceLocation EndLoc) {
1574
+ return getSema().ActOnOmpSsDependClause(DepKinds, DepLoc, ColonLoc, VarList,
1575
+ StartLoc, LParenLoc, EndLoc);
1576
+ }
1577
+
1543
1578
/// Build a new OmpSs 'shared' clause.
1544
1579
///
1545
1580
/// By default, performs semantic analysis to build the new OmpSs clause.
@@ -1576,19 +1611,6 @@ class TreeTransform {
1576
1611
EndLoc);
1577
1612
}
1578
1613
1579
- /// Build a new OmpSs 'depend' pseudo clause.
1580
- ///
1581
- /// By default, performs semantic analysis to build the new OmpSs clause.
1582
- /// Subclasses may override this routine to provide different behavior.
1583
- OSSClause *
1584
- RebuildOSSDependClause(ArrayRef<OmpSsDependClauseKind> DepKinds, SourceLocation DepLoc,
1585
- SourceLocation ColonLoc, ArrayRef<Expr *> VarList,
1586
- SourceLocation StartLoc, SourceLocation LParenLoc,
1587
- SourceLocation EndLoc) {
1588
- return getSema().ActOnOmpSsDependClause(DepKinds, DepLoc, ColonLoc, VarList,
1589
- StartLoc, LParenLoc, EndLoc);
1590
- }
1591
-
1592
1614
/// Build a new OpenMP executable directive.
1593
1615
///
1594
1616
/// By default, performs semantic analysis to build the new statement.
@@ -9359,24 +9381,20 @@ TreeTransform<Derived>::TransformOSSLastprivateClause(OSSLastprivateClause *C) {
9359
9381
9360
9382
template <typename Derived>
9361
9383
OSSClause *TreeTransform<Derived>::TransformOSSIfClause(OSSIfClause *C) {
9362
- // ExprResult Cond = getDerived().TransformExpr(C->getCondition());
9363
- // if (Cond.isInvalid())
9364
- // return nullptr;
9365
- // return getDerived().RebuildOSSIfClause(Cond.get(), C->getBeginLoc(),
9366
- // C->getLParenLoc(), C->getEndLoc());
9367
- llvm_unreachable("unsupported yet");
9368
- return nullptr;
9384
+ ExprResult Cond = getDerived().TransformExpr(C->getCondition());
9385
+ if (Cond.isInvalid())
9386
+ return nullptr;
9387
+ return getDerived().RebuildOSSIfClause(Cond.get(), C->getBeginLoc(),
9388
+ C->getLParenLoc(), C->getEndLoc());
9369
9389
}
9370
9390
9371
9391
template <typename Derived>
9372
9392
OSSClause *TreeTransform<Derived>::TransformOSSFinalClause(OSSFinalClause *C) {
9373
- // ExprResult Cond = getDerived().TransformExpr(C->getCondition());
9374
- // if (Cond.isInvalid())
9375
- // return nullptr;
9376
- // return getDerived().RebuildOSSFinalClause(Cond.get(), C->getBeginLoc(),
9377
- // C->getLParenLoc(), C->getEndLoc());
9378
- llvm_unreachable("unsupported yet");
9379
- return nullptr;
9393
+ ExprResult Cond = getDerived().TransformExpr(C->getCondition());
9394
+ if (Cond.isInvalid())
9395
+ return nullptr;
9396
+ return getDerived().RebuildOSSFinalClause(Cond.get(), C->getBeginLoc(),
9397
+ C->getLParenLoc(), C->getEndLoc());
9380
9398
}
9381
9399
9382
9400
template <typename Derived>
@@ -9410,11 +9428,8 @@ TreeTransform<Derived>::TransformOSSCollapseClause(OSSCollapseClause *C) {
9410
9428
template <typename Derived>
9411
9429
OSSClause *
9412
9430
TreeTransform<Derived>::TransformOSSDefaultClause(OSSDefaultClause *C) {
9413
- // return getDerived().RebuildOSSDefaultClause(
9414
- // C->getDefaultKind(), C->getDefaultKindKwLoc(), C->getBeginLoc(),
9415
- // C->getLParenLoc(), C->getEndLoc());
9416
- llvm_unreachable("unsupported yet");
9417
- return nullptr;
9431
+ // No need to rebuild this clause, no template-dependent parameters.
9432
+ return C;
9418
9433
}
9419
9434
9420
9435
template <typename Derived>
0 commit comments