[PATCH] D127283: [pseudo] Simplify the glrReduce implementation.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 04:31:43 PDT 2022


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Very nice! Not sure why I didn't see this before :-)



================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:266
   using Sequence = llvm::SmallVector<const ForestNode *, Rule::MaxElements>;
-  KeyedQueue<Family, Sequence> Sequences;
+  struct SeqNodeSpec {
+    // The base nodes are the heads after popping the GSS nodes we are reducing.
----------------
This name is a bit vague/abstract.

Maybe RootedSequence, or PushSpec?


================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:267
+  struct SeqNodeSpec {
+    // The base nodes are the heads after popping the GSS nodes we are reducing.
+    // We don't care which rule yielded each base. If Family.Symbol is S, the
----------------
nit: A base node is the head...
(no reason to talk about them collectively in this context)


================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:268
+    // The base nodes are the heads after popping the GSS nodes we are reducing.
+    // We don't care which rule yielded each base. If Family.Symbol is S, the
+    // base includes an item X := ... • S ... and since the grammar is
----------------
the second part of this comment belongs below where we decorrelate the two (under "grab the sequences and bases for each family"), not here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127283



More information about the cfe-commits mailing list