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

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 26 09:47:38 PST 2019


steveire marked 2 inline comments as done.
steveire added inline comments.


================
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;
----------------
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()`.


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