Skip to content

Commit 0142671

Browse files
committed
Fix examples
1 parent 3594a0f commit 0142671

File tree

2 files changed

+7
-29
lines changed

2 files changed

+7
-29
lines changed

flang/examples/FeatureList/FeatureList.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,6 @@ struct NodeVisitor {
445445
READ_FEATURE(ObjectDecl)
446446
READ_FEATURE(OldParameterStmt)
447447
READ_FEATURE(OmpAlignedClause)
448-
READ_FEATURE(OmpAtomic)
449-
READ_FEATURE(OmpAtomicCapture)
450-
READ_FEATURE(OmpAtomicCapture::Stmt1)
451-
READ_FEATURE(OmpAtomicCapture::Stmt2)
452-
READ_FEATURE(OmpAtomicRead)
453-
READ_FEATURE(OmpAtomicUpdate)
454-
READ_FEATURE(OmpAtomicWrite)
455448
READ_FEATURE(OmpBeginBlockDirective)
456449
READ_FEATURE(OmpBeginLoopDirective)
457450
READ_FEATURE(OmpBeginSectionsDirective)
@@ -480,7 +473,6 @@ struct NodeVisitor {
480473
READ_FEATURE(OmpIterationOffset)
481474
READ_FEATURE(OmpIterationVector)
482475
READ_FEATURE(OmpEndAllocators)
483-
READ_FEATURE(OmpEndAtomic)
484476
READ_FEATURE(OmpEndBlockDirective)
485477
READ_FEATURE(OmpEndCriticalDirective)
486478
READ_FEATURE(OmpEndLoopDirective)
@@ -566,8 +558,6 @@ struct NodeVisitor {
566558
READ_FEATURE(OpenMPDeclareTargetConstruct)
567559
READ_FEATURE(OmpMemoryOrderType)
568560
READ_FEATURE(OmpMemoryOrderClause)
569-
READ_FEATURE(OmpAtomicClause)
570-
READ_FEATURE(OmpAtomicClauseList)
571561
READ_FEATURE(OmpAtomicDefaultMemOrderClause)
572562
READ_FEATURE(OpenMPFlushConstruct)
573563
READ_FEATURE(OpenMPLoopConstruct)

flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,19 @@ SourcePosition OpenMPCounterVisitor::getLocation(const OpenMPConstruct &c) {
7474
// the directive field.
7575
[&](const auto &c) -> SourcePosition {
7676
const CharBlock &source{std::get<0>(c.t).source};
77-
return (parsing->allCooked().GetSourcePositionRange(source))->first;
77+
return parsing->allCooked().GetSourcePositionRange(source)->first;
7878
},
7979
[&](const OpenMPAtomicConstruct &c) -> SourcePosition {
80-
return std::visit(
81-
[&](const auto &o) -> SourcePosition {
82-
const CharBlock &source{std::get<Verbatim>(o.t).source};
83-
return parsing->allCooked()
84-
.GetSourcePositionRange(source)
85-
->first;
86-
},
87-
c.u);
80+
const CharBlock &source{c.source};
81+
return parsing->allCooked().GetSourcePositionRange(source)->first;
8882
},
8983
[&](const OpenMPSectionConstruct &c) -> SourcePosition {
9084
const CharBlock &source{c.source};
91-
return (parsing->allCooked().GetSourcePositionRange(source))->first;
85+
return parsing->allCooked().GetSourcePositionRange(source)->first;
9286
},
9387
[&](const OpenMPUtilityConstruct &c) -> SourcePosition {
9488
const CharBlock &source{c.source};
95-
return (parsing->allCooked().GetSourcePositionRange(source))->first;
89+
return parsing->allCooked().GetSourcePositionRange(source)->first;
9690
},
9791
},
9892
c.u);
@@ -157,14 +151,8 @@ std::string OpenMPCounterVisitor::getName(const OpenMPConstruct &c) {
157151
return normalize_construct_name(source.ToString());
158152
},
159153
[&](const OpenMPAtomicConstruct &c) -> std::string {
160-
return std::visit(
161-
[&](const auto &c) {
162-
// Get source from the verbatim fields
163-
const CharBlock &source{std::get<Verbatim>(c.t).source};
164-
return "atomic-" +
165-
normalize_construct_name(source.ToString());
166-
},
167-
c.u);
154+
const CharBlock &source{c.source};
155+
return normalize_construct_name(source.ToString());
168156
},
169157
[&](const OpenMPUtilityConstruct &c) -> std::string {
170158
const CharBlock &source{c.source};

0 commit comments

Comments
 (0)