<div dir="ltr"><div dir="ltr">On Fri, Jan 10, 2020 at 4:34 PM Aaron Ballman via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I've not seen much to suggest the community is not in favor of this<br>
direction, so I think you're all set to post patches for review. If<br>
there are community concerns, we can address them during the review<br>
process. Thank you for working on this!<br></blockquote><div><br></div><div>Sorry, I just came back from vacation. I'm not sure if it is a good idea, in particular, for the following reasons:</div><div><br></div><div>- The document specifies the goals in terms of a solution: "Goal: Users should not have to account for implicit AST nodes when writing AST Matchers". </div><div><br></div><div>- The complexity for implementers (although it also applies to <a href="https://reviews.llvm.org/D61837">https://reviews.llvm.org/D61837</a>, which landed a while ago, and I didn't see it). Allowing to run the same matcher in multiple modes increases our support and testing matrix.</div><div><br></div><div>- The complexity cliff for users. Many non-trivial matchers need to explicitly manage implicit AST nodes.</div><div><br></div><div>- The cost of ClangTidy. ClangTidy runs all matchers simultaneously in one AST traversal. If we implement implicit/no-implicit modes as separate AST traversals, ClangTidy would need to run two traversals, one for "easier" matchers (skipping implicit code), and one for "expert" matchers (traversing implicit code). We would also need to build two parent maps.</div><div><br></div><div>My best suggestion is to investigate implementing AST Matchers for syntax trees, and allow jumping between syntax and semantic nodes in one matcher -- to match syntax first, and then validate the necessary semantic constraints.</div><div><br></div><div>Dmitri</div></div><div><br></div>-- <br><div dir="ltr">main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/</div></div>