[PATCH] D43680: TableGen: Generalize record types to fix typeIsConvertibleTo et al.

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 16:39:00 PST 2018


tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/TableGen/Record.cpp:1633-1641
+void Record::getDirectSuperClasses(SmallVectorImpl<Record *> &Classes) const {
+  ArrayRef<std::pair<Record *, SMRange>> SCs = getSuperClasses();
+  while (!SCs.empty()) {
+    Record *SC = SCs.back().first;
+    SCs = SCs.drop_back(1 + SC->getSuperClasses().size());
+    Classes.push_back(SC);
+  }
----------------
This could still benefit from a few comments regarding expected layout of classes in the array. Function tells us *what* this function is expected top produce, but it's still relatively hard to tell why it does things the way it does.



Repository:
  rL LLVM

https://reviews.llvm.org/D43680





More information about the llvm-commits mailing list