summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-23 21:38:21 +0000
committerAnna Zaks <ganna@apple.com>2012-02-23 21:38:21 +0000
commitdf901a44198015c5c634ae71f86e9f0783588a19 (patch)
tree6b555b34c8f30d0dff7746970c61d9631fc8a56c /clang/lib/StaticAnalyzer/Core/BugReporter.cpp
parentfa31b8ef10abd5bc0ef9ed7dfb3ac77dcaaa668a (diff)
downloadbcm5719-llvm-df901a44198015c5c634ae71f86e9f0783588a19.tar.gz
bcm5719-llvm-df901a44198015c5c634ae71f86e9f0783588a19.zip
[analyzer] Malloc: unique leak reports by allocation site.
When we find two leak reports with the same allocation site, report only one of them. Provide a helper method to BugReporter to facilitate this. llvm-svn: 151287
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
index 0df71f21fb8..0dbc7f115d5 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1270,7 +1270,9 @@ BugReport::~BugReport() {
void BugReport::Profile(llvm::FoldingSetNodeID& hash) const {
hash.AddPointer(&BT);
hash.AddString(Description);
- if (Location.isValid()) {
+ if (UniqueingLocation.isValid()) {
+ UniqueingLocation.Profile(hash);
+ } else if (Location.isValid()) {
Location.Profile(hash);
} else {
assert(ErrorNode);
OpenPOWER on IntegriCloud