summaryrefslogtreecommitdiff
path: root/flang/examples
diff options
context:
space:
mode:
authorJosh Mottley <josh.mottley@arm.com>2021-10-20 07:56:56 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2021-10-20 07:57:04 +0000
commite9fe8ef4b0aa68be782a9139e08e9337ef79a462 (patch)
tree96283c7957a6f9d969ae4971bfd65e7feb6f59f3 /flang/examples
parent660c511e5b79d3724b8a139c8865c790d77b1f8f (diff)
downloadllvm-e9fe8ef4b0aa68be782a9139e08e9337ef79a462.tar.gz
[flang] flang-omp-report replace std::map with llvm::DenseMap
This patch replaces the uses of std::map with llvm::DenseMap in the flang-omp-report plugin. It also removed the 'constructClauseCount' map due to no longer being needed after the plugin was stripped down. This is a one of several patches focusing on switching containers from STL to LLVM's ADT library. Reviewed By: kiranchandramohan, clementval Differential Revision: https://reviews.llvm.org/D111977
Diffstat (limited to 'flang/examples')
-rw-r--r--flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp4
-rw-r--r--flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h5
2 files changed, 2 insertions, 7 deletions
diff --git a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp b/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
index ca56e83e88cf..f49e72fabee8 100644
--- a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
+++ b/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.cpp
@@ -252,14 +252,10 @@ void OpenMPCounterVisitor::PostClauseCommon(const ClauseInfo &ci) {
if (ci.clause == "nowait") {
assert(curLoopLogRecord &&
"loop Construct should be visited before a nowait clause");
- constructClauseCount[std::make_pair(
- curLoopLogRecord->construct, ci.clause)]++;
curLoopLogRecord->clauses.push_back(ci);
} else {
assert(!ompWrapperStack.empty() &&
"Construct should be visited before clause");
- constructClauseCount[std::make_pair(
- getName(*ompWrapperStack.back()), ci.clause)]++;
clauseStrings[ompWrapperStack.back()].push_back(ci);
}
}
diff --git a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h b/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h
index 4aeb7194a17a..188e8f9b61f9 100644
--- a/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h
+++ b/flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h
@@ -13,11 +13,11 @@
#include "flang/Parser/parse-tree.h"
#include "flang/Parser/parsing.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include <deque>
-#include <map>
#include <string>
namespace Fortran {
@@ -86,7 +86,6 @@ struct OpenMPCounterVisitor {
void Post(const DoConstruct &);
std::string clauseDetails{""};
- std::map<std::pair<std::string, std::string>, int> constructClauseCount;
// curLoopLogRecord and loopLogRecordStack store
// pointers to this datastructure's entries. Hence a
@@ -99,7 +98,7 @@ struct OpenMPCounterVisitor {
LogRecord *curLoopLogRecord{nullptr};
llvm::SmallVector<LogRecord *> loopLogRecordStack;
llvm::SmallVector<OmpWrapperType *> ompWrapperStack;
- std::map<OmpWrapperType *, llvm::SmallVector<ClauseInfo>> clauseStrings;
+ llvm::DenseMap<OmpWrapperType *, llvm::SmallVector<ClauseInfo>> clauseStrings;
Parsing *parsing{nullptr};
};
} // namespace parser