[PATCH] D71842: Allow newlines in AST Matchers in clang-query files

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 26 09:56:51 PST 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from some `auto` -> `auto *` nits.



================
Comment at: clang-tools-extra/clang-query/QueryParser.cpp:243-244
 
-    return new LetQuery(Name, Value);
+    auto Q = new LetQuery(Name, Value);
+    Q->RemainingContent = Line;
+    return Q;
----------------
steveire wrote:
> aaron.ballman wrote:
> > Would it make more sense to have `Query` with another constructor to hold the remaining content, and then thread that through `LetQuery`, `MatchQuery`, etc? Whether there is remaining content or not seems like a pretty important property of the query, so it seems reasonable to let people construct with that information rather than set it after the fact.
> > 
> > If not, these should be `auto *` rather than deducing the pointer.
> I think it is set after the fact because it is set in `endQuery()`.
Okay, that's reasonable. Thanks! Can you switch to `auto *` for these cases?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71842/new/

https://reviews.llvm.org/D71842





More information about the cfe-commits mailing list