From 999a25ff7283bd83f105ffb826b85181a30ffa41 Mon Sep 17 00:00:00 2001 From: Peter Szecsi Date: Sat, 19 Aug 2017 11:19:16 +0000 Subject: [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 --- clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp') 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", -- cgit v1.2.3