summaryrefslogtreecommitdiff
path: root/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp')
-rw-r--r--flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
index 665b92be0089..c78dd7f14e50 100644
--- a/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
+++ b/flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
@@ -90,6 +90,10 @@ SourcePosition OpenMPCounterVisitor::getLocation(const OpenMPConstruct &c) {
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);
}
@@ -102,10 +106,16 @@ std::string OpenMPCounterVisitor::getName(const OmpWrapperType &w) {
return getName(*std::get<const OpenMPDeclarativeConstruct *>(w));
}
std::string OpenMPCounterVisitor::getName(const OpenMPDeclarativeConstruct &c) {
- return std::visit(
- [&](const auto &o) -> std::string {
- const CharBlock &source{std::get<Verbatim>(o.t).source};
- return normalize_construct_name(source.ToString());
+ return std::visit( //
+ Fortran::common::visitors{
+ [&](const OpenMPUtilityConstruct &o) -> std::string {
+ const CharBlock &source{o.source};
+ return normalize_construct_name(source.ToString());
+ },
+ [&](const auto &o) -> std::string {
+ const CharBlock &source{std::get<Verbatim>(o.t).source};
+ return normalize_construct_name(source.ToString());
+ },
},
c.u);
}
@@ -143,8 +153,8 @@ std::string OpenMPCounterVisitor::getName(const OpenMPConstruct &c) {
},
c.u);
},
- [&](const OpenMPErrorConstruct &c) -> std::string {
- const CharBlock &source{std::get<0>(c.t).source};
+ [&](const OpenMPUtilityConstruct &c) -> std::string {
+ const CharBlock &source{c.source};
return normalize_construct_name(source.ToString());
},
[&](const OpenMPSectionConstruct &c) -> std::string {