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

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 05:54:50 PST 2018


nhaehnle marked an inline comment as done.
nhaehnle added inline comments.


================
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);
+  }
----------------
tra wrote:
> 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.
> 
I thought the comment on the SuperClasses member variable is enough, but I suppose it doesn't hurt, so I added another small comment.


Repository:
  rL LLVM

https://reviews.llvm.org/D43680





More information about the llvm-commits mailing list