aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-23 14:51:27 +0000
committerFangrui Song <maskray@google.com>2019-04-23 14:51:27 +0000
commitefd94c56badf696ed7193f4a83c7a59f7dfbfc6e (patch)
tree63f7a8a57c367cf6ba845a80eda9177b62c516be /llvm/lib/CodeGen/MachineOutliner.cpp
parent99cf58339fceadee43ba3fdbf962a083cd5af6c4 (diff)
downloadllvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.zip
llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.tar.gz
llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.tar.bz2
Use llvm::stable_sort
While touching the code, simplify if feasible. llvm-svn: 358996
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 7b1750a..0f3ed8a 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1198,11 +1198,10 @@ bool MachineOutliner::outline(Module &M,
unsigned OutlinedFunctionNum = 0;
// Sort by benefit. The most beneficial functions should be outlined first.
- std::stable_sort(
- FunctionList.begin(), FunctionList.end(),
- [](const OutlinedFunction &LHS, const OutlinedFunction &RHS) {
- return LHS.getBenefit() > RHS.getBenefit();
- });
+ llvm::stable_sort(FunctionList, [](const OutlinedFunction &LHS,
+ const OutlinedFunction &RHS) {
+ return LHS.getBenefit() > RHS.getBenefit();
+ });
// Walk over each function, outlining them as we go along. Functions are
// outlined greedily, based off the sort above.