summaryrefslogtreecommitdiff
path: root/flang/examples
diff options
context:
space:
mode:
Diffstat (limited to 'flang/examples')
-rw-r--r--flang/examples/FeatureList/FeatureList.cpp4
-rw-r--r--flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp29
2 files changed, 4 insertions, 29 deletions
diff --git a/flang/examples/FeatureList/FeatureList.cpp b/flang/examples/FeatureList/FeatureList.cpp
index b686430e7f58..8d370adc51d6 100644
--- a/flang/examples/FeatureList/FeatureList.cpp
+++ b/flang/examples/FeatureList/FeatureList.cpp
@@ -448,9 +448,9 @@ public:
READ_FEATURE(OmpBeginDirective)
READ_FEATURE(OmpBeginLoopDirective)
READ_FEATURE(OmpBeginSectionsDirective)
+ READ_FEATURE(OmpBlockConstruct)
READ_FEATURE(OmpClause)
READ_FEATURE(OmpClauseList)
- READ_FEATURE(OmpCriticalDirective)
READ_FEATURE(OmpDeclareTargetSpecifier)
READ_FEATURE(OmpDeclareTargetWithClause)
READ_FEATURE(OmpDeclareTargetWithList)
@@ -472,7 +472,6 @@ public:
READ_FEATURE(OmpIterationOffset)
READ_FEATURE(OmpIterationVector)
READ_FEATURE(OmpEndDirective)
- READ_FEATURE(OmpEndCriticalDirective)
READ_FEATURE(OmpEndLoopDirective)
READ_FEATURE(OmpEndSectionsDirective)
READ_FEATURE(OmpGrainsizeClause)
@@ -543,7 +542,6 @@ public:
READ_FEATURE(OpenACCStandaloneConstruct)
READ_FEATURE(OpenACCWaitConstruct)
READ_FEATURE(OpenMPAtomicConstruct)
- READ_FEATURE(OpenMPBlockConstruct)
READ_FEATURE(OpenMPCancelConstruct)
READ_FEATURE(OpenMPCancellationPointConstruct)
READ_FEATURE(OpenMPConstruct)
diff --git a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
index cc058bf28329..ab2e8fd8df58 100644
--- a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
+++ b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
@@ -65,32 +65,9 @@ SourcePosition OpenMPCounterVisitor::getLocation(
c.u);
}
SourcePosition OpenMPCounterVisitor::getLocation(const OpenMPConstruct &c) {
- return std::visit(
- Fortran::common::visitors{
- [&](const OpenMPStandaloneConstruct &c) -> SourcePosition {
- return parsing->allCooked().GetSourcePositionRange(c.source)->first;
- },
- // OpenMPSectionsConstruct, OpenMPLoopConstruct,
- // OpenMPBlockConstruct, OpenMPCriticalConstruct Get the source from
- // the directive field.
- [&](const auto &c) -> SourcePosition {
- const CharBlock &source{std::get<0>(c.t).source};
- return parsing->allCooked().GetSourcePositionRange(source)->first;
- },
- [&](const OpenMPAtomicConstruct &c) -> SourcePosition {
- const CharBlock &source{c.source};
- return parsing->allCooked().GetSourcePositionRange(source)->first;
- },
- [&](const OpenMPSectionConstruct &c) -> SourcePosition {
- const CharBlock &source{c.source};
- return parsing->allCooked().GetSourcePositionRange(source)->first;
- },
- [&](const OpenMPUtilityConstruct &c) -> SourcePosition {
- const CharBlock &source{c.source};
- return parsing->allCooked().GetSourcePositionRange(source)->first;
- },
- },
- c.u);
+ return parsing->allCooked()
+ .GetSourcePositionRange(omp::GetOmpDirectiveName(c).source)
+ ->first;
}
std::string OpenMPCounterVisitor::getName(const OmpWrapperType &w) {