aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-10-30 17:24:47 +0000
committerTed Kremenek <kremenek@apple.com>2009-10-30 17:24:47 +0000
commitbc3a021df7f9ee4c4d1e9ec3c2aac2ef6d883206 (patch)
treea12d858247d376c98698b692c2dd66d8762c8ea7 /include/clang/Analysis
parent3f7c7f48654230d8e379214cfe49fcf2fde0a2c6 (diff)
Move all logic for the null dereference checker from GRExprEngineInternalChecks.cpp to a separate .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis')
-rw-r--r--include/clang/Analysis/PathSensitive/NullDerefChecker.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/include/clang/Analysis/PathSensitive/NullDerefChecker.h b/include/clang/Analysis/PathSensitive/NullDerefChecker.h
index 05c4b360f8..6905d6834b 100644
--- a/include/clang/Analysis/PathSensitive/NullDerefChecker.h
+++ b/include/clang/Analysis/PathSensitive/NullDerefChecker.h
@@ -1,4 +1,4 @@
-//== NullDerefChecker - Null dereference checker ----------------*- C++ -*--==//
+//== NullDerefChecker.h - Null dereference checker --------------*- C++ -*--==//
//
// The LLVM Compiler Infrastructure
//
@@ -6,6 +6,11 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// This defines NullDerefChecker, a builtin check in GRExprEngine that performs
+// checks for null pointers at loads and stores.
+//
+//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_NULLDEREFCHECKER
#define LLVM_CLANG_NULLDEREFCHECKER
@@ -17,31 +22,16 @@ namespace clang {
class ExplodedNode;
-class NullDeref : public BuiltinBug {
-public:
- NullDeref()
- : BuiltinBug(0, "Null dereference", "Dereference of null pointer") {}
-
- void registerInitialVisitors(BugReporterContext& BRC,
- const ExplodedNode* N,
- BuiltinBugReport *R);
-};
-
class NullDerefChecker : public Checker {
- NullDeref *BT;
+ BuiltinBug *BT;
llvm::SmallVector<ExplodedNode*, 2> ImplicitNullDerefNodes;
public:
-
NullDerefChecker() : BT(0) {}
ExplodedNode *CheckLocation(const Stmt *S, ExplodedNode *Pred,
const GRState *state, SVal V,GRExprEngine &Eng);
- static void *getTag() {
- static int x = 0;
- return &x;
- }
-
+ static void *getTag();
typedef llvm::SmallVectorImpl<ExplodedNode*>::iterator iterator;
iterator implicit_nodes_begin() { return ImplicitNullDerefNodes.begin(); }
iterator implicit_nodes_end() { return ImplicitNullDerefNodes.end(); }