[Flang] flang-omp-report replace std::vector's with llvm::SmallVector
authorJosh Mottley <josh.mottley@arm.com>
Wed, 13 Oct 2021 18:19:33 +0000 (19:19 +0100)
committerMats Petersson <mats.petersson@arm.com>
Thu, 14 Oct 2021 10:05:24 +0000 (11:05 +0100)
This patch replaces all uses of std::vector with llvm::SmallVector in the flang-omp-report plugin.
This is a one of several patches focusing on switching containers from STL to LLVM's ADT library.

Reviewed By: Leporacanthicus

Differential Revision: https://reviews.llvm.org/D111709

flang/examples/flang-omp-report-plugin/flang-omp-report-visitor.h

index 90d480407d28b63dd5e26da3ce0635530cce34af..034f20f7ca563ed45d839a1952c988ef551e33f3 100644 (file)
 #include "flang/Parser/parse-tree.h"
 #include "flang/Parser/parsing.h"
 
+#include "llvm/ADT/SmallVector.h"
+
 #include <deque>
 #include <map>
 #include <string>
-#include <vector>
 
 namespace Fortran {
 namespace parser {
@@ -37,7 +38,7 @@ struct LogRecord {
   std::string file;
   int line;
   std::string construct;
-  std::vector<ClauseInfo> clauses;
+  llvm::SmallVector<ClauseInfo> clauses;
 };
 bool operator==(const LogRecord &a, const LogRecord &b);
 bool operator!=(const LogRecord &a, const LogRecord &b);
@@ -95,9 +96,9 @@ struct OpenMPCounterVisitor {
   std::deque<LogRecord> constructClauses;
 
   LogRecord *curLoopLogRecord{nullptr};
-  std::vector<LogRecord *> loopLogRecordStack;
-  std::vector<OmpWrapperType *> ompWrapperStack;
-  std::map<OmpWrapperType *, std::vector<ClauseInfo>> clauseStrings;
+  llvm::SmallVector<LogRecord *> loopLogRecordStack;
+  llvm::SmallVector<OmpWrapperType *> ompWrapperStack;
+  std::map<OmpWrapperType *, llvm::SmallVector<ClauseInfo>> clauseStrings;
   Parsing *parsing{nullptr};
 };
 } // namespace parser