@@ -610,29 +610,29 @@ functions returns null.
610
610
Getting Record Superclasses
611
611
===========================
612
612
613
- The ``Record `` class provides a function to obtain the superclasses of a
614
- record. It is named ``getSuperClasses `` and returns an ``ArrayRef `` of an
615
- array of ``std::pair `` pairs. The superclasses are in post-order: the order
616
- in which the superclasses were visited while copying their fields into the
617
- record. Each pair consists of a pointer to the ``Record `` instance for a
618
- superclass record and an instance of the ``SMRange `` class. The range
619
- indicates the source file locations of the beginning and end of the class
620
- definition.
613
+ The ``Record `` class provides a function to obtain the direct superclasses
614
+ of a record. It is named ``getDirectSuperClasses `` and returns an
615
+ ``ArrayRef `` of an array of ``std::pair `` pairs. Each pair consists of a
616
+ pointer to the ``Record `` instance for a superclass record and an instance
617
+ of the ``SMRange `` class. The range indicates the source file locations of
618
+ the beginning and end of the class definition.
621
619
622
- This example obtains the superclasses of the ``Prototype `` record and then
623
- iterates over the pairs in the returned array.
620
+ This example obtains the direct superclasses of the ``Prototype `` record and
621
+ then iterates over the pairs in the returned array.
624
622
625
623
.. code-block :: text
626
624
627
625
ArrayRef<std::pair<const Record *, SMRange>>
628
- Superclasses = Prototype->getSuperClasses ();
629
- for (const auto &SuperPair : Superclasses) {
626
+ Superclasses = Prototype->getDirectSuperClasses ();
627
+ for (const auto &[Super, Range] : Superclasses) {
630
628
...
631
629
}
632
630
633
- The ``Record `` class also provides a function, ``getDirectSuperClasses ``, to
634
- append the *direct * superclasses of a record to a given vector of type
635
- ``SmallVectorImpl<Record *> ``.
631
+ The ``Record `` class also provides a function, ``getSuperClasses ``, to
632
+ append *all * superclasses of a record to a given vector of type
633
+ ``SmallVectorImpl<Record *> ``. The superclasses are in post-order: the order
634
+ in which the superclasses were visited while copying their fields into the
635
+ record.
636
636
637
637
Emitting Text to the Output Stream
638
638
==================================
0 commit comments