Author: Christian Kühnel Date: 2021-11-18T09:16:54Z New Revision: 7aa2ce0fab3c21cf87c5884f6bf8bdece1b6fe1c
URL: https://github.com/llvm/llvm-project/commit/7aa2ce0fab3c21cf87c5884f6bf8bdece1b6fe1c DIFF: https://github.com/llvm/llvm-project/commit/7aa2ce0fab3c21cf87c5884f6bf8bdece1b6fe1c.diff LOG: [NFC][clangd] fix clang-tidy finding on isa_and_nonnull This is a cleanup of the only llvm-prefer-isa-or-dyn-cast-in-conditionals finding in the clangd code base. This patch was created by automatically applying the fixes from clang-tidy. Differential Revision: https://reviews.llvm.org/D113899 Added: Modified: clang-tools-extra/clangd/Selection.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/Selection.cpp b/clang-tools-extra/clangd/Selection.cpp index e945f5d79b2c..0b10c7a3a6f9 100644 --- a/clang-tools-extra/clangd/Selection.cpp +++ b/clang-tools-extra/clangd/Selection.cpp @@ -500,7 +500,7 @@ class SelectionVisitor : public RecursiveASTVisitor<SelectionVisitor> { // - those without source range information, we don't record those // - those that can't be stored in DynTypedNode. bool TraverseDecl(Decl *X) { - if (X && isa<TranslationUnitDecl>(X)) + if (llvm::isa_and_nonnull<TranslationUnitDecl>(X)) return Base::TraverseDecl(X); // Already pushed by constructor. // Base::TraverseDecl will suppress children, but not this node itself. if (X && X->isImplicit()) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits