diff --git a/llvm/tools/llvm-readtapi/DiffEngine.cpp b/llvm/tools/llvm-readtapi/DiffEngine.cpp --- a/llvm/tools/llvm-readtapi/DiffEngine.cpp +++ b/llvm/tools/llvm-readtapi/DiffEngine.cpp @@ -447,11 +447,11 @@ template void sortTargetValues(std::vector &TargValues) { llvm::stable_sort(TargValues, [](const auto &ValA, const auto &ValB) { + if (ValA.getOrder() == ValB.getOrder()) { + return ValA.getVal() < ValB.getVal(); + } return ValA.getOrder() < ValB.getOrder(); }); - llvm::stable_sort(TargValues, [](const auto &ValA, const auto &ValB) { - return ValA.getOrder() == ValB.getOrder() && ValA.getVal() < ValB.getVal(); - }); } template