#include <FiniteMathChecker.h>
|
void | checkPreStmt (const clang::CallExpr *ref, clang::ento::CheckerContext &C) const |
|
|
std::unique_ptr< clang::ento::BugType > | BT |
|
Definition at line 11 of file FiniteMathChecker.h.
◆ checkPreStmt()
void clangcms::FiniteMathChecker::checkPreStmt |
( |
const clang::CallExpr * |
ref, |
|
|
clang::ento::CheckerContext & |
C |
|
) |
| const |
Definition at line 14 of file FiniteMathChecker.cc.
15 const clang::ento::ProgramStateRef state = ctx.getState();
16 const clang::LocationContext *LC = ctx.getLocationContext();
17 const clang::Expr *Callee = CE->getCallee();
18 const clang::FunctionDecl *FD = state->getSVal(Callee, LC).getAsFunctionDecl();
24 clang::IdentifierInfo *II = FD->getIdentifier();
28 if (!II->isStr(
"isnan") && !II->isStr(
"isinf"))
31 clang::ento::ExplodedNode *
N = ctx.generateErrorNode();
36 BT.reset(
new clang::ento::BugType(
this,
37 "std::isnan / std::isinf does not work when fast-math is used. Please use "
38 "edm::isNotFinite from 'FWCore/Utilities/interface/isFinite.h'",
41 std::unique_ptr<clang::ento::BugReport>
report = llvm::make_unique<clang::ento::BugReport>(*
BT,
BT->getName(),
N);
42 report->addRange(Callee->getSourceRange());
References BT, eostools::move(), N, and edmIntegrityCheck::report.
◆ BT
std::unique_ptr<clang::ento::BugType> clangcms::FiniteMathChecker::BT |
|
mutableprivate |