Incorporate source ranges for RangeBugReport when coelescing reports into equivalence classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127604 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
index 93d7958..7c3c6bf 100644
--- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
@@ -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 {