From 9fc90c1bf7498dc53862156205ab95868b8b849f Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 14 Mar 2011 19:50:34 +0000 Subject: [PATCH] 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 --- .../StaticAnalyzer/Core/BugReporter/BugReporter.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 { -- 2.50.1