aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2022-01-25 15:48:51 -0500
committerserge-sans-paille <sguelton@redhat.com>2022-01-25 21:51:13 +0100
commit6427f4c52c31cc36004b14825e6598cd4a43f385 (patch)
tree15dcb78e396fbed6960bf9b08392e7f8fc912a26 /llvm/lib/Support/CommandLine.cpp
parent5b55e733a9c3ce471f28d10492f02de9cd213f54 (diff)
downloadllvm-6427f4c52c31cc36004b14825e6598cd4a43f385.zip
llvm-6427f4c52c31cc36004b14825e6598cd4a43f385.tar.gz
llvm-6427f4c52c31cc36004b14825e6598cd4a43f385.tar.bz2
[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index ed4f01f..e517ceb 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -45,7 +45,6 @@
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
-#include <map>
#include <string>
using namespace llvm;
using namespace cl;
@@ -2339,7 +2338,7 @@ public:
protected:
void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) override {
std::vector<OptionCategory *> SortedCategories;
- std::map<OptionCategory *, std::vector<Option *>> CategorizedOptions;
+ DenseMap<OptionCategory *, std::vector<Option *>> CategorizedOptions;
// Collect registered option categories into vector in preparation for
// sorting.
@@ -2351,10 +2350,6 @@ protected:
array_pod_sort(SortedCategories.begin(), SortedCategories.end(),
OptionCategoryCompare);
- // Create map to empty vectors.
- for (OptionCategory *Category : SortedCategories)
- CategorizedOptions[Category] = std::vector<Option *>();
-
// Walk through pre-sorted options and assign into categories.
// Because the options are already alphabetically sorted the
// options within categories will also be alphabetically sorted.