aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-16 18:33:14 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-16 18:33:14 +0000
commit76d90c8bf83d071fd1bdbffa6d9f2af87c6bb7b5 (patch)
tree8a9396abb9fba9467fc6d773fde6154c8662c2ea
parentba2561a0ab11afa64014828c759c491378ccc539 (diff)
Partitioned BugTypeCachedLocation::isCached() into two methods: one that accepts and ExplodedNode, and the other that accepts a ProgramPoint. The default behavior is to cache bug reports by the
location they occur (the end node). Subclasses can override this behavior by providing a different ProgramPoint. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51197 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/BugReporter.h1
-rw-r--r--lib/Analysis/BugReporter.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h
index 7aefb1c57c..bcb1a24b74 100644
--- a/include/clang/Analysis/PathSensitive/BugReporter.h
+++ b/include/clang/Analysis/PathSensitive/BugReporter.h
@@ -58,6 +58,7 @@ public:
BugTypeCacheLocation() {}
virtual ~BugTypeCacheLocation() {}
virtual bool isCached(BugReport& R);
+ bool isCached(ProgramPoint P);
};
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index e2d98b0cf6..8ee530c425 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -448,7 +448,12 @@ bool BugTypeCacheLocation::isCached(BugReport& R) {
// warning for the same error type that occurs at the same program
// location but along a different path.
- void* p = N->getLocation().getRawData();
+ return isCached(N->getLocation());
+}
+
+bool BugTypeCacheLocation::isCached(ProgramPoint P) {
+
+ void* p = P.getRawData();
if (CachedErrors.count(p))
return true;