jdoerfert added inline comments.

================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2713-2714
+/// \endcode
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, AttributedStmt>
+    attributedStmt;
+
----------------
aaron.ballman wrote:
> Design-wise, I'm on the fence here. AST matchers match the AST nodes that 
> Clang produces, and from that perspective, this makes a lot of sense. But 
> `AttributedStmt` is a bit of a hack in some ways, and do we want to expose 
> that hack to AST matcher users? e.g., is there a reason we shouldn't make 
> `returnStmt(hasAttr(attr::Likely))` work directly rather than making the user 
> pick their way through the `AttributedStmt`? This is more in line with how 
> you check for a declaration with a particular attribute and seems like the 
> more natural way to surface this.
> 
> For the moment, since this is following the current AST structure in Clang, I 
> think this is fine. But I'm curious if @klimek or perhaps @sammccall has an 
> opinion here.
I think a way to find any kind of statement (or expression) that has a specific 
attribute is very useful. How that should look, idk.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120949

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to