[llvm] [TableGen] Only store direct superclasses in Record (PR #123072)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 06:35:43 PST 2025


================
@@ -330,17 +330,10 @@ bool TGParser::AddSubClass(Record *CurRec, SubClassReference &SubClass) {
 
   // Since everything went well, we can now set the "superclass" list for the
   // current record.
-  for (const auto &[SC, Loc] : SC->getSuperClasses()) {
-    if (CurRec->isSubClassOf(SC))
-      return Error(SubClass.RefRange.Start,
-                   "Already subclass of '" + SC->getName() + "'!\n");
-    CurRec->addSuperClass(SC, Loc);
-  }
-
----------------
jayfoad wrote:

Confirmed. I also compared all generated `.inc` files in an LLVM build tree, with no differences.

For this particular hunk, given `def D : C`, previously we had to add all C's superclasses, as well as C itself, to D's superclass list. Now we only have to add C to D's direct superclass list.

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


More information about the llvm-commits mailing list