================
@@ -2290,8 +2290,26 @@ void
OMPClausePrinter::VisitOMPDeviceClause(OMPDeviceClause *Node) {
void OMPClausePrinter::VisitOMPNumTeamsClause(OMPNumTeamsClause *Node) {
if (!Node->varlist_empty()) {
- OS << "num_teams";
- VisitOMPClauseList(Node, '(');
+ OS << "num_teams(";
+ // Handle lower-bound:upper-bound syntax when there are exactly 2
+ // expressions
+ if (Node->varlist_size() == 2) {
+ auto *I = Node->varlist_begin();
+ (*I)->printPretty(OS, nullptr, Policy, 0);
+ OS << ":";
+ ++I;
+ (*I)->printPretty(OS, nullptr, Policy, 0);
+ } else {
+ // For single expression or other cases, use comma-separated list
+ bool First = true;
+ for (auto *I = Node->varlist_begin(), *E = Node->varlist_end(); I != E;
+ ++I) {
+ if (!First)
+ OS << ",";
+ First = false;
+ (*I)->printPretty(OS, nullptr, Policy, 0);
+ }
----------------
ykhatav wrote:
Applied,thanks!
https://github.com/llvm/llvm-project/pull/180608
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits