Skip to content

Commit d1a7630

Browse files
committed
[JITLink] Fix symbol comparator in LinkGraph::dump.
The existing implementation did not provide a strict weak ordering.
1 parent dd5c520 commit d1a7630

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/ExecutionEngine/JITLink/JITLink.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ void LinkGraph::dump(raw_ostream &OS) {
237237
// relevance.
238238
for (auto &KV : BlockSymbols)
239239
llvm::sort(KV.second, [](const Symbol *LHS, const Symbol *RHS) {
240-
if (LHS->getOffset() < RHS->getOffset())
241-
return true;
242-
if (LHS->getLinkage() < RHS->getLinkage())
243-
return true;
244-
if (LHS->getScope() < RHS->getScope())
245-
return true;
240+
if (LHS->getOffset() != RHS->getOffset())
241+
return LHS->getOffset() < RHS->getOffset();
242+
if (LHS->getLinkage() != RHS->getLinkage())
243+
return LHS->getLinkage() < RHS->getLinkage();
244+
if (LHS->getScope() != RHS->getScope())
245+
return LHS->getScope() < RHS->getScope();
246246
if (LHS->hasName()) {
247247
if (!RHS->hasName())
248248
return true;

0 commit comments

Comments
 (0)