diff options
author | Peter Szecsi <szepet95@gmail.com> | 2017-08-19 11:19:16 +0000 |
---|---|---|
committer | Peter Szecsi <szepet95@gmail.com> | 2017-08-19 11:19:16 +0000 |
commit | 999a25ff7283bd83f105ffb826b85181a30ffa41 (patch) | |
tree | 1109e6b4c4b99cfa0d7ee19acc2c9242aeea91a5 /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | |
parent | 8de103f2f0aab1952d9cb9387a03d84a5b05c63e (diff) | |
download | bcm5719-llvm-999a25ff7283bd83f105ffb826b85181a30ffa41.tar.gz bcm5719-llvm-999a25ff7283bd83f105ffb826b85181a30ffa41.zip |
[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
llvm-svn: 311235
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index d5d6527f4fc..48e3e22af04 100644 --- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -183,6 +183,11 @@ bool AnalyzerOptions::includeLifetimeInCFG() { /* Default = */ false); } +bool AnalyzerOptions::includeLoopExitInCFG() { + return getBooleanOption(IncludeLoopExitInCFG, "cfg-loopexit", + /* Default = */ false); +} + bool AnalyzerOptions::mayInlineCXXStandardLibrary() { return getBooleanOption(InlineCXXStandardLibrary, "c++-stdlib-inlining", |