aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2021-01-29 00:49:53 +0100
committerAlexander Kornienko <alexfh@google.com>2021-01-29 01:01:19 +0100
commitab2d3ce47d6fead7fb79b3c0c7c4c6ac2b930d45 (patch)
treee0508e1690f4d6d8b3b93b4cc68d67f0bc0d8914 /clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp
parenta1a3fdcdba52c9d0a045af5f68365c273467b127 (diff)
downloadllvm-ab2d3ce47d6fead7fb79b3c0c7c4c6ac2b930d45.zip
llvm-ab2d3ce47d6fead7fb79b3c0c7c4c6ac2b930d45.tar.gz
llvm-ab2d3ce47d6fead7fb79b3c0c7c4c6ac2b930d45.tar.bz2
[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
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/LoopConvertUtils.cpp8
1 files changed, 4 insertions, 4 deletions
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<VarDecl>(decl))
+ for (const auto *Decl : Decls->decls()) {
+ if (const auto *V = dyn_cast<VarDecl>(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<CXXConstructExpr>(Init)) {
+ if (isa_and_nonnull<CXXConstructExpr>(Init)) {
Init = digThroughConstructors(Init);
OnlyCasts = false;
}