[cfe-commits] r51197 - in /cfe/trunk: include/clang/Analysis/PathSensitive/BugReporter.h lib/Analysis/BugReporter.cpp

Ted Kremenek kremenek at apple.com
Fri May 16 11:33:15 PDT 2008


Author: kremenek
Date: Fri May 16 13:33:14 2008
New Revision: 51197

URL: http://llvm.org/viewvc/llvm-project?rev=51197&view=rev
Log:
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.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
    cfe/trunk/lib/Analysis/BugReporter.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h?rev=51197&r1=51196&r2=51197&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/BugReporter.h Fri May 16 13:33:14 2008
@@ -58,6 +58,7 @@
   BugTypeCacheLocation() {}
   virtual ~BugTypeCacheLocation() {}  
   virtual bool isCached(BugReport& R);
+  bool isCached(ProgramPoint P);
 };
   
   

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=51197&r1=51196&r2=51197&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Fri May 16 13:33:14 2008
@@ -448,7 +448,12 @@
   // 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;





More information about the cfe-commits mailing list