diff options
| author | Artem Dergachev <artem.dergachev@gmail.com> | 2018-10-15 17:47:56 +0000 |
|---|---|---|
| committer | Artem Dergachev <artem.dergachev@gmail.com> | 2018-10-15 17:47:56 +0000 |
| commit | 65b4d7ddd9bc04c239ed344c0a3bbb7a46e81887 (patch) | |
| tree | 13e69b5c014968dc020c69e97167ccacf444f929 /clang/lib/StaticAnalyzer/Checkers | |
| parent | 38b21d91ffde2bd6f0b260c4f10776062e374a00 (diff) | |
| download | bcm5719-llvm-65b4d7ddd9bc04c239ed344c0a3bbb7a46e81887.tar.gz bcm5719-llvm-65b4d7ddd9bc04c239ed344c0a3bbb7a46e81887.zip | |
[analyzer] NFC: RetainCountChecker: Don't dump() symbols into program point tags.
We don't need a separate node for every symbol, because whenever the first
symbol leaks, a bug is emitted, the analysis is sinked, and the checker
callback immediately returns due to State variable turning into null,
so we never get to see the second leaking symbol.
Additionally, we are no longer able to break normal analysis while experimenting
with debug dumps.
Differential Revision: https://reviews.llvm.org/D52804
llvm-svn: 344538
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp index 1608bade7e9..8585a02aab0 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp @@ -1314,19 +1314,6 @@ void RetainCountChecker::checkEndFunction(const ReturnStmt *RS, processLeaks(state, Leaked, Ctx, Pred); } -const ProgramPointTag * -RetainCountChecker::getDeadSymbolTag(SymbolRef sym) const { - const CheckerProgramPointTag *&tag = DeadSymbolTags[sym]; - if (!tag) { - SmallString<64> buf; - llvm::raw_svector_ostream out(buf); - out << "Dead Symbol : "; - sym->dumpToStream(out); - tag = new CheckerProgramPointTag(this, out.str()); - } - return tag; -} - void RetainCountChecker::checkDeadSymbols(SymbolReaper &SymReaper, CheckerContext &C) const { ExplodedNode *Pred = C.getPredecessor(); @@ -1342,8 +1329,8 @@ void RetainCountChecker::checkDeadSymbols(SymbolReaper &SymReaper, if (const RefVal *T = B.lookup(Sym)){ // Use the symbol as the tag. // FIXME: This might not be as unique as we would like. - const ProgramPointTag *Tag = getDeadSymbolTag(Sym); - state = handleAutoreleaseCounts(state, Pred, Tag, C, Sym, *T); + static CheckerProgramPointTag Tag(this, "DeadSymbolAutorelease"); + state = handleAutoreleaseCounts(state, Pred, &Tag, C, Sym, *T); if (!state) return; |

