//===--- ImplicitConversionInLoopCheck.cpp - clang-tidy--------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "ImplicitConversionInLoopCheck.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Lexer.h" usingnamespaceclang::ast_matchers; namespace clang::tidy::performance { // Checks if the stmt is a ImplicitCastExpr with a CastKind that is not a NoOp. // The subtlety is that in some cases (user defined conversions), we can // get to ImplicitCastExpr inside each other, with the outer one a NoOp. In this // case we skip the first cast expr. static bool isNonTrivialImplicitCast(const Stmt *ST) { … } void ImplicitConversionInLoopCheck::registerMatchers(MatchFinder *Finder) { … } void ImplicitConversionInLoopCheck::check( const MatchFinder::MatchResult &Result) { … } void ImplicitConversionInLoopCheck::reportAndFix(const ASTContext *Context, const VarDecl *VD, const Expr *OperatorCall) { … } } // namespace clang::tidy::performance