[PATCH] D73029: Extend ExprTraversal class with acending traversal

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 11:48:48 PST 2020


aaron.ballman added a comment.

Test cases?



================
Comment at: clang/lib/AST/ASTContext.cpp:1066
+    if (Node.getNodeKind().hasPointerIdentity()) {
+      auto ParentList =
+          getDynNodeFromMap(Node.getMemoizationData(), PointerParents);
----------------
Please spell the type out instead of using `auto`.


================
Comment at: clang/lib/AST/ASTContext.cpp:1070
+          TK == ast_type_traits::TK_IgnoreUnlessSpelledInSource) {
+        const Expr *E = ParentList[0].get<Expr>();
+        const Expr *Child = Node.get<Expr>();
----------------
`const auto *` (same below) because the type is spelled out in the initialization.


================
Comment at: clang/lib/AST/ASTContext.cpp:1086
+        break;
+      auto *S = It->second.dyn_cast<const Stmt *>();
+      if (!S)
----------------
`const auto *` so we don't have to infer the constness (same below with `P`).


================
Comment at: clang/lib/AST/ExprTraversal.cpp:278
+
+  if (auto *C = dyn_cast<CXXConstructExpr>(E)) {
+    if (C->getSourceRange() == SR || !isa<CXXTemporaryObjectExpr>(C))
----------------
`const auto *` here and elsewhere


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73029





More information about the cfe-commits mailing list