[PATCH] D12848: [Static Analyzer] Nullability checker optimization.
Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 13:33:17 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL247612: [Static Analyzer] Nullability checker optimization. (authored by xazax).
Changed prior to commit:
http://reviews.llvm.org/D12848?vs=34693&id=34725#toc
Repository:
rL LLVM
http://reviews.llvm.org/D12848
Files:
cfe/trunk/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
@@ -406,12 +406,17 @@
/// 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);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12848.34725.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150914/8a9f4e69/attachment-0001.bin>
More information about the cfe-commits
mailing list