#include "TooSmallLoopVariableCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::bugprone {
static constexpr llvm::StringLiteral LoopName = …;
static constexpr llvm::StringLiteral LoopVarName = …;
static constexpr llvm::StringLiteral LoopVarCastName = …;
static constexpr llvm::StringLiteral LoopUpperBoundName = …;
static constexpr llvm::StringLiteral LoopIncrementName = …;
namespace {
struct MagnitudeBits { … };
}
TooSmallLoopVariableCheck::TooSmallLoopVariableCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void TooSmallLoopVariableCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) { … }
void TooSmallLoopVariableCheck::registerMatchers(MatchFinder *Finder) { … }
static MagnitudeBits calcMagnitudeBits(const ASTContext &Context,
const QualType &IntExprType,
const Expr *IntExpr) { … }
static MagnitudeBits
calcUpperBoundMagnitudeBits(const ASTContext &Context, const Expr *UpperBound,
const QualType &UpperBoundType) { … }
static std::string formatIntegralType(const QualType &Type,
const MagnitudeBits &Info) { … }
void TooSmallLoopVariableCheck::check(const MatchFinder::MatchResult &Result) { … }
}