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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 09:22:54 PST 2025


================
@@ -1718,15 +1719,23 @@ class Record {
   ArrayRef<AssertionInfo> getAssertions() const { return Assertions; }
   ArrayRef<DumpInfo> getDumps() const { return Dumps; }
 
-  ArrayRef<std::pair<const Record *, SMRange>> getSuperClasses() const {
-    return SuperClasses;
+  void getSuperClasses(
----------------
jayfoad wrote:

Hmm, I'm not sure. Append-to-vector-argument is widely used in LLVM and it helps to keep the implementation of getSuperClasses itself efficient, by not allocating a new vector for every recursive call.

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


More information about the llvm-commits mailing list