aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-03-01 11:47:00 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-03-01 11:47:00 +0000
commit3a377bce4e134406920a3ee744e2ef9edd21762f (patch)
tree7242f0b2d56078d18ded3c7927059b85a8f2d201 /llvm/utils/TableGen/CodeGenTarget.cpp
parentf4cde83d3a284a53869baa12d9eabe0342678e93 (diff)
downloadllvm-3a377bce4e134406920a3ee744e2ef9edd21762f.zip
llvm-3a377bce4e134406920a3ee744e2ef9edd21762f.tar.gz
llvm-3a377bce4e134406920a3ee744e2ef9edd21762f.tar.bz2
Now that we have C++11, turn simple functors into lambdas and remove a ton of boilerplate.
No intended functionality change. llvm-svn: 202588
Diffstat (limited to 'llvm/utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 3ba49c7..92b3f05 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -289,17 +289,6 @@ GetInstByName(const char *Name,
return I->second;
}
-namespace {
-/// SortInstByName - Sorting predicate to sort instructions by name.
-///
-struct SortInstByName {
- bool operator()(const CodeGenInstruction *Rec1,
- const CodeGenInstruction *Rec2) const {
- return Rec1->TheDef->getName() < Rec2->TheDef->getName();
- }
-};
-}
-
/// \brief Return all of the instructions defined by the target, ordered by
/// their enum value.
void CodeGenTarget::ComputeInstrsByEnum() const {
@@ -346,8 +335,10 @@ void CodeGenTarget::ComputeInstrsByEnum() const {
// All of the instructions are now in random order based on the map iteration.
// Sort them by name.
- std::sort(InstrsByEnum.begin()+EndOfPredefines, InstrsByEnum.end(),
- SortInstByName());
+ std::sort(InstrsByEnum.begin() + EndOfPredefines, InstrsByEnum.end(),
+ [](const CodeGenInstruction *Rec1, const CodeGenInstruction *Rec2) {
+ return Rec1->TheDef->getName() < Rec2->TheDef->getName();
+ });
}