[all-commits] [llvm/llvm-project] cd2292: [pseudo] A basic implementation of compiling cxx g...

Haojian Wu via All-commits all-commits at lists.llvm.org
Wed May 25 02:26:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd2292ef824591cc34cc299910a3098545c840c7
      https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2022-05-25 (Wed, 25 May 2022)

  Changed paths:
    M clang-tools-extra/pseudo/CMakeLists.txt
    A clang-tools-extra/pseudo/gen/CMakeLists.txt
    A clang-tools-extra/pseudo/gen/Main.cpp
    A clang-tools-extra/pseudo/include/CMakeLists.txt
    A clang-tools-extra/pseudo/include/clang-pseudo/cxx/CXX.h
    M clang-tools-extra/pseudo/lib/CMakeLists.txt
    R clang-tools-extra/pseudo/lib/Grammar.cpp
    R clang-tools-extra/pseudo/lib/GrammarBNF.cpp
    R clang-tools-extra/pseudo/lib/LRGraph.cpp
    R clang-tools-extra/pseudo/lib/LRTable.cpp
    R clang-tools-extra/pseudo/lib/LRTableBuild.cpp
    A clang-tools-extra/pseudo/lib/cxx/CMakeLists.txt
    A clang-tools-extra/pseudo/lib/cxx/CXX.cpp
    A clang-tools-extra/pseudo/lib/grammar/CMakeLists.txt
    A clang-tools-extra/pseudo/lib/grammar/Grammar.cpp
    A clang-tools-extra/pseudo/lib/grammar/GrammarBNF.cpp
    A clang-tools-extra/pseudo/lib/grammar/LRGraph.cpp
    A clang-tools-extra/pseudo/lib/grammar/LRTable.cpp
    A clang-tools-extra/pseudo/lib/grammar/LRTableBuild.cpp

  Log Message:
  -----------
  [pseudo] A basic implementation of compiling cxx grammar at build time.

The main idea is to compile the cxx grammar at build time, and construct
the core pieces (Grammar, LRTable) of the pseudoparse based on the compiled
data sources.

This is a tiny implementation, which is good for start:

- defines how the public API should look like;
- integrates the cxx grammar compilation workflow with the cmake system.
- onlynonterminal symbols of the C++ grammar are compiled, anything
  else are still doing the real compilation work at runtime, we can opt-in more
  bits in the future;
- splits the monolithic clangPsuedo library for better layering;

Reviewed By: sammccall

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




More information about the All-commits mailing list