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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 16 02:55:52 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:

Fair enough. Done. I really hope that `getSuperClasses` is not on any hot path anyway.

I assume it is safe to iterate over a temporary returned from this function:
```
    for (const Record *SC : Def->getSuperClasses()) { ... }
```
?

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


More information about the llvm-commits mailing list