[JITLink] Fix symbol comparator in LinkGraph::dump.

The existing implementation did not provide a strict weak ordering.
This commit is contained in:
Lang Hames 2021-05-16 10:09:35 -07:00
parent dd5c52029d
commit d1a7630369
1 changed files with 6 additions and 6 deletions

View File

@ -237,12 +237,12 @@ void LinkGraph::dump(raw_ostream &OS) {
// relevance.
for (auto &KV : BlockSymbols)
llvm::sort(KV.second, [](const Symbol *LHS, const Symbol *RHS) {
if (LHS->getOffset() < RHS->getOffset())
return true;
if (LHS->getLinkage() < RHS->getLinkage())
return true;
if (LHS->getScope() < RHS->getScope())
return true;
if (LHS->getOffset() != RHS->getOffset())
return LHS->getOffset() < RHS->getOffset();
if (LHS->getLinkage() != RHS->getLinkage())
return LHS->getLinkage() < RHS->getLinkage();
if (LHS->getScope() != RHS->getScope())
return LHS->getScope() < RHS->getScope();
if (LHS->hasName()) {
if (!RHS->hasName())
return true;