[pseudo] Store last node popped in the queue, not its parent(s). NFC
authorSam McCall <sam.mccall@gmail.com>
Thu, 23 Jun 2022 18:06:04 +0000 (20:06 +0200)
committerSam McCall <sam.mccall@gmail.com>
Thu, 23 Jun 2022 18:10:20 +0000 (20:10 +0200)
commit466eae6aa3574aea6604d42666f099025718ffa4
treedfed5c382860880b88f459727f6529a3b2861ae2
parentc078e464a09fa5a6df1d5b94fc862d2f9bf6b8bd
[pseudo] Store last node popped in the queue, not its parent(s). NFC

We have to walk up to the last node to find the start token, but no need
to go even one node further.

This is one node fewer to store, but more importantly if the last node
happens to have multiple parents we avoid storing the sequence multiple times.

This saves ~5% on glrParse.
Based on a comment by hokein@ on https://reviews.llvm.org/D128307
clang-tools-extra/pseudo/lib/GLR.cpp