Skip to content

Commit

Permalink
Sort classes by primary function name to produce stable result
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Jan 8, 2022
1 parent baf0333 commit 6453e48
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/passes/MergeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ struct MergeFunctions : public Pass {
Stats stats;
std::vector<EquivalentClass> classes;
collectEquivalentClasses(classes, module);
std::sort(
classes.begin(), classes.end(), [](const auto& left, const auto& right) {
return left.primaryFunction->name < right.primaryFunction->name;
});
for (auto& clazz : classes) {
if (!clazz.isEligibleToMerge()) {
continue;
Expand Down

0 comments on commit 6453e48

Please sign in to comment.