[llvm] [TableGen] Rework error reporting for duplicate Feature/Processor. (PR #102257)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 10:48:28 PDT 2024


================
@@ -2112,14 +2112,22 @@ struct LessRecordByID {
   }
 };
 
-/// Sorting predicate to sort record pointers by their
-/// name field.
+/// 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");
   }
 };
 
+/// Sorting predicate to sort record pointers by their Name field, and break
+/// ties using record name.
+struct LessRecordFieldNameAndName {
----------------
s-barannikov wrote:

I agree with @tmatheson-arm. This comparator has nothing to do with TableGen core functionality and should be moved out of llvm/TableGen into llvm/util/TableGen where backends reside. Other comparators probably ended up here because there was not other common place to put them. Ideally, they (and especially LessRecordRegister) would be moved out, too.


https://github.com/llvm/llvm-project/pull/102257


More information about the llvm-commits mailing list