Skip to content

Commit c158867

Browse files
committed
Fix example
1 parent 0142671 commit c158867

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ std::string OpenMPCounterVisitor::getName(const OpenMPConstruct &c) {
151151
return normalize_construct_name(source.ToString());
152152
},
153153
[&](const OpenMPAtomicConstruct &c) -> std::string {
154-
const CharBlock &source{c.source};
155-
return normalize_construct_name(source.ToString());
154+
auto &dirSpec = std::get<OmpDirectiveSpecification>(c.t);
155+
auto &dirName = std::get<OmpDirectiveName>(dirSpec.t);
156+
return normalize_construct_name(dirName.source.ToString());
156157
},
157158
[&](const OpenMPUtilityConstruct &c) -> std::string {
158159
const CharBlock &source{c.source};

flang/test/Examples/omp-atomic.f90

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,31 @@
2626
! CHECK:---
2727
! CHECK-NEXT:- file: '{{[^"]*}}omp-atomic.f90'
2828
! CHECK-NEXT: line: 9
29-
! CHECK-NEXT: construct: atomic-read
29+
! CHECK-NEXT: construct: atomic
3030
! CHECK-NEXT: clauses:
31-
! CHECK-NEXT: - clause: seq_cst
31+
! CHECK-NEXT: - clause: read
3232
! CHECK-NEXT: details: ''
33+
! CHECK-NEXT: - clause: seq_cst
34+
! CHECK-NEXT: details: 'name_modifier=atomic;'
3335
! CHECK-NEXT:- file: '{{[^"]*}}omp-atomic.f90'
3436
! CHECK-NEXT: line: 12
35-
! CHECK-NEXT: construct: atomic-write
37+
! CHECK-NEXT: construct: atomic
3638
! CHECK-NEXT: clauses:
3739
! CHECK-NEXT: - clause: seq_cst
40+
! CHECK-NEXT: details: 'name_modifier=atomic;'
41+
! CHECK-NEXT: - clause: write
3842
! CHECK-NEXT: details: ''
3943
! CHECK-NEXT:- file: '{{[^"]*}}omp-atomic.f90'
4044
! CHECK-NEXT: line: 16
41-
! CHECK-NEXT: construct: atomic-capture
45+
! CHECK-NEXT: construct: atomic
4246
! CHECK-NEXT: clauses:
47+
! CHECK-NEXT: - clause: capture
48+
! CHECK-NEXT: details: 'name_modifier=atomic;name_modifier=atomic;'
4349
! CHECK-NEXT: - clause: seq_cst
4450
! CHECK-NEXT: details: ''
4551
! CHECK-NEXT:- file: '{{[^"]*}}omp-atomic.f90'
4652
! CHECK-NEXT: line: 21
47-
! CHECK-NEXT: construct: atomic-atomic
53+
! CHECK-NEXT: construct: atomic
4854
! CHECK-NEXT: clauses: []
4955
! CHECK-NEXT:- file: '{{[^"]*}}omp-atomic.f90'
5056
! CHECK-NEXT: line: 8

0 commit comments

Comments
 (0)