aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/Record.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r--utils/TableGen/Record.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h
index c36d808..d597715 100644
--- a/utils/TableGen/Record.h
+++ b/utils/TableGen/Record.h
@@ -1175,6 +1175,23 @@ public:
void dump() const;
};
+/// LessRecord - Sorting predicate to sort record pointers by name.
+///
+struct LessRecord {
+ bool operator()(const Record *Rec1, const Record *Rec2) const {
+ return Rec1->getName() < Rec2->getName();
+ }
+};
+
+/// LessRecord - Sorting predicate to sort record pointers by their name field.
+///
+struct LessRecordFieldName {
+ bool operator()(const Record *Rec1, const Record *Rec2) const {
+ return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name");
+ }
+};
+
+
std::ostream &operator<<(std::ostream &OS, const RecordKeeper &RK);
extern RecordKeeper Records;