diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-25 19:03:06 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-25 19:03:06 +0000 |
commit | db72e2fc3737465b26b92dddc3f6124c0fd8e929 (patch) | |
tree | d64fc7779685f7f15c231f6a757293e9f3621dc0 /clang/lib/StaticAnalyzer/Core/SymbolManager.cpp | |
parent | 60d704ab4a019dda8630f85a12f52ac826732e77 (diff) | |
download | bcm5719-llvm-db72e2fc3737465b26b92dddc3f6124c0fd8e929.tar.gz bcm5719-llvm-db72e2fc3737465b26b92dddc3f6124c0fd8e929.zip |
Reapply "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Previously, we'd just keep constraints around forever, which means we'd
never be able to merge paths that differed only in constraints on dead
symbols.
Because we now allow constraints on symbolic expressions, not just single
symbols, this requires changing SymExpr::symbol_iterator to include
intermediate symbol nodes in its traversal, not just the SymbolData leaf
nodes.
This depends on the previous commit to be correct. Originally applied in
r163444, reverted in r164275, now being re-applied.
llvm-svn: 164622
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/SymbolManager.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SymbolManager.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp b/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp index 87b4ba315eb..5334b03b3fc 100644 --- a/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp +++ b/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp @@ -117,21 +117,17 @@ bool SymExpr::symbol_iterator::operator!=(const symbol_iterator &X) const { SymExpr::symbol_iterator::symbol_iterator(const SymExpr *SE) { itr.push_back(SE); - while (!isa<SymbolData>(itr.back())) expand(); } SymExpr::symbol_iterator &SymExpr::symbol_iterator::operator++() { assert(!itr.empty() && "attempting to iterate on an 'end' iterator"); - assert(isa<SymbolData>(itr.back())); - itr.pop_back(); - if (!itr.empty()) - while (!isa<SymbolData>(itr.back())) expand(); + expand(); return *this; } SymbolRef SymExpr::symbol_iterator::operator*() { assert(!itr.empty() && "attempting to dereference an 'end' iterator"); - return cast<SymbolData>(itr.back()); + return itr.back(); } void SymExpr::symbol_iterator::expand() { |