[all-commits] [llvm/llvm-project] 56c54c: [pseudo] Placeholder disambiguation strategy: alwa...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Aug 26 04:18:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 56c54cf66bcd6c2266cd96ab4da45c766fbad540
      https://github.com/llvm/llvm-project/commit/56c54cf66bcd6c2266cd96ab4da45c766fbad540
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

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

  Log Message:
  -----------
  [pseudo] Placeholder disambiguation strategy: always choose second

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

Differential Revision: https://reviews.llvm.org/D132487




More information about the All-commits mailing list