diff options
author | Fangrui Song <maskray@google.com> | 2019-04-23 14:51:27 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-23 14:51:27 +0000 |
commit | efd94c56badf696ed7193f4a83c7a59f7dfbfc6e (patch) | |
tree | 63f7a8a57c367cf6ba845a80eda9177b62c516be /llvm/lib/MC | |
parent | 99cf58339fceadee43ba3fdbf962a083cd5af6c4 (diff) | |
download | bcm5719-llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.tar.gz bcm5719-llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.zip |
Use llvm::stable_sort
While touching the code, simplify if feasible.
llvm-svn: 358996
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/MC/WasmObjectWriter.cpp | 5 |
2 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index e8edf6ba1d4..aae6fdf9093 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -1865,11 +1865,10 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB, // but the Android libunwindstack rejects eh_frame sections where // an FDE refers to a CIE other than the closest previous CIE. std::vector<MCDwarfFrameInfo> FrameArrayX(FrameArray.begin(), FrameArray.end()); - std::stable_sort( - FrameArrayX.begin(), FrameArrayX.end(), - [&](const MCDwarfFrameInfo &X, const MCDwarfFrameInfo &Y) -> bool { - return CIEKey(X) < CIEKey(Y); - }); + llvm::stable_sort(FrameArrayX, + [](const MCDwarfFrameInfo &X, const MCDwarfFrameInfo &Y) { + return CIEKey(X) < CIEKey(Y); + }); for (auto I = FrameArrayX.begin(), E = FrameArrayX.end(); I != E;) { const MCDwarfFrameInfo &Frame = *I; ++I; diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index 2994772c519..dab5bb329bc 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -934,9 +934,8 @@ void WasmObjectWriter::writeRelocSection( // order, but for the code section we combine many MC sections into single // wasm section, and this order is determined by the order of Asm.Symbols() // not the sections order. - std::stable_sort( - Relocs.begin(), Relocs.end(), - [](const WasmRelocationEntry &A, const WasmRelocationEntry &B) { + llvm::stable_sort( + Relocs, [](const WasmRelocationEntry &A, const WasmRelocationEntry &B) { return (A.Offset + A.FixupSection->getSectionOffset()) < (B.Offset + B.FixupSection->getSectionOffset()); }); |