[cfe-commits] r127604 - /cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

Ted Kremenek kremenek at apple.com
Mon Mar 14 12:50:34 PDT 2011


Author: kremenek
Date: Mon Mar 14 14:50:34 2011
New Revision: 127604

URL: http://llvm.org/viewvc/llvm-project?rev=127604&view=rev
Log:
Incorporate source ranges for RangeBugReport when coelescing reports into equivalence classes.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h?rev=127604&r1=127603&r2=127604&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h Mon Mar 14 14:50:34 2011
@@ -219,6 +219,18 @@
   virtual std::pair<ranges_iterator, ranges_iterator> getRanges() const {
     return std::make_pair(Ranges.begin(), Ranges.end());
   }
+  
+  virtual void Profile(llvm::FoldingSetNodeID& hash) const {
+    BugReport::Profile(hash);
+    for (llvm::SmallVectorImpl<SourceRange>::const_iterator I =
+          Ranges.begin(), E = Ranges.end(); I != E; ++I) {
+      const SourceRange range = *I;
+      if (!range.isValid())
+        continue;
+      hash.AddInteger(range.getBegin().getRawEncoding());
+      hash.AddInteger(range.getEnd().getRawEncoding());
+    }
+  }
 };
 
 class EnhancedBugReport : public RangedBugReport {





More information about the cfe-commits mailing list