File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,33 @@ class SymbolDumpVisitor {
7070 currStmt_ = std::nullopt ;
7171 }
7272
73+ bool Pre (const parser::OmpCriticalDirective &x) {
74+ currStmt_ = x.source ;
75+ return true ;
76+ }
77+ void Post (const parser::OmpCriticalDirective &) { currStmt_ = std::nullopt ; }
78+
79+ bool Pre (const parser::OmpEndCriticalDirective &x) {
80+ currStmt_ = x.source ;
81+ return true ;
82+ }
83+ void Post (const parser::OmpEndCriticalDirective &) {
84+ currStmt_ = std::nullopt ;
85+ }
86+
87+ // Directive arguments can be objects with symbols.
88+ bool Pre (const parser::OmpBeginDirective &x) {
89+ currStmt_ = x.source ;
90+ return true ;
91+ }
92+ void Post (const parser::OmpBeginDirective &) { currStmt_ = std::nullopt ; }
93+
94+ bool Pre (const parser::OmpEndDirective &x) {
95+ currStmt_ = x.source ;
96+ return true ;
97+ }
98+ void Post (const parser::OmpEndDirective &) { currStmt_ = std::nullopt ; }
99+
73100private:
74101 std::optional<SourceName> currStmt_; // current statement we are processing
75102 std::multimap<const char *, const Symbol *> symbols_; // location to symbol
Original file line number Diff line number Diff line change 1+ ! RUN: %flang_fc1 -fdebug-unparse-with-symbols -fopenmp -fopenmp-version=50 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s
2+
3+ subroutine f
4+ implicit none
5+ integer :: x
6+ ! $omp critical(c)
7+ x = 0
8+ ! $omp end critical(c)
9+ end
10+
11+ ! UNPARSE: !DEF: /f (Subroutine) Subprogram
12+ ! UNPARSE: subroutine f
13+ ! UNPARSE: implicit none
14+ ! UNPARSE: !DEF: /f/x ObjectEntity INTEGER(4)
15+ ! UNPARSE: integer x
16+ ! UNPARSE: !$omp critical (c)
17+ ! UNPARSE: !REF: /f/x
18+ ! UNPARSE: x = 0
19+ ! UNPARSE: !$omp end critical (c)
20+ ! UNPARSE: end subroutine
21+
You can’t perform that action at this time.
0 commit comments