[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
This revision was automatically updated to reflect the committed changes. Closed by commit rGd0da5d2bbe83: Change default traversal in AST Matchers to ignore invisible nodes (authored by stephenkelly). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire updated this revision to Diff 265946. steveire added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire updated this revision to Diff 265827. steveire added a comment. Touch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire updated this revision to Diff 265626. steveire added a comment. Touch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -246,7 +246,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from some documentation nits. Comment at: clang/docs/ReleaseNotes.rst:255 + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or is -> are Also, I think we typically use single spacing after the full stop in the release notes. Comment at: clang/docs/ReleaseNotes.rst:257-259 + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. We also have release notes for clang-tools-extra that should be updated for the changes to clang-query. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire updated this revision to Diff 263552. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -249,7 +249,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -249,7 +249,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the ``ignoringImplicit()`` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire updated this revision to Diff 263551. steveire added a comment. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72534/new/ https://reviews.llvm.org/D72534 Files: clang/docs/ReleaseNotes.rst clang/include/clang/AST/ParentMapContext.h Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -249,7 +249,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the `ignoringImplicit()` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format Index: clang/include/clang/AST/ParentMapContext.h === --- clang/include/clang/AST/ParentMapContext.h +++ clang/include/clang/AST/ParentMapContext.h @@ -67,7 +67,7 @@ private: ASTContext &ASTCtx; class ParentMap; - TraversalKind Traversal = TK_AsIs; + TraversalKind Traversal = TK_IgnoreUnlessSpelledInSource; std::unique_ptr Parents; }; Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -249,7 +249,14 @@ AST Matchers -- ... +- Traversal in AST Matchers was simplified to use the + ``TK_IgnoreUnlessSpelledInSource`` mode by default, instead of ``TK_AsIs``. + This means that many uses of the `ignoringImplicit()` and similar matchers + is no longer necessary. Clients of AST Matchers which wish to match on + implicit AST nodes can wrap their matcher in ``traverse(TK_AsIs, ...)`` or + use ``TraversalKindScope`` if appropriate. The ``clang-query`` tool also + uses ``IgnoreUnlessSpelledInSource`` by default. The mode can be changed + using ``set traversal AsIs`` in the ``clang-query`` environment. clang-format ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D72534: Change default traversal in AST Matchers to ignore invisible nodes
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72534 Files: clang/include/clang/AST/ASTContext.h Index: clang/include/clang/AST/ASTContext.h === --- clang/include/clang/AST/ASTContext.h +++ clang/include/clang/AST/ASTContext.h @@ -561,7 +561,8 @@ clang::PrintingPolicy PrintingPolicy; std::unique_ptr InterpContext; - ast_type_traits::TraversalKind Traversal = ast_type_traits::TK_AsIs; + ast_type_traits::TraversalKind Traversal = + ast_type_traits::TK_IgnoreUnlessSpelledInSource; public: ast_type_traits::TraversalKind getTraversalKind() const { return Traversal; } Index: clang/include/clang/AST/ASTContext.h === --- clang/include/clang/AST/ASTContext.h +++ clang/include/clang/AST/ASTContext.h @@ -561,7 +561,8 @@ clang::PrintingPolicy PrintingPolicy; std::unique_ptr InterpContext; - ast_type_traits::TraversalKind Traversal = ast_type_traits::TK_AsIs; + ast_type_traits::TraversalKind Traversal = + ast_type_traits::TK_IgnoreUnlessSpelledInSource; public: ast_type_traits::TraversalKind getTraversalKind() const { return Traversal; } ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits