[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 7 11:33:25 PST 2020


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2366
+/// Matches C11 _Generic expression.
+extern const internal::VariadicDynCastAllOfMatcher<Stmt, GenericSelectionExpr>
+    genericSelectionExpr;
----------------
Do we have a use case for adding this as an AST matcher? For instance, one of the first things I'd want to do with such a matcher is traverse down to the association list, but I don't think that's possible currently. Should we add all of the AST functionality or just wait until there's a concrete use case and add the AST matchers bits at that point?


================
Comment at: clang/lib/AST/ASTImporter.cpp:6509
+  auto ToGenericLoc = importChecked(Err, E->getGenericLoc());
+  auto ToControllingExpr = importChecked(Err, E->getControllingExpr());
+  auto ToDefaultLoc = importChecked(Err, E->getDefaultLoc());
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92600



More information about the cfe-commits mailing list