summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BadCallChecker.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-11 05:50:44 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-11 05:50:44 +0000
commit4325315935c4adc4c2efa96832b62c5efe7d16ce (patch)
treed9f41e592c5cb1d60feee4aa4b872265967fd0e7 /clang/lib/Analysis/BadCallChecker.cpp
parentde142beafb43f85b654e7aa191311ddd074b6155 (diff)
downloadbcm5719-llvm-4325315935c4adc4c2efa96832b62c5efe7d16ce.tar.gz
bcm5719-llvm-4325315935c4adc4c2efa96832b62c5efe7d16ce.zip
Remove public headers for UndefinedArgChecker, AttrNonNullChecker, and BadCallChecker, making their implementations completely private.
llvm-svn: 86809
Diffstat (limited to 'clang/lib/Analysis/BadCallChecker.cpp')
-rw-r--r--clang/lib/Analysis/BadCallChecker.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/clang/lib/Analysis/BadCallChecker.cpp b/clang/lib/Analysis/BadCallChecker.cpp
index 33bb5158d2b..4175e8d1410 100644
--- a/clang/lib/Analysis/BadCallChecker.cpp
+++ b/clang/lib/Analysis/BadCallChecker.cpp
@@ -12,14 +12,27 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/Analysis/PathSensitive/Checkers/BadCallChecker.h"
+#include "clang/Analysis/PathSensitive/CheckerVisitor.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
+#include "GRExprEngineInternalChecks.h"
using namespace clang;
-void *BadCallChecker::getTag() {
- static int x = 0;
- return &x;
+namespace {
+class VISIBILITY_HIDDEN BadCallChecker : public CheckerVisitor<BadCallChecker> {
+ BuiltinBug *BT;
+public:
+ BadCallChecker() : BT(0) {}
+ static void *getTag() {
+ static int x = 0;
+ return &x;
+ }
+ void PreVisitCallExpr(CheckerContext &C, const CallExpr *CE);
+};
+} // end anonymous namespace
+
+void clang::RegisterBadCallChecker(GRExprEngine &Eng) {
+ Eng.registerCheck(new BadCallChecker());
}
void BadCallChecker::PreVisitCallExpr(CheckerContext &C, const CallExpr *CE) {
@@ -29,7 +42,7 @@ void BadCallChecker::PreVisitCallExpr(CheckerContext &C, const CallExpr *CE) {
if (L.isUndef() || isa<loc::ConcreteInt>(L)) {
if (ExplodedNode *N = C.GenerateNode(CE, true)) {
if (!BT)
- BT = new BuiltinBug(0, "Invalid function call",
+ BT = new BuiltinBug("Invalid function call",
"Called function pointer is a null or undefined pointer value");
EnhancedBugReport *R =
OpenPOWER on IntegriCloud