mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user