#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.
void clangcms::FiniteMathChecker::checkPreStmt |
( |
const clang::CallExpr * |
ref, |
|
|
clang::ento::CheckerContext & |
C |
|
) |
| const |
Definition at line 14 of file FiniteMathChecker.cc.
References BT, N, and zeeHLT_cff::report.
16 const clang::ento::ProgramStateRef state = ctx.getState();
17 const clang::LocationContext *LC = ctx.getLocationContext();
18 const clang::Expr *Callee = CE->getCallee();
19 const clang::FunctionDecl *FD = state->getSVal(Callee, LC).getAsFunctionDecl();
25 clang::IdentifierInfo *II = FD->getIdentifier();
29 if (!II->isStr(
"isnan") && !II->isStr(
"isinf"))
32 clang::ento::ExplodedNode *
N = ctx.generateSink();
37 BT.reset(
new clang::ento::BugType(
this,
"std::isnan / std::isinf does not work when fast-math is used. Please use edm::isNotFinite from 'FWCore/Utilities/interface/isNotFinite.h'",
"fastmath plugin"));
39 clang::ento::BugReport *
report =
new clang::ento::BugReport(*
BT,
BT->getName(),
N);
40 report->addRange(Callee->getSourceRange());
41 ctx.emitReport(report);
std::unique_ptr< clang::ento::BugType > BT
std::unique_ptr<clang::ento::BugType> clangcms::FiniteMathChecker::BT |
|
mutableprivate |