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


================
Comment at: clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRTable.h:109
+    // tok::unknown is a sentinel value used in recovery: can follow anything.
+    if (tok::unknown)
+      return true;
----------------
this `if` doesn't make sense, and is not needed, I think. 


================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:621
     // Consume the token.
     glrShift(Heads, Terminals[I], Params, Lang, NextHeads);
 
----------------
I think we can move the Line634 `Heads.resize(HeadsPartition)` before the 
`glrShift()` as we only do shift on the nearly-created heads, we might gain 
some performance back.


================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:649
+    HeadsPartition = NextHeads.size();
     Reduce(NextHeads, Lookahead);
     // Prepare for the next token.
----------------
Can we have some comments on `GLRReduce::operator()` on how does parameter 
`Head` get modified  (new heads are appended to it)?  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130523

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to