From ab2d3ce47d6fead7fb79b3c0c7c4c6ac2b930d45 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Fri, 29 Jan 2021 00:49:53 +0100 Subject: [clang-tidy] Applied clang-tidy fixes. NFC Applied fixes enabled by the LLVM's .clang-tidy configs. Reverted files where fixes introduced compile errors: clang-tools-extra/clang-tidy/hicpp/NoAssemblerCheck.cpp clang-tools-extra/clang-tidy/misc/ThrowByValueCatchByReferenceCheck.cpp $ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -fix clang-tools-extra/clang-tidy/ Enabled checks: llvm-else-after-return llvm-header-guard llvm-include-order llvm-namespace-comment llvm-prefer-isa-or-dyn-cast-in-conditionals llvm-prefer-register-over-unsigned llvm-qualified-auto llvm-twine-local misc-definitions-in-headers misc-misplaced-const misc-new-delete-overloads misc-no-recursion misc-non-copyable-objects misc-redundant-expression misc-static-assert misc-throw-by-value-catch-by-reference misc-unconventional-assign-operator misc-uniqueptr-reset-release misc-unused-alias-decls misc-unused-using-decls readability-identifier-naming Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D95614 --- clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp') diff --git a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp index c20472c..74dd4a3 100644 --- a/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp +++ b/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp @@ -10,8 +10,8 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/Lambda.h" -#include "clang/Basic/SourceManager.h" #include "clang/Basic/SourceLocation.h" +#include "clang/Basic/SourceManager.h" #include "clang/Basic/TokenKinds.h" #include "clang/Lex/Lexer.h" #include "llvm/ADT/APSInt.h" @@ -50,8 +50,8 @@ bool StmtAncestorASTVisitor::TraverseStmt(Stmt *Statement) { /// Scope, as we can map a VarDecl to its DeclStmt, then walk up the parent tree /// using StmtAncestors. bool StmtAncestorASTVisitor::VisitDeclStmt(DeclStmt *Decls) { - for (const auto *decl : Decls->decls()) { - if (const auto *V = dyn_cast(decl)) + for (const auto *Decl : Decls->decls()) { + if (const auto *V = dyn_cast(Decl)) DeclParents.insert(std::make_pair(V, Decls)); } return true; @@ -356,7 +356,7 @@ static bool isAliasDecl(ASTContext *Context, const Decl *TheDecl, bool OnlyCasts = true; const Expr *Init = VDecl->getInit()->IgnoreParenImpCasts(); - if (Init && isa(Init)) { + if (isa_and_nonnull(Init)) { Init = digThroughConstructors(Init); OnlyCasts = false; } -- cgit v1.1