forked from OSchip/llvm-project
[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
This commit is contained in:
parent
38b21d91ff
commit
65b4d7ddd9
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue