Don't assume second would be ordered in the module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245168
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
- std::sort(HashedFuncs.begin(), HashedFuncs.end());
+ std::stable_sort(
+ HashedFuncs.begin(), HashedFuncs.end(),
+ [](const std::pair<FunctionComparator::FunctionHash, Function *> &a,
+ const std::pair<FunctionComparator::FunctionHash, Function *> &b) {
+ return a.first < b.first;
+ });
auto S = HashedFuncs.begin();
for (auto I = HashedFuncs.begin(), IE = HashedFuncs.end(); I != IE; ++I) {