]> granicus.if.org Git - clang/commit
[CFG] Add LoopExit information to CFG
authorPeter Szecsi <szepet95@gmail.com>
Sat, 19 Aug 2017 11:19:16 +0000 (11:19 +0000)
committerPeter Szecsi <szepet95@gmail.com>
Sat, 19 Aug 2017 11:19:16 +0000 (11:19 +0000)
commit7e86b10209db22f6da6da396be760b2e10de24bb
tree16945fa4c5a9d1eacbd3277b29e91fff725f8334
parente017f9615d3a4ff53f47984e8293ef68361cf3cf
[CFG] Add LoopExit information to CFG

This patch introduces a new CFG element CFGLoopExit that indicate when a loop
ends. It does not deal with returnStmts yet (left it as a TODO).
It hidden behind a new analyzer-config flag called cfg-loopexit (false by
default).
Test cases added.

The main purpose of this patch right know is to make loop unrolling and loop
widening easier and more efficient. However, this information can be useful for
future improvements in the StaticAnalyzer core too.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311235 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Analysis/AnalysisContext.h
include/clang/Analysis/CFG.h
include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
lib/Analysis/AnalysisDeclContext.cpp
lib/Analysis/CFG.cpp
lib/StaticAnalyzer/Core/AnalysisManager.cpp
lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
test/Analysis/analyzer-config.c
test/Analysis/analyzer-config.cpp
test/Analysis/loopexit-cfg-output.cpp [new file with mode: 0644]