[analyzer] Fix inefficiency in dead symbol removal
authorPavel Labath <labath@google.com>
Mon, 19 Aug 2013 15:23:34 +0000 (15:23 +0000)
committerPavel Labath <labath@google.com>
Mon, 19 Aug 2013 15:23:34 +0000 (15:23 +0000)
commit71bb9879974ae39d1a8fc0d349c00049571a72d2
treee29e9cd85bac16fa26a040800959cfc1d354af83
parent4a9df8a768823ba74279596da0fabdada25f6de6
[analyzer] Fix inefficiency in dead symbol removal

Summary:
ScanReachableSymbols uses a "visited" set to avoid scanning the same object
twice. However, it did not use the optimization for LazyCompoundVal objects,
which resulted in exponential complexity for long chains of temporary objects.
Adding this resulted in a decrease of analysis time from >3h to 3 seconds for
some files.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1398

llvm-svn: 188677
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h
clang/lib/StaticAnalyzer/Core/ProgramState.cpp