aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-01-25 16:36:38 -0500
committerNico Weber <thakis@chromium.org>2022-01-25 16:36:38 -0500
commita676bdb5d65bd827a17e82c8b7b89e93cc692501 (patch)
tree27a1740ab6732fd18b920cbe27ac76a1c6398ef0 /llvm/lib/Support/CommandLine.cpp
parent1c82fdb3d174b00ceab49e1f6e355c228f45048f (diff)
downloadllvm-a676bdb5d65bd827a17e82c8b7b89e93cc692501.zip
llvm-a676bdb5d65bd827a17e82c8b7b89e93cc692501.tar.gz
llvm-a676bdb5d65bd827a17e82c8b7b89e93cc692501.tar.bz2
Revert "[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions"
This reverts commit 6427f4c52c31cc36004b14825e6598cd4a43f385. Breaks a bunch of tests, see e.g. http://45.33.8.238/linux/66340/step_7.txt or https://lab.llvm.org/buildbot/#/builders/139/builds/16807
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index e517ceb..ed4f01f 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -45,6 +45,7 @@
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
+#include <map>
#include <string>
using namespace llvm;
using namespace cl;
@@ -2338,7 +2339,7 @@ public:
protected:
void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) override {
std::vector<OptionCategory *> SortedCategories;
- DenseMap<OptionCategory *, std::vector<Option *>> CategorizedOptions;
+ std::map<OptionCategory *, std::vector<Option *>> CategorizedOptions;
// Collect registered option categories into vector in preparation for
// sorting.
@@ -2350,6 +2351,10 @@ 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.