[analyzer] Memoize complexity of SymExpr
authorMikhail R. Gadelha <mikhail.ramalho@gmail.com>
Thu, 19 Jul 2018 17:03:12 +0000 (17:03 +0000)
committerMikhail R. Gadelha <mikhail.ramalho@gmail.com>
Thu, 19 Jul 2018 17:03:12 +0000 (17:03 +0000)
commitddd4229cc402cc74c656501614f694c977f45519
tree2f07092386c784f8b8931e7ecb5adc66b7d36bbc
parent8c7a30baea219e8143b13e3e384ff713d8bb7c76
[analyzer] Memoize complexity of SymExpr

Summary:
This patch introduces a new member to SymExpr, which stores the symbol complexity, avoiding recalculating it every time computeComplexity() is called.

Also, increase the complexity of conjured Symbols by one, so it's clear that it has a greater complexity than its underlying symbols.

Reviewers: NoQ, george.karpenkov

Reviewed By: NoQ, george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

Differential Revision: https://reviews.llvm.org/D49232

llvm-svn: 337472
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
clang/lib/StaticAnalyzer/Core/SymbolManager.cpp