[all-commits] [llvm/llvm-project] 466eae: [pseudo] Store last node popped in the queue, not ...

Sam McCall via All-commits all-commits at lists.llvm.org
Thu Jun 23 11:10:35 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 466eae6aa3574aea6604d42666f099025718ffa4
      https://github.com/llvm/llvm-project/commit/466eae6aa3574aea6604d42666f099025718ffa4
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-06-23 (Thu, 23 Jun 2022)

  Changed paths:
    M clang-tools-extra/pseudo/lib/GLR.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list