diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-14 19:50:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-14 19:50:34 +0000 |
commit | 9fc90c1bf7498dc53862156205ab95868b8b849f (patch) | |
tree | 1c7f30f984ad74ff0eb37e4d3127387732ef7593 | |
parent | 56fb926c93786739cfd0867e7ada31ace3bda946 (diff) |
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
-rw-r--r-- | include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h | 12 |
1 files changed, 12 insertions, 0 deletions
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<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 { |