[cfe-dev] [clangd-dev] RFC: add RecoveryExpr to represent invalid constructs in AST

Stephen Kelly via cfe-dev cfe-dev at lists.llvm.org
Thu May 16 01:03:12 PDT 2019


On 09/05/2019 19:56, Sam McCall via cfe-dev wrote:
> Thanks all for the responses. I'm glad there's interest in using such a 
> thing. I'll do some more work on this, and meanwhile seek more feedback 
> on whether the design idea is likely to work. (Maybe from Richard? :-))
> 
> Tom wrote:
>  > Ideally, I'd like to have ErrorDecl, ErrorStmt, ErrorExpr, and 
> ErrorType nodes.  But there is no reason they would all have to be 
> introduced at the same time.
> Absolutely. I think Expr is the most pressing and so a good candidate to 
> start with, due to the high level of nesting and lack of recovery today.
> But there's likely to be value in other node types too.
> 
> Aaron wrote:
>  > As for AST matchers, I think there should be an optional way to match 
> through these recovery nodes or not.
> Agreed. As well as compatibility, the examples you mention probably want 
> different behavior forever.
> AFAIK there's no "match options" type thing in ASTMatchers to hang this 
> on, so that's an interesting API question.

I've already been working on that in order to ignore 'invisible nodes'

  https://reviews.llvm.org/D61837

See my talk:

  https://www.youtube.com/watch?v=yqi8U8Q0h2g

I haven't had success with getting the simple patches reviewed yet, but 
I've just added you as a reviewer.

Thanks,

Stephen.





More information about the cfe-dev mailing list