From b578f130a72f574f6ca5ae4fd5eda141bb5f4472 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 28 Mar 2020 21:38:50 +0100 Subject: [PATCH] [COFF] Stabilize sort Found by llvm::sort's expensive checks. --- lld/COFF/PDB.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp index 3754bd0..8ecfdca 100644 --- a/lld/COFF/PDB.cpp +++ b/lld/COFF/PDB.cpp @@ -1385,6 +1385,8 @@ void PDBLinker::printStats() { TypeIndex typeIndex; uint64_t totalInputSize() const { return uint64_t(dupCount) * typeSize; } bool operator<(const TypeSizeInfo &rhs) const { + if (totalInputSize() == rhs.totalInputSize()) + return typeIndex < rhs.typeIndex; return totalInputSize() < rhs.totalInputSize(); } }; -- 2.7.4