]> granicus.if.org Git - clang/commitdiff
Partitioned BugTypeCachedLocation::isCached() into two methods: one that accepts...
authorTed Kremenek <kremenek@apple.com>
Fri, 16 May 2008 18:33:14 +0000 (18:33 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 16 May 2008 18:33:14 +0000 (18:33 +0000)
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

include/clang/Analysis/PathSensitive/BugReporter.h
lib/Analysis/BugReporter.cpp

index 7aefb1c57c324ad19845fbaa65f85c8043bad323..bcb1a24b74beb123cfe5a37fb062600d40a038af 100644 (file)
@@ -58,6 +58,7 @@ public:
   BugTypeCacheLocation() {}
   virtual ~BugTypeCacheLocation() {}  
   virtual bool isCached(BugReport& R);
+  bool isCached(ProgramPoint P);
 };
   
   
index e2d98b0cf60ea7d4649555da7aaf152a35eb0c6b..8ee530c425af29ddbc1a1d31220e4ecd699f288f 100644 (file)
@@ -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;