11 #include "clang/AST/ASTContext.h" 12 #include "clang/ASTMatchers/ASTMatchFinder.h" 20 void FloatLoopCounter::registerMatchers(MatchFinder *Finder) {
22 forStmt(hasIncrement(expr(hasType(realFloatingPointType())))).bind(
"for"),
26 void FloatLoopCounter::check(
const MatchFinder::MatchResult &
Result) {
27 const auto *FS = Result.Nodes.getNodeAs<ForStmt>(
"for");
29 diag(FS->getInc()->getExprLoc(),
"loop induction expression should not have " 30 "floating-point type");
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//