[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-25 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In D125667#3537678 , @smeenai wrote: > In D125667#3537655 , @sammccall > wrote: > >> I'll see if I can fix it quickly, else will revert (there are a couple of >> fixes stacked on top

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-25 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. In D125667#3537655 , @sammccall wrote: > I'll see if I can fix it quickly, else will revert (there are a couple of > fixes stacked on top already, so revert isn't quite clean) Thank you! I'll have some time to look at this a

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. I'll see if I can fix it quickly, else will revert (there are a couple of fixes stacked on top already, so revert isn't quite clean) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125667/new/

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-25 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. This breaks cross-compilation, because we're building `pseudo-gen` for the target but then trying to run it on the build machine. You'll need to do something like TableGen does (see https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/CrossCompile.cmake

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcd2292ef8245: [pseudo] A basic implementation of compiling cxx grammar at build time. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D125667?vs=431746=431917#toc Repository:

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:17 +static const char *CxxBNF = +#include "CXXBNF.inc" +; sammccall wrote: > this is worth a try, but I think (some versions of?) MSVC don't like long > string literals. > >

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 431746. hokein marked 3 inline comments as done. hokein added a comment. rebase, and emit string chunks rather than a long raw string literal (to make msvc happy) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-23 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:17 +static const char *CxxBNF = +#include "CXXBNF.inc" +; this is worth a try, but I

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/CMakeLists.txt:1 +set(CLANG_PSEUDO_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + sammccall wrote: > I think these variables shared across CMakeLists.txt files generally add more > confusion than

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 430506. hokein added a comment. format fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125667/new/ https://reviews.llvm.org/D125667 Files: clang-tools-extra/pseudo/CMakeLists.txt

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 430504. hokein marked 8 inline comments as done. hokein added a comment. Herald added a subscriber: mgrang. Address comments: - split to a grammar subdirectory - remove cxx_gen.cmake, move it to include/CMakeLists.txt - rename cxx -> CXX Repository: rG

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/pseudo/CMakeLists.txt:1 +set(CLANG_PSEUDO_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + I think these variables shared across CMakeLists.txt files generally add more confusion than value, it doesn't

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-16 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Few initial comments... Comment at: clang-tools-extra/pseudo/gen/Main.cpp:8 +//===--===// + +#include "clang-pseudo/Grammar.h" missing description

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. This is a revised version of D125231 , based on our discussion. It has a narrow scope: only nonterminals of the grammar are compiled; and it mainly focuses on interfaces; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D125667: [pseudo] A basic implementation of compiling cxx grammar at build time.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a subscriber: mgorny. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The main idea is to compile the cxx