forked from OSchip/llvm-project
Revert "[NFC] Use an llvm::DenseMap instead of std::map in CategorizedHelpPrinter::printOptions"
This reverts commit 6427f4c52c
.
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
This commit is contained in:
parent
1c82fdb3d1
commit
a676bdb5d6
|
@ -45,6 +45,7 @@
|
||||||
#include "llvm/Support/VirtualFileSystem.h"
|
#include "llvm/Support/VirtualFileSystem.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace cl;
|
using namespace cl;
|
||||||
|
@ -2338,7 +2339,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) override {
|
void printOptions(StrOptionPairVector &Opts, size_t MaxArgLen) override {
|
||||||
std::vector<OptionCategory *> SortedCategories;
|
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
|
// Collect registered option categories into vector in preparation for
|
||||||
// sorting.
|
// sorting.
|
||||||
|
@ -2350,6 +2351,10 @@ protected:
|
||||||
array_pod_sort(SortedCategories.begin(), SortedCategories.end(),
|
array_pod_sort(SortedCategories.begin(), SortedCategories.end(),
|
||||||
OptionCategoryCompare);
|
OptionCategoryCompare);
|
||||||
|
|
||||||
|
// Create map to empty vectors.
|
||||||
|
for (OptionCategory *Category : SortedCategories)
|
||||||
|
CategorizedOptions[Category] = std::vector<Option *>();
|
||||||
|
|
||||||
// Walk through pre-sorted options and assign into categories.
|
// Walk through pre-sorted options and assign into categories.
|
||||||
// Because the options are already alphabetically sorted the
|
// Because the options are already alphabetically sorted the
|
||||||
// options within categories will also be alphabetically sorted.
|
// options within categories will also be alphabetically sorted.
|
||||||
|
|
Loading…
Reference in New Issue