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

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 09:40:12 PST 2025


================
@@ -610,29 +610,28 @@ functions returns null.
 Getting Record Superclasses
 ===========================
 
-The ``Record`` class provides a function to obtain the superclasses of a
-record. It is named ``getSuperClasses`` and returns an ``ArrayRef`` of an
-array of ``std::pair`` pairs. The superclasses are in post-order: the order
-in which the superclasses were visited while copying their fields into the
-record. Each pair consists of a pointer to the ``Record`` instance for a
-superclass record and an instance of the ``SMRange`` class. The range
-indicates the source file locations of the beginning and end of the class
-definition.
-
-This example obtains the superclasses of the ``Prototype`` record and then
-iterates over the pairs in the returned array.
+The ``Record`` class provides a function to obtain the direct superclasses
+of a record. It is named ``getDirectSuperClasses`` and returns an
+``ArrayRef`` of an array of ``std::pair`` pairs. Each pair consists of a
+pointer to the ``Record`` instance for a superclass record and an instance
+of the ``SMRange`` class. The range indicates the source file locations of
+the beginning and end of the class definition.
----------------
s-barannikov wrote:

Not related to this PR, but since you are changing the comment:

> The range indicates the source file locations of the beginning and end of the class definition.

Is this true? `TGParser::AddSubClass` seems to pass the location of a subclass reference in the inheritance list.


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


More information about the llvm-commits mailing list