summaryrefslogtreecommitdiffstats
path: root/clang
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
commit590abd363ee157086e3d8286456f6fe8c428dccf (patch)
tree25b44d0293fab7dd78e0b54571684cf72037cfb3 /clang
parent823622105e85cc8edb0065af7463886068f4ba15 (diff)
downloadbcm5719-llvm-590abd363ee157086e3d8286456f6fe8c428dccf.tar.gz
bcm5719-llvm-590abd363ee157086e3d8286456f6fe8c428dccf.zip
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. llvm-svn: 51197
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Analysis/PathSensitive/BugReporter.h1
-rw-r--r--clang/lib/Analysis/BugReporter.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/BugReporter.h b/clang/include/clang/Analysis/PathSensitive/BugReporter.h
index 7aefb1c57c3..bcb1a24b74b 100644
--- a/clang/include/clang/Analysis/PathSensitive/BugReporter.h
+++ b/clang/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/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index e2d98b0cf60..8ee530c425a 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud