diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-01 11:47:00 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-01 11:47:00 +0000 |
commit | ee5e607355f76f0de64ea9ff5a380a5317627e05 (patch) | |
tree | 6282a5bbd14788534d8504dc154b12f953bc1589 /lib/Transforms/Instrumentation | |
parent | 73bbab9d755b7b196a0ba6a41caf9391a1d0abdf (diff) | |
download | llvm-ee5e607355f76f0de64ea9ff5a380a5317627e05.tar.gz llvm-ee5e607355f76f0de64ea9ff5a380a5317627e05.tar.bz2 llvm-ee5e607355f76f0de64ea9ff5a380a5317627e05.tar.xz |
Now that we have C++11, turn simple functors into lambdas and remove a ton of boilerplate.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/GCOVProfiling.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 8a3d5ea2db..557ef66dfd 100644 --- a/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -239,14 +239,6 @@ namespace { }; - // Sorting function for deterministic behaviour in GCOVBlock::writeOut. - struct StringKeySort { - bool operator()(StringMapEntry<GCOVLines *> *LHS, - StringMapEntry<GCOVLines *> *RHS) const { - return LHS->getKey() < RHS->getKey(); - } - }; - // Represent a basic block in GCOV. Each block has a unique number in the // function, number of lines belonging to each block, and a set of edges to // other blocks. @@ -277,8 +269,11 @@ namespace { write(Len); write(Number); - StringKeySort Sorter; - std::sort(SortedLinesByFile.begin(), SortedLinesByFile.end(), Sorter); + std::sort(SortedLinesByFile.begin(), SortedLinesByFile.end(), + [](StringMapEntry<GCOVLines *> *LHS, + StringMapEntry<GCOVLines *> *RHS) { + return LHS->getKey() < RHS->getKey(); + }); for (SmallVectorImpl<StringMapEntry<GCOVLines *> *>::iterator I = SortedLinesByFile.begin(), E = SortedLinesByFile.end(); I != E; ++I) |