[Static Analyzer] Nullability checker optimization.

Differential Revision: http://reviews.llvm.org/D12848

llvm-svn: 247612
This commit is contained in:
Gabor Horvath 2015-09-14 20:31:46 +00:00
parent 553927a78a
commit be87d5bb92
1 changed files with 6 additions and 1 deletions

View File

@ -406,12 +406,17 @@ void NullabilityChecker::reportBugIfPreconditionHolds(
/// Cleaning up the program state.
void NullabilityChecker::checkDeadSymbols(SymbolReaper &SR,
CheckerContext &C) const {
if (!SR.hasDeadSymbols())
return;
ProgramStateRef State = C.getState();
NullabilityMapTy Nullabilities = State->get<NullabilityMap>();
for (NullabilityMapTy::iterator I = Nullabilities.begin(),
E = Nullabilities.end();
I != E; ++I) {
if (!SR.isLiveRegion(I->first)) {
const auto *Region = I->first->getAs<SymbolicRegion>();
assert(Region && "Non-symbolic region is tracked.");
if (SR.isDead(Region->getSymbol())) {
State = State->remove<NullabilityMap>(I->first);
}
}