From: Cyndy Ishida Date: Wed, 9 Jun 2021 20:45:13 +0000 (-0700) Subject: Revert "[llvm-tapi-diff] Apply stable sorting to output" X-Git-Tag: llvmorg-14-init~4401 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1899cb7d0eae74cc700d44e1f220a7ce41395ce0;p=platform%2Fupstream%2Fllvm.git Revert "[llvm-tapi-diff] Apply stable sorting to output" This reverts commit 90a26a41e9ce16a4d471d25c2f7b36b5538fb4ce. This failed to fix ubuntu failures. --- diff --git a/llvm/tools/llvm-tapi-diff/DiffEngine.cpp b/llvm/tools/llvm-tapi-diff/DiffEngine.cpp index 837ddb42bb25..bc9ee626d8fc 100644 --- a/llvm/tools/llvm-tapi-diff/DiffEngine.cpp +++ b/llvm/tools/llvm-tapi-diff/DiffEngine.cpp @@ -439,15 +439,6 @@ T *castValues(const std::unique_ptr &RawAttr) { return CastAttr; } -template void sortTargetValues(std::vector &TargValues) { - llvm::sort(TargValues, [](const auto &ValA, const auto &ValB) { - return ValA.getOrder() < ValB.getOrder(); - }); - llvm::sort(TargValues, [](const auto &ValA, const auto &ValB) { - return ValA.getOrder() == ValB.getOrder() && ValA.getVal() < ValB.getVal(); - }); -} - template void printVecVal(std::string Indent, const DiffOutput &Attr, raw_ostream &OS) { if (Attr.Values.empty()) @@ -464,8 +455,10 @@ void printVecVal(std::string Indent, const DiffOutput &Attr, raw_ostream &OS) { }); for (auto *Vec : SortedAttrs) { - sortTargetValues>( - Vec->TargValues); + llvm::sort(Vec->TargValues, [](const auto &ValA, const auto &ValB) { + return ValA.getOrder() == ValB.getOrder() && + ValA.getVal() < ValB.getVal(); + }); OS << Indent << "\t" << getTargetTripleName(Vec->Targ) << "\n"; for (auto &Item : Vec->TargValues) Item.print(OS, Indent); @@ -489,7 +482,10 @@ void printVecVal(std::string Indent, const DiffOutput &Attr, return ValA->Targ < ValB->Targ; }); for (auto *SymVec : SortedAttrs) { - sortTargetValues(SymVec->TargValues); + llvm::sort(SymVec->TargValues, [](const auto &ValA, const auto &ValB) { + return ValA.getOrder() == ValB.getOrder() && + ValA.getVal() < ValB.getVal(); + }); OS << Indent << "\t" << getTargetTripleName(SymVec->Targ) << "\n"; for (auto &Item : SymVec->TargValues) Item.print(OS, Indent, SymVec->Targ);