diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-23 21:38:21 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-23 21:38:21 +0000 |
commit | df901a44198015c5c634ae71f86e9f0783588a19 (patch) | |
tree | 6b555b34c8f30d0dff7746970c61d9631fc8a56c /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | fa31b8ef10abd5bc0ef9ed7dfb3ac77dcaaa668a (diff) | |
download | bcm5719-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.cpp | 4 |
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); |