10#include "clang/AST/ASTContext.h"
11#include "clang/ASTMatchers/ASTMatchFinder.h"
18 Finder->addMatcher(castExpr(hasCastKind(CK_IntegralToPointer),
19 unless(hasSourceExpression(integerLiteral())))
25 const auto *MatchedCast = Result.Nodes.getNodeAs<CastExpr>(
"x");
26 diag(MatchedCast->getBeginLoc(),
27 "integer to pointer cast pessimizes optimization opportunities");
DiagnosticBuilder diag(SourceLocation Loc, StringRef Description, DiagnosticIDs::Level Level=DiagnosticIDs::Warning)
Add a diagnostic with the check's name.