[PATCH] D132487: [pseudo] Placeholder disambiguation strategy: always choose second

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 10:21:06 PDT 2022


sammccall created this revision.
sammccall added a reviewer: hokein.
Herald added a subscriber: mgorny.
Herald added a project: All.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, alextsao1999.
Herald added a project: clang-tools-extra.

Mostly mechanics here. Interesting decisions:

- apply disambiguation in-place instead of copying the forest debatable, but even the final tree size is significant
- split decide/apply into different functions - this allows the hard part (decide) to be tested non-destructively and combined with HTML forest easily
- add non-const accessors to forest to enable apply
- unit tests but no lit tests: my plan is to test actual C++ disambiguation heuristics with lit, generic disambiguation mechanics without the C++ grammar


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132487

Files:
  clang-tools-extra/pseudo/include/clang-pseudo/Disambiguate.h
  clang-tools-extra/pseudo/include/clang-pseudo/Forest.h
  clang-tools-extra/pseudo/include/clang-pseudo/GLR.h
  clang-tools-extra/pseudo/lib/CMakeLists.txt
  clang-tools-extra/pseudo/lib/Disambiguate.cpp
  clang-tools-extra/pseudo/lib/GLR.cpp
  clang-tools-extra/pseudo/tool/ClangPseudo.cpp
  clang-tools-extra/pseudo/tool/HTMLForest.cpp
  clang-tools-extra/pseudo/unittests/CMakeLists.txt
  clang-tools-extra/pseudo/unittests/DisambiguateTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132487.454887.patch
Type: text/x-patch
Size: 17233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220823/6145baec/attachment.bin>


More information about the cfe-commits mailing list