Differential D111977 Diff 380868 flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
Changeset View
Changeset View
Standalone View
Standalone View
flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | void OpenMPCounterVisitor::PostClauseCommon(const ClauseInfo &ci) { | ||||
// the OpenMP construct for the loop construct. So the end loop is left | // the OpenMP construct for the loop construct. So the end loop is left | ||||
// hanging as a separate executable construct. If a nowait clause is seen in | // hanging as a separate executable construct. If a nowait clause is seen in | ||||
// an end loop construct we have to find the associated loop construct and | // an end loop construct we have to find the associated loop construct and | ||||
// add nowait to its list of clauses. Note: This is not a bug in flang, the | // add nowait to its list of clauses. Note: This is not a bug in flang, the | ||||
// parse tree is corrected during semantic analysis. | // parse tree is corrected during semantic analysis. | ||||
if (ci.clause == "nowait") { | if (ci.clause == "nowait") { | ||||
assert(curLoopLogRecord && | assert(curLoopLogRecord && | ||||
"loop Construct should be visited before a nowait clause"); | "loop Construct should be visited before a nowait clause"); | ||||
constructClauseCount[std::make_pair( | |||||
curLoopLogRecord->construct, ci.clause)]++; | |||||
curLoopLogRecord->clauses.push_back(ci); | curLoopLogRecord->clauses.push_back(ci); | ||||
} else { | } else { | ||||
assert(!ompWrapperStack.empty() && | assert(!ompWrapperStack.empty() && | ||||
"Construct should be visited before clause"); | "Construct should be visited before clause"); | ||||
constructClauseCount[std::make_pair( | |||||
getName(*ompWrapperStack.back()), ci.clause)]++; | |||||
clauseStrings[ompWrapperStack.back()].push_back(ci); | clauseStrings[ompWrapperStack.back()].push_back(ci); | ||||
} | } | ||||
} | } | ||||
void OpenMPCounterVisitor::Post(const DoConstruct &) { | void OpenMPCounterVisitor::Post(const DoConstruct &) { | ||||
curLoopLogRecord = loopLogRecordStack.back(); | curLoopLogRecord = loopLogRecordStack.back(); | ||||
loopLogRecordStack.pop_back(); | loopLogRecordStack.pop_back(); | ||||
} | } | ||||
} // namespace parser | } // namespace parser | ||||
} // namespace Fortran | } // namespace Fortran |