[all-commits] [llvm/llvm-project] 263dcf: [syntax] Introduce a TokenManager interface.

Haojian Wu via All-commits all-commits at lists.llvm.org
Fri Jul 15 01:31:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 263dcf452fa04d98456df04d2c3a753ba6d916ab
      https://github.com/llvm/llvm-project/commit/263dcf452fa04d98456df04d2c3a753ba6d916ab
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2022-07-15 (Fri, 15 Jul 2022)

  Changed paths:
    M clang-tools-extra/clangd/SemanticSelection.cpp
    M clang/include/clang/Tooling/Syntax/BuildTree.h
    M clang/include/clang/Tooling/Syntax/Mutations.h
    M clang/include/clang/Tooling/Syntax/Nodes.h
    A clang/include/clang/Tooling/Syntax/TokenBufferTokenManager.h
    A clang/include/clang/Tooling/Syntax/TokenManager.h
    M clang/include/clang/Tooling/Syntax/Tokens.h
    M clang/include/clang/Tooling/Syntax/Tree.h
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/lib/Tooling/Syntax/CMakeLists.txt
    M clang/lib/Tooling/Syntax/ComputeReplacements.cpp
    M clang/lib/Tooling/Syntax/Mutations.cpp
    M clang/lib/Tooling/Syntax/Synthesis.cpp
    A clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp
    M clang/lib/Tooling/Syntax/Tree.cpp
    M clang/tools/clang-check/ClangCheck.cpp
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp
    M clang/unittests/Tooling/Syntax/MutationsTest.cpp
    M clang/unittests/Tooling/Syntax/SynthesisTest.cpp
    M clang/unittests/Tooling/Syntax/TreeTest.cpp
    M clang/unittests/Tooling/Syntax/TreeTestBase.cpp
    M clang/unittests/Tooling/Syntax/TreeTestBase.h

  Log Message:
  -----------
  [syntax] Introduce a TokenManager interface.

TokenManager defines Token interfaces for the clang syntax-tree. This is the level
of abstraction that the syntax-tree should use to operate on Tokens.

It decouples the syntax-tree from a particular token implementation (TokenBuffer
previously).  This enables us to use a different underlying token implementation
for the syntax Leaf node -- in clang pseudoparser, we want to produce a
syntax-tree with its own pseudo::Token rather than syntax::Token.

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




More information about the All-commits mailing list