summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-03-07 21:35:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-03-07 21:35:39 +0000
commitb0f74b24faa4bbbe5f07facb1e414c94e03ab428 (patch)
tree578efba0d33d0d0f768902a3ecfcdb6ca21a17ac /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parent526847fe2041b2e3018a20dc2fb4d12bfc0242cf (diff)
downloadbcm5719-llvm-b0f74b24faa4bbbe5f07facb1e414c94e03ab428.tar.gz
bcm5719-llvm-b0f74b24faa4bbbe5f07facb1e414c94e03ab428.zip
[C++11] Convert sort predicates into lambdas.
No functionality change. llvm-svn: 203288
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 42895300fc6..113a9e4cd4c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -58,19 +58,6 @@ unsigned DwarfException::SharedTypeIds(const LandingPadInfo *L,
return Count;
}
-/// PadLT - Order landing pads lexicographically by type id.
-bool DwarfException::PadLT(const LandingPadInfo *L, const LandingPadInfo *R) {
- const std::vector<int> &LIds = L->TypeIds, &RIds = R->TypeIds;
- unsigned LSize = LIds.size(), RSize = RIds.size();
- unsigned MinSize = LSize < RSize ? LSize : RSize;
-
- for (unsigned i = 0; i != MinSize; ++i)
- if (LIds[i] != RIds[i])
- return LIds[i] < RIds[i];
-
- return LSize < RSize;
-}
-
/// ComputeActionsTable - Compute the actions table and gather the first action
/// index for each landing pad site.
unsigned DwarfException::
@@ -356,7 +343,10 @@ void DwarfException::EmitExceptionTable() {
for (unsigned i = 0, N = PadInfos.size(); i != N; ++i)
LandingPads.push_back(&PadInfos[i]);
- std::sort(LandingPads.begin(), LandingPads.end(), PadLT);
+ // Order landing pads lexicographically by type id.
+ std::sort(LandingPads.begin(), LandingPads.end(),
+ [](const LandingPadInfo *L,
+ const LandingPadInfo *R) { return L->TypeIds < R->TypeIds; });
// Compute the actions table and gather the first action index for each
// landing pad site.
OpenPOWER on IntegriCloud