[PATCH] D88832: [TableGen] Add new getAllDerivedDefinitionsTwo function to RecordKeeper

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 09:48:06 PDT 2020


jrtc27 added inline comments.


================
Comment at: llvm/lib/TableGen/Record.cpp:2486
+    if (!Class)
+      PrintFatalError("The class '" + ClassName + "' is not defined\n");
+    ClassRecs.push_back(Class);
----------------
Paul-C-Anagnostopoulos wrote:
> jrtc27 wrote:
> > Paul-C-Anagnostopoulos wrote:
> > > jrtc27 wrote:
> > > > Why change the error message?
> > > I got rid of ERROR: because no other TableGen message includes it. I reworded the message because "Couldn't find ..." strikes me as too informal. I replaced the bang with a newline because that is what most TableGen messages have.
> > There are a few others like that in llvm/utils/TableGen (and there was already a newline)
> Do you want me to restore the original comment?
I prefer how the old message reads (though the ERROR: does seem not so useful) but not overly fussed.


================
Comment at: llvm/lib/TableGen/Record.cpp:2493-2500
+    AddDef = true;
+    for (auto *const Class : ClassRecs)
+      if (!OneDef.second->isSubClassOf(Class)) {
+        AddDef = false;
+        break;
+      }
+    if (AddDef)
----------------
This can avoid some boilerplate by using llvm::any_of


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88832/new/

https://reviews.llvm.org/D88832



More information about the llvm-commits mailing list