Author: Stephen Kelly Date: 2020-11-23T14:27:48Z New Revision: 5e1801813d93210acae84ff3c68a01512c2df9bc
URL: https://github.com/llvm/llvm-project/commit/5e1801813d93210acae84ff3c68a01512c2df9bc DIFF: https://github.com/llvm/llvm-project/commit/5e1801813d93210acae84ff3c68a01512c2df9bc.diff LOG: Remove the IgnoreImplicitCastsAndParentheses traversal kind Differential Revision: https://reviews.llvm.org/D91918 Added: Modified: clang-tools-extra/clang-query/QueryParser.cpp clang-tools-extra/docs/ReleaseNotes.rst clang/docs/ReleaseNotes.rst clang/include/clang/AST/ASTNodeTraverser.h clang/include/clang/AST/ASTTypeTraits.h clang/lib/AST/ParentMapContext.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clang-query/QueryParser.cpp b/clang-tools-extra/clang-query/QueryParser.cpp index 2f1965e77ab4..45a0d425b7c2 100644 --- a/clang-tools-extra/clang-query/QueryParser.cpp +++ b/clang-tools-extra/clang-query/QueryParser.cpp @@ -134,8 +134,6 @@ QueryRef QueryParser::parseSetTraversalKind( unsigned Value = LexOrCompleteWord<unsigned>(this, ValStr) .Case("AsIs", ast_type_traits::TK_AsIs) - .Case("IgnoreImplicitCastsAndParentheses", - ast_type_traits::TK_IgnoreImplicitCastsAndParentheses) .Case("IgnoreUnlessSpelledInSource", ast_type_traits::TK_IgnoreUnlessSpelledInSource) .Default(~0u); diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 5e78de2b0edc..c99a589b1212 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -57,7 +57,7 @@ The improvements are... Improvements to clang-query --------------------------- -The improvements are... +- The IgnoreImplicitCastsAndParentheses traversal mode has been removed. Improvements to clang-rename ---------------------------- diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 737f165c80cb..d62c62dad3d2 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -234,6 +234,9 @@ AST Matchers has been changed to no longer match on template instantiations or on implicit nodes which are not spelled in the source. +- The TK_IgnoreImplicitCastsAndParentheses traversal kind was removed. It + is recommended to use TK_IgnoreUnlessSpelledInSource instead. + - The behavior of the forEach() matcher was changed to not internally ignore implicit and parenthesis nodes. diff --git a/clang/include/clang/AST/ASTNodeTraverser.h b/clang/include/clang/AST/ASTNodeTraverser.h index 4f33b0c67e94..6f7affe66273 100644 --- a/clang/include/clang/AST/ASTNodeTraverser.h +++ b/clang/include/clang/AST/ASTNodeTraverser.h @@ -126,9 +126,6 @@ class ASTNodeTraverser switch (Traversal) { case TK_AsIs: break; - case TK_IgnoreImplicitCastsAndParentheses: - S = E->IgnoreParenImpCasts(); - break; case TK_IgnoreUnlessSpelledInSource: S = E->IgnoreUnlessSpelledInSource(); break; diff --git a/clang/include/clang/AST/ASTTypeTraits.h b/clang/include/clang/AST/ASTTypeTraits.h index bd817b75bb84..034260cc8ed3 100644 --- a/clang/include/clang/AST/ASTTypeTraits.h +++ b/clang/include/clang/AST/ASTTypeTraits.h @@ -40,10 +40,6 @@ enum TraversalKind { /// Will traverse all child nodes. TK_AsIs, - /// Will not traverse implicit casts and parentheses. - /// Corresponds to Expr::IgnoreParenImpCasts() - TK_IgnoreImplicitCastsAndParentheses, - /// Ignore AST nodes not written in the source TK_IgnoreUnlessSpelledInSource }; @@ -542,8 +538,6 @@ using ASTNodeKind = ::clang::ASTNodeKind; using TraversalKind = ::clang::TraversalKind; constexpr TraversalKind TK_AsIs = ::clang::TK_AsIs; -constexpr TraversalKind TK_IgnoreImplicitCastsAndParentheses = - ::clang::TK_IgnoreImplicitCastsAndParentheses; constexpr TraversalKind TK_IgnoreUnlessSpelledInSource = ::clang::TK_IgnoreUnlessSpelledInSource; } // namespace ast_type_traits diff --git a/clang/lib/AST/ParentMapContext.cpp b/clang/lib/AST/ParentMapContext.cpp index c80c8bc23e00..cb4995312efa 100644 --- a/clang/lib/AST/ParentMapContext.cpp +++ b/clang/lib/AST/ParentMapContext.cpp @@ -36,8 +36,6 @@ Expr *ParentMapContext::traverseIgnored(Expr *E) const { switch (Traversal) { case TK_AsIs: return E; - case TK_IgnoreImplicitCastsAndParentheses: - return E->IgnoreParenImpCasts(); case TK_IgnoreUnlessSpelledInSource: return E->IgnoreUnlessSpelledInSource(); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits