Skip to content

Commit 2991c39

Browse files
committed
[flang][openacc] Fix unparsing of bind clause on acc routine
unparsing for the bind clause was adding extra parenthesis. This patch fixes that. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D158210
1 parent b26f83c commit 2991c39

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

flang/lib/Parser/unparse.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,10 +1890,8 @@ class UnparseVisitor {
18901890
}
18911891
void Unparse(const AccBindClause &x) {
18921892
common::visit(common::visitors{
1893-
[&](const Name &y) { Put('('), Walk(y), Put(')'); },
1894-
[&](const ScalarDefaultCharExpr &y) {
1895-
Put('('), Walk(y), Put(')');
1896-
},
1893+
[&](const Name &y) { Walk(y); },
1894+
[&](const ScalarDefaultCharExpr &y) { Walk(y); },
18971895
},
18981896
x.u);
18991897
}

flang/test/Parser/acc-unparse.f90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@ subroutine acc_loop()
7676
! CHECK: !$ACC LOOP GANG(STATIC:gangstatic,DIM:gangdim)
7777

7878
end subroutine
79+
80+
subroutine routine1()
81+
!$acc routine bind("routine1_")
82+
! CHECK: !$ACC ROUTINE BIND("routine1_")
83+
end subroutine
84+
85+
subroutine routine2()
86+
!$acc routine(routine2) bind(routine2)
87+
! CHECK: !$ACC ROUTINE(routine2) BIND(routine2)
88+
end subroutine

0 commit comments

Comments
 (0)