summaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/unparse-with-symbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Semantics/unparse-with-symbols.cpp')
-rw-r--r--flang/lib/Semantics/unparse-with-symbols.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/flang/lib/Semantics/unparse-with-symbols.cpp b/flang/lib/Semantics/unparse-with-symbols.cpp
index b19948113106..ec5b3ffadf30 100644
--- a/flang/lib/Semantics/unparse-with-symbols.cpp
+++ b/flang/lib/Semantics/unparse-with-symbols.cpp
@@ -37,6 +37,8 @@ public:
template <typename T> void Post(const parser::Statement<T> &) {
currStmt_ = std::nullopt;
}
+ void Post(const parser::Name &name);
+
bool Pre(const parser::AccClause &clause) {
currStmt_ = clause.source;
return true;
@@ -57,7 +59,6 @@ public:
return true;
}
void Post(const parser::OpenMPThreadprivate &) { currStmt_ = std::nullopt; }
- void Post(const parser::Name &name);
bool Pre(const parser::OpenMPDeclareMapperConstruct &x) {
currStmt_ = x.source;
@@ -67,6 +68,14 @@ public:
currStmt_ = std::nullopt;
}
+ bool Pre(const parser::OpenMPDeclareReductionConstruct &x) {
+ currStmt_ = x.source;
+ return true;
+ }
+ void Post(const parser::OpenMPDeclareReductionConstruct &) {
+ currStmt_ = std::nullopt;
+ }
+
bool Pre(const parser::OpenMPDeclareTargetConstruct &x) {
currStmt_ = x.source;
return true;
@@ -120,6 +129,7 @@ void SymbolDumpVisitor::Indent(llvm::raw_ostream &out, int indent) const {
void SymbolDumpVisitor::Post(const parser::Name &name) {
if (const auto *symbol{name.symbol}) {
if (!symbol->has<MiscDetails>()) {
+ CHECK(currStmt_.has_value());
symbols_.emplace(currStmt_.value().begin(), symbol);
}
}