Refactor bad callee check into a Checker.
Now bad callee is checked as a PreVisit to the CallExpr.
llvm-svn: 80771
diff --git a/clang/lib/Analysis/BugReporterVisitors.cpp b/clang/lib/Analysis/BugReporterVisitors.cpp
index 5c31066..fce31e7 100644
--- a/clang/lib/Analysis/BugReporterVisitors.cpp
+++ b/clang/lib/Analysis/BugReporterVisitors.cpp
@@ -63,7 +63,8 @@
const Stmt*
clang::bugreporter::GetCalleeExpr(const ExplodedNode *N) {
- const Stmt *S = N->getLocationAs<PostStmt>()->getStmt();
+ // Callee is checked as a PreVisit to the CallExpr.
+ const Stmt *S = N->getLocationAs<PreStmt>()->getStmt();
if (const CallExpr *CE = dyn_cast<CallExpr>(S))
return CE->getCallee();
return NULL;