aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/TableGen')
-rw-r--r--include/llvm/TableGen/Record.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h
index 66d6dbd..032f153 100644
--- a/include/llvm/TableGen/Record.h
+++ b/include/llvm/TableGen/Record.h
@@ -1609,6 +1609,16 @@ struct LessRecord {
}
};
+/// LessRecordByID - Sorting predicate to sort record pointers by their
+/// unique ID. If you just need a deterministic order, use this, since it
+/// just compares two `unsigned`; the other sorting predicates require
+/// string manipulation.
+struct LessRecordByID {
+ bool operator()(const Record *LHS, const Record *RHS) const {
+ return LHS->getID() < RHS->getID();
+ }
+};
+
/// LessRecordFieldName - Sorting predicate to sort record pointers by their
/// name field.
///