diff --git a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp index f800e56033101..1efe35a8b8f01 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyOptions.cpp @@ -16,7 +16,6 @@ #include "llvm/Support/MemoryBufferRef.h" #include "llvm/Support/Path.h" #include "llvm/Support/YAMLTraits.h" -#include #include #include @@ -86,21 +85,14 @@ template <> void yamlize(IO &IO, ClangTidyOptions::OptionMap &Options, bool, EmptyContext &Ctx) { if (IO.outputting()) { - // Ensure check options are sorted - std::vector> SortedOptions; - SortedOptions.reserve(Options.size()); - for (auto &Key : Options) { - SortedOptions.emplace_back(Key.getKey(), Key.getValue().Value); - } - std::sort(SortedOptions.begin(), SortedOptions.end()); - IO.beginMapping(); // Only output as a map - for (auto &Option : SortedOptions) { - bool UseDefault = false; - void *SaveInfo = nullptr; - IO.preflightKey(Option.first.data(), true, false, UseDefault, SaveInfo); - IO.scalarString(Option.second, needsQuotes(Option.second)); + for (auto &Key : Options) { + bool UseDefault; + void *SaveInfo; + IO.preflightKey(Key.getKey().data(), true, false, UseDefault, SaveInfo); + StringRef S = Key.getValue().Value; + IO.scalarString(S, needsQuotes(S)); IO.postflightKey(SaveInfo); } IO.endMapping(); diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index d8c55c17be3e2..4441473774b2c 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -111,8 +111,6 @@ Improvements to clang-tidy - Remove configuration option `AnalyzeTemporaryDestructors`, which was deprecated since :program:`clang-tidy` 16. -- Improved `--dump-config` to print check options in alphabetical order. - New checks ^^^^^^^^^^ diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp index ac71b1846a61e..6c42bd7f495f7 100644 --- a/clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp +++ b/clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp @@ -54,6 +54,3 @@ // RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD6 // CHECK-CHILD6: Checks: {{.*-llvm-qualified-auto'? *$}} // CHECK-CHILD6-NOT: modernize-use-using.IgnoreMacros - -// Validate that check options are printed in alphabetical order: -// RUN: clang-tidy --checks="-*,readability-identifier-*" --dump-config | grep readability-identifier-naming | sort --check