[cfe-dev] [RFC] A C++ pseudo parser for tooling

Andrew Tomazos via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 8 18:40:40 PST 2021


On Mon, Nov 8, 2021 at 11:18 AM Haojian Wu <hokein at google.com> wrote:

> IDE use cases (for clangd)
> -  provide code-folding, outline, syntax highlighting, selection features
> without a long "warmup" time;
> -  a fast index to provides approximate results;
>
> Other use cases we aim to support:
> - smart diff and merge tool for C++ code;
> - a fast linter, a cpplint replacement, with clang-tidy-like extensibility;
> - syntactic grep/sed tools;
>

* I don't know what "fast index to provide approximate results" means.
Results of what?  Do you mean generating an index?  What will the index be
used for?

* Syntax highlighting is the only use case of those listed that can
tolerate inaccuracy.  For the rest, a correct parse will be more
productive.  The trouble is that if people start depending on these
features in their workflow, when they fail (and they often will) it will be
very disruptive.  The cost of the disruption outweighs the time saved
waiting for a correct parse.

* I think you are better off spending your time on optimizing the correct
parser infrastructure.  I'm sure more can be done - particularly in terms
of caching, persisting and resusing state (think like PCH and modules etc).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211109/2701b8c9/attachment.html>


More information about the cfe-dev mailing list