[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf1ac00c9b0d1: [pseudo] Add grammar annotations support. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D126536?vs=434906&

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:219 + // ExtensionID is the index of the table. + std::vector AttributeValues; }; sammccall wrote: > looking at this agai

[PATCH] D127283: [pseudo] Simplify the glrReduce implementation.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG74e4d5f256fa: [pseudo] Simplify the glrReduce implementation. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127283: [pseudo] Simplify the glrReduce implementation.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 435463. hokein marked 3 inline comments as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127283/new/ https://reviews.llvm.org/D127283 Files: clang-tools-extra/ps

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7a05942dd0c5: [pseudo] Remove the explicit Accept actions. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D125677?vs=4353

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:86 + const ForestNode *Result = nullptr; + StateID AcceptState = Params.Table.getGoToState(StartState, StartSymbol); + glrReduce(PendingReduce, Params, [&](const GSS::Node *NewHead) { --

[PATCH] D127357: [pseudo] wip/prototype: use LR0 instead of SLR1 table

2022-06-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for experimenting this! > the size of the LR table is much smaller (In this patch we go from 340kB => > 120kB, and the encoding isn't efficient) This is interesting. I'd expect we now add more reduce actions into the LRTable, thus the table size should grow (I gu

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:86 + const ForestNode *Result = nullptr; + StateID AcceptState = Params.Table.getGoToState(StartState, StartSymbol); + glrReduce(PendingReduce, Params, [&](const GSS::Node *NewHead) { --

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 435309. hokein marked an inline comment as done. hokein added a comment. switch to the previous simple version Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125677/new/ https://reviews.llvm.org/D125677 Files:

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:85 - if (!PendingAccept.empty()) { -LLVM_DEBUG({ - llvm::dbgs() << llvm::formatv("Accept: {0} accepted result:\n", - PendingAccept.size()); -

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 435103. hokein added a comment. pull out the logic of detecting acceptable state out of glrReduce callback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125677/new/ https://reviews.llvm.org/D125677 Files: cl

[PATCH] D127283: [pseudo] Simplify the glrReduce implementation.

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. glrReduce maintains two priority queues (one for bases, and the other for Seq

[PATCH] D127269: Add llvm's Support lib to the psuedoCXX library

2022-06-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127269/new/ https://reviews.llvm.org/D127269

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:22 // +// The grammar supports extensions, which have the syntax form of +// [key=value;key=value]. Extensions are associated with a grammar symbol ( sammccall wr

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 434906. hokein marked 5 inline comments as done. hokein added a comment. - bring back the attribute concept, narrow down the ExtensionID scope (only used for semantic); - loose and simplify the BNF annotations parsing; ([] only allows single attribute, attrib

[PATCH] D125479: [pseudo] Fix the incorrect parameters-and-qualifiers rule.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGcf88150c48df: [pseudo] Fix the incorrect parameters-and-qualifiers rule. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D125479: [pseudo] Fix the incorrect parameters-and-qualifiers rule.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 434733. hokein added a comment. pull out a separate test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125479/new/ https://reviews.llvm.org/D125479 Files: clang-tools-extra/pseudo/lib/cxx.bnf clang-to

[PATCH] D126998: [pseudo] Fix the type-parameter rule.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rGecd7ff53b533: [pseudo] Fix the type-parameter rule. (authored by hokein). Changed prior to commit: https:

[PATCH] D126996: [pseudo] Handle the language predefined identifier __func__

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG90dab0473ef0: [pseudo] Handle the language predefined identifier __func__ (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D126992: [pseudo] Fix noptr-abstract-declarator rule.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG58b33bc8c48a: [pseudo] Fix noptr-abstract-declarator rule. (authored by hokein). Changed prior to commit:

[PATCH] D126991: [pseudo] Fix the member-specification grammar rule.

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0a6a17a4f9fd: [pseudo] Fix the member-specification grammar rule. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D126723: [pseudo] GC GSS nodes, reuse them with a freelist

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:78 +// We need to copy the list: Roots is consumed by the GC. +Roots = NewHeads; +GSS.gc(std::move(Roots)); -

[PATCH] D127006: [pseudo] Invert rows/columns of LRTable storage for speedup. NFC

2022-06-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. oh, this looks nice, and makes the code simplier. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127006/new/ https://reviews.llvm.org/D127006 __

[PATCH] D126998: [pseudo] Fix the type-parameter rule.

2022-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The IDENTIFIER should be optional. Repository: rG LLVM Github Monorepo h

[PATCH] D126996: [pseudo] Handle the language predefined identifier __func__

2022-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The clang lexer lexes it as a dedicated token kind (rather than identifier),

[PATCH] D126992: [pseudo] Fix noptr-abstract-declarator rule.

2022-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The const-expression in the [] can be empty. Repository: rG LLVM Github M

[PATCH] D126991: [pseudo] Fix the member-specification grammar rule.

2022-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The grammar rule is not right, doesn't match the standard one. Repository:

[PATCH] D125479: [pseudo] Fix the incorrect parameters-and-qualifiers rule.

2022-06-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. friendly ping. Comment at: clang-tools-extra/pseudo/test/glr.cpp:37 + +void foo2(int, ...); +// CHECK: declaration~simple-declaration := decl-specifier-seq init-declarator-list ; since we have the builtin pseudoCXX library now, we

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 433354. hokein marked 2 inline comments as done. hokein added a comment. remove a left-out change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126536/new/ https://reviews.llvm.org/D126536 Files: clang-tools

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I addressed comments on the grammar part, (the remaining GLR, pseudo_gen parts are not covered yet), I think it would be better them into different patches, so that we can land the grammar bit first, then start doing the error recovery and guard implementation in paralle

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 433351. hokein marked 3 inline comments as done and an inline comment as not done. hokein added a comment. [pseudo] Support annotations in the grammar. This patch adds annotations in the bnf grammar. Annotations (which has a form of `[key1=value;key2=value]`)

[PATCH] D126723: [pseudo] GC GSS nodes, reuse them with a freelist

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:87 NewHeads.clear(); +MaybeGC(); glrReduce(PendingReduce, Params, sammccall wrote: > hokein wrote: > > I would just call it before the `NewHeads.clear()`, and run the `gc

[PATCH] D126723: [pseudo] GC GSS nodes, reuse them with a freelist

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Nice! I really like the form it goes now. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/GLR.h:82 // FIXME: Most nodes live a fairly short time, and are simply discarded. // Is it worth refcounting them (we have empty padding) and

[PATCH] D126731: [pseudo] Eliminate dependencies from clang-pseudo-gen. NFC

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Nice. > ninja clean; ninja pseudo-gen runs 169 actions only I think previous version was ~400 actions. Comment at: clang-tools-extra/pseudo/lib/grammar/Grammar.cpp:10 #inc

[PATCH] D126725: [pseudo] rename pseudo-gen -> clang-pseudo-gen. NFC

2022-06-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: llvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn:1 -executable("pseudo-gen") { +executable("clang-pseudo-gen") { configs += [ "//llvm/utils/gn

[PATCH] D126337: [pseudo] WIP: GSS node refcounting (dumb pointers)

2022-05-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:118 +CheckRefcounts(); +for (const auto *Head : NewHeads) { AddSteps(Head, Terminal.symbol()); > The freelist works well (on AST.cpp, 35K nodes created but only 74 alloc

[PATCH] D126633: [pseudo] Use the pseudoCXX library in fuzzer.

2022-05-30 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. Get rid of the tedious grammar command-fla

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h:87 +// Defines the built-in attribute keys. +enum class AttributeKey : uint8_t { + // A guard controls whether a reduction of a rule will be conducted by the GLR n

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. This patch might cover too many things (at least we could split the guide/glr implementation bit), but want to give you an overview of the picture first. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126536/new/ https://rev

[PATCH] D126536: [pseudo] Add grammar annotations support.

2022-05-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: mgrang, mgorny. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. - Add annotation handling ([key=val

[PATCH] D126397: [pseudo] Fix pseudo-gen usage when cross-compiling

2022-05-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126397/new/ https://reviews.llvm.org/D126397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D122935: [AST] Dont invalidate a ref-type var decl if it has no initializer.

2022-05-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc673d67bc76b: [AST] Dont invalidate a ref-type var decl if it has no initializer. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122935/

[PATCH] D126373: [pseudo-gen] Add -o flag, make --grammar required

2022-05-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126373/new/ https://reviews.llvm.org/D126373 ___ cfe-commits mailing list cfe-commit

[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&id=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 https://reviews.llvm.org/D12

[PATCH] D125911: [pseudo] (trivial) bracket-matching

2022-05-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/unittests/BracketTest.cpp:103 +TEST(Bracket, SimplePair) { + verifyBrackets("^{ ^[ ^( ^) ^( ^) ^] ^}"); + verifyBrackets(") ^{ ^[ ^] ^} ("); sammccall wrote: > hokein wrote: > > For this simple

[PATCH] D125911: [pseudo] (trivial) bracket-matching

2022-05-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, this looks a good start version! Comment at: clang-tools-extra/pseudo/include/clang-pseudo/Bracket.h:9 +// +// Bracket structure (particularly brackes) is key to isol

[PATCH] D125684: [clangd] Support UnresolvedUsingTypeLoc AST node in FindTarget.

2022-05-20 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rG5b0022a9df3f: [clangd] Support UnresolvedUsingTypeLoc AST node in FindTarget. (authored by hokein). Changed

[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

2022-05-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D125311#3524190 , @sammccall wrote: > In D125311#3523388 , @hokein wrote: > >> In D125311#3503452 , @sammccall >> wrote: >> >>> This looks good

[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

2022-05-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 430646. hokein added a comment. add addPayload method, and share payload in cook as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125311/new/ https://reviews.llvm.org/D125311 Files: clang-tools-extra/pse

[PATCH] D125863: [clangd] Dont mark terminating PP-directives as skipped

2022-05-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D125863#3522384 , @kadircet wrote: > In D125863#3522025 , @hokein wrote: > >> sorry, I might be lack of the context, where is the user complaint? I'm not >> sure which cases are improve

[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 valu

[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 clang-tools-extra/pseudo/

[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 LLV

[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

2022-05-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D125311#3503452 , @sammccall wrote: > This looks good, but if that's the idiom we should add it to cook() also. cook is more tricky, it takes a TokenStream, and returns a new one with an allocator payload: - the input TokenSt

[PATCH] D125863: [clangd] Dont mark terminating PP-directives as skipped

2022-05-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. sorry, I might be lack of the context, where is the user complaint? I'm not sure which cases are improved with this patch. Ideally we would not mark PP directives as inactive regions, but we never do that (FIXME

[PATCH] D125794: [pseudo] Remove unnecessary user-defined-string-literal rule.

2022-05-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/lib/cxx.bnf:716 string-literal := string-literal-chunk -string-literal := string-literal string-literal-chunk +string-literal := string-literal-chunk string-literal user-defined-literal := user-defined-integer-l

[PATCH] D125794: [pseudo] Remove unnecessary user-defined-string-literal rule.

2022-05-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. We accidently define two identical rules for user-defined-string-literal (one

[PATCH] D125684: [clangd] Support UnresolvedUsingTypeLoc AST node in FindTarget.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman. Herald added a project: All. hokein requested review of this revision. Herald added subscribers: MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. to make features like

[PATCH] D123422: [AST] Cleanup on getting the underlying decl of using-shdow decl.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGacc80ea71bac: [AST] Cleanup on getting the underlying decl of using-shdow decl. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D125677: [pseudo] Remove the explicit Accept actions.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. As pointed out in the previous review section, having a dedicated accept acti

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked 2 inline comments as done. Closed by commit rG1a65c491be71: [pseudo] Support parsing variant target symbols. (authored by hokein). Changed prior to commi

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 429645. hokein added a comment. move the findNonterminal to Grammar. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125006/new/ https://reviews.llvm.org/D125006 Files: clang-tools-extra/pseudo/benchmarks/Bench

[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 gramma

[PATCH] D125481: [pseudo] NFC, bail out the parse loop if there is no active heads.

2022-05-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. And print the line number in the debug message, which makes it easier to loca

[PATCH] D125479: [pseudo] Fix the incorrect parameters-and-qualifiers rule.

2022-05-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The parenthese body should be `parameter-declaration-clause`, rather than `pa

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > Would including *every* nonterminal as a start symbol would blow the size up > a bit? > This would eliminate some complexity in the interface. This does increase the size, some datapoints: - ~240 start symbols - number of states: 1.4K -> 2K - number of actions: 83K ->

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 428634. hokein added a comment. add a comment in cxx.bnf explaining why not making all nonterminals as start symbol by default. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125006/new/ https://reviews.llvm.org

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 3 inline comments as done. hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/GLR.h:125 }; -// Parse the given token stream with the GLR algorithm, and return a forest node -// of the start symbol. sammccall wr

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 428479. hokein marked 3 inline comments as done. hokein added a comment. - adress comments - rename TargetSymbol -> StartSymbol - don't use StartSymbol for "_", rename and update a few occurrences - move findNonterminal to Grammar.h since it is used in various

[PATCH] D125312: [pseudo] benchmark cleanups. NFC

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125312/new/ https://reviews.llvm.org/D125312

[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Example: https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/pseudo/tool/ClangPseudo.cpp#L88 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125311/new/ https://reviews.llvm.org/D125311 _

[PATCH] D125311: [pseudo] Share the underly payload when stripping comments for a token stream

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. `stripComments(cook(...))` is a common pattern being written. Without this pa

[PATCH] D125226: [pseudo] Add benchmarks for pseudoparser.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbe895d5768d5: [pseudo] Add benchmarks for pseudoparser. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125226/new/ https://reviews.llvm

[PATCH] D125226: [pseudo] Add benchmarks for pseudoparser.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D125226#3500691 , @sammccall wrote: > > I think we should have some fixed checked-in examples, but we can add them > later. Yeah, it is a good idea to have some fixed datasets checked in (but we will not run them in build

[PATCH] D125226: [pseudo] Add benchmarks for pseudoparser.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/benchmarks/Benchmark.cpp:49 +static void runParseGrammar(benchmark::State &State) { + std::string GrammarText = readFile(GrammarFile); + for (auto _ : State) sammccall wrote: > rather than have

[PATCH] D125226: [pseudo] Add benchmarks for pseudoparser.

2022-05-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 428323. hokein marked 6 inline comments as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125226/new/ https://reviews.llvm.org/D125226 Files: clang-tools-extra/ps

[PATCH] D125231: [pseudo] Compile cxx grammar.

2022-05-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. This is just a prototype, wanting some early feedback before making further progress: - compiling the generated Cxx.cpp is very slow (took minutes, mostly due to the LRTable::Actions); - layering (location of the generated header file) is not super clear; Repository:

[PATCH] D125231: [pseudo] Compile cxx grammar.

2022-05-09 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. It compiles the cxx bnf grammar, and gener

[PATCH] D125226: [pseudo] Add benchmarks for pseudoparser.

2022-05-09 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. Running on SemaDecl.cpp with the cxx.bnf g

[PATCH] D125166: [clang-fuzzer] Add a tiny tool to generate a fuzzing dictionary for clang

2022-05-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang/tools/clang-fuzzer/dictionary/CMakeLists.txt:2 +add_clang_executable(clang-fuzzer-dictionary dictionary.c) + nit: remove the extra blan

[PATCH] D125081: [FuzzMutate] Split out FuzzerCLI library that doesn't depend on IR.

2022-05-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. This looks a reasonable split to me! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125081/new/ https://reviews.llvm.org/D125081 ___

[PATCH] D125049: [pseudo] Only expand UCNs for raw_identifiers

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/pseudo/test/crash/backslashes.c:2 +// We used to try to interpret these backslashes as UCNs. +// RUN: clang-pseudo -source=%s +\ ---

[PATCH] D125037: [pseudo] Add fuzzer for the pseudoparser.

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Nice! Comment at: clang-tools-extra/pseudo/fuzzer/Fuzzer.cpp:81 + bool PrintForest = false; + unsigned O = 1; + for (int I = 1; I < *Argc; ++I) { nit: I'd

[PATCH] D125059: [Lex] Don't assert when decoding invalid UCNs.

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/pseudo/test/crash/bad-ucn.c:4 +// RUN: clang-pseudo -source=%s +A\U nit: this test seems duplicated with the one in

[PATCH] D124955: [clang-tidy] Make header-guard check a little looser on comment whitespace

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. I think `"// FOO_BAR_H"` in your message should be `"// FOO_BAR_H" ` (two space). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124955/new/ ht

[PATCH] D125006: [pseudo] Support parsing variant target symbols.

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a subscriber: mgrang. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. With this patch, we're able to parse small

[PATCH] D124974: [clang] Include clang config.h in LangStandards.cpp

2022-05-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124974/new/ https://reviews.llvm.org/D124974

[PATCH] D123243: [pseudo] Strip directives from a token stream

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. would be nice to land it in some of form. Comment at: clang-tools-extra/pseudo/unittests/DirectiveTreeTest.cpp:316 + std::string Code = R"cpp( +a a a +#warning AAA -

[PATCH] D124831: [pseudo] Use a real language option in the parser.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc4546091ed29: [pseudo] Use a real language option in the parser. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D124831: [pseudo] Use a real language option in the parser.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 426811. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124831/new/ https://reviews.llvm.org/D124831 Files: clang-tools-extra/pseudo/include/clang-pseudo/Token.h clang-tools-ext

[PATCH] D121150: [pseudo] Implement the GLR parsing algorithm.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeac22d0754f7: [pseudo] Implement the GLR parsing algorithm. (authored by sammccall, committed by hokein). Repository: rG LLVM Github Monorepo CHA

[PATCH] D121150: [pseudo] Implement the GLR parsing algorithm.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 426680. hokein retitled this revision from "[pseudo] Implement the GLR parsing algorithm. " to "[pseudo] Implement the GLR parsing algorithm.". hokein added a comment. fix a dangling reference of the source text in clang-pseudo. Repository: rG LLVM Github

[PATCH] D121150: [pseudo] Implement the GLR parsing algorithm.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/pseudo/include/clang-pseudo/GLR.h:143 +// parsing process (glrShift, or glrReduce). +using NewHeadCallback = +std::function nit: this is always used synchronously, so llvm::function_ref? we have a `captureNewHeads` m

[PATCH] D121150: [pseudo][WIP] Implement a GLR parser.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 426679. hokein marked 6 inline comments as done. hokein added a comment. address remaining comments: - return GSS::node in the NewHeadCallback, rather the fields of GSS::Node; - remove the unncessary NewHeadResult structure in unittest; Repository: rG LLVM

[PATCH] D124827: [pseudo] Simplify the forest dump, NFC.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb18abde8ada1: [pseudo] Simplify the forest dump, NFC. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124827/new/ https://reviews.llvm.o

[PATCH] D124831: [pseudo] Use a real language option in the parser.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D124831 File

[PATCH] D124827: [pseudo] Simplify the forest dump, NFC.

2022-05-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a project: All. hokein requested review of this revision. Herald added a subscriber: alextsao1999. Herald added a project: clang-tools-extra. The code was written to handle nullable grammar, and we disallow nullable gra

<    4   5   6   7   8   9   10   11   12   13   >