From: Ted Kremenek Date: Mon, 14 Mar 2011 19:50:34 +0000 (+0000) Subject: Incorporate source ranges for RangeBugReport when coelescing reports into equivalence... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fc90c1bf7498dc53862156205ab95868b8b849f;p=clang 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 93d795831d..7c3c6bf96f 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -219,6 +219,18 @@ public: virtual std::pair getRanges() const { return std::make_pair(Ranges.begin(), Ranges.end()); } + + virtual void Profile(llvm::FoldingSetNodeID& hash) const { + BugReport::Profile(hash); + for (llvm::SmallVectorImpl::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 {