summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-08-16 02:41:23 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-08-16 02:41:23 +0000
commit5196275eeab605a62060ed07c66bb6d49a767a62 (patch)
tree8d89f778856e09dda42dab491f443ec32eb68aa3 /llvm/lib/Transforms
parentdfb655fe1730e62a51b4cfb24e7511393083e4d3 (diff)
downloadbcm5719-llvm-5196275eeab605a62060ed07c66bb6d49a767a62.tar.gz
bcm5719-llvm-5196275eeab605a62060ed07c66bb6d49a767a62.zip
MergeFunc: Quick fix for r245140, Ignore second, aka Function*, in sorting.
Don't assume second would be ordered in the module. llvm-svn: 245168
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index 1c9d2170f92..67d6b7fcb67 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -1316,7 +1316,12 @@ bool MergeFunctions::runOnModule(Module &M) {
}
}
- 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) {
OpenPOWER on IntegriCloud