@@ -37,6 +37,8 @@ class SymbolDumpVisitor {
3737 template <typename T> void Post (const parser::Statement<T> &) {
3838 currStmt_ = std::nullopt ;
3939 }
40+ void Post (const parser::Name &name);
41+
4042 bool Pre (const parser::AccClause &clause) {
4143 currStmt_ = clause.source ;
4244 return true ;
@@ -57,7 +59,6 @@ class SymbolDumpVisitor {
5759 return true ;
5860 }
5961 void Post (const parser::OpenMPThreadprivate &) { currStmt_ = std::nullopt ; }
60- void Post (const parser::Name &name);
6162
6263 bool Pre (const parser::OpenMPDeclareMapperConstruct &x) {
6364 currStmt_ = x.source ;
@@ -67,6 +68,14 @@ class SymbolDumpVisitor {
6768 currStmt_ = std::nullopt ;
6869 }
6970
71+ bool Pre (const parser::OpenMPDeclareReductionConstruct &x) {
72+ currStmt_ = x.source ;
73+ return true ;
74+ }
75+ void Post (const parser::OpenMPDeclareReductionConstruct &) {
76+ currStmt_ = std::nullopt ;
77+ }
78+
7079 bool Pre (const parser::OpenMPDeclareTargetConstruct &x) {
7180 currStmt_ = x.source ;
7281 return true ;
@@ -120,6 +129,7 @@ void SymbolDumpVisitor::Indent(llvm::raw_ostream &out, int indent) const {
120129void SymbolDumpVisitor::Post (const parser::Name &name) {
121130 if (const auto *symbol{name.symbol }) {
122131 if (!symbol->has <MiscDetails>()) {
132+ CHECK (currStmt_.has_value ());
123133 symbols_.emplace (currStmt_.value ().begin (), symbol);
124134 }
125135 }
0 commit comments