diff options
author | serge-sans-paille <sguelton@redhat.com> | 2022-01-25 22:25:57 +0100 |
---|---|---|
committer | serge-sans-paille <sguelton@redhat.com> | 2022-01-25 22:27:26 +0100 |
commit | d65a3b3265d058ce1f0ac82fa4d0826bf1b2bbaf (patch) | |
tree | 8aaccfa51dd61abdc5f4210adaf70650acc39966 /llvm/lib/Support/CommandLine.cpp | |
parent | f5f377d1fca8ecb4ec5bd2bca656e7c719727404 (diff) | |
download | llvm-d65a3b3265d058ce1f0ac82fa4d0826bf1b2bbaf.zip llvm-d65a3b3265d058ce1f0ac82fa4d0826bf1b2bbaf.tar.gz llvm-d65a3b3265d058ce1f0ac82fa4d0826bf1b2bbaf.tar.bz2 |
Fix build issue in assert mode introduced by 6427f4c52c31cc36004
After 6427f4c52c31cc36004, one should use SortedCategories to check category
validity.
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index e517ceb..c61e3c0 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -2356,7 +2356,9 @@ protected: for (size_t I = 0, E = Opts.size(); I != E; ++I) { Option *Opt = Opts[I].second; for (auto &Cat : Opt->Categories) { - assert(CategorizedOptions.count(Cat) > 0 && + assert(std::binary_search(SortedCategories.begin(), + SortedCategories.end(), Cat, + OptionCategoryCompare) && "Option has an unregistered category"); CategorizedOptions[Cat].push_back(Opt); } |