]> granicus.if.org Git - clang/commit
[analyzer] Add an option to re-analyze a dead-end path without inlining.
authorAnna Zaks <ganna@apple.com>
Tue, 27 Mar 2012 20:02:53 +0000 (20:02 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 27 Mar 2012 20:02:53 +0000 (20:02 +0000)
commit5903a373db3d27794c90b25687e0dd6adb0e497d
treebd6856ba9211a374caf8e83a3be41f825747eae0
parent14d83810b14a558b4d3671c75b6d0f5608898d9e
[analyzer] Add an option to re-analyze a dead-end path without inlining.

The analyzer gives up path exploration under certain conditions. For
example, when the same basic block has been visited more than 4 times.
With inlining turned on, this could lead to decrease in code coverage.
Specifically, if we give up inside the inlined function, the rest of
parent's basic blocks will not get analyzed.

This commit introduces an option to enable re-run along the failed path,
in which we do not inline the last inlined call site. This is done by
enqueueing the node before the processing of the inlined call site
with a special policy encoded in the state. The policy tells us not to
inline the call site along the path.

This lead to ~10% increase in the number of paths analyzed. Even though
we expected a much greater coverage improvement.

The option is turned off by default for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153534 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/Analysis/ProgramPoint.h
include/clang/Driver/CC1Options.td
include/clang/Frontend/AnalyzerOptions.h
include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h
lib/Frontend/CompilerInvocation.cpp
lib/StaticAnalyzer/Core/AnalysisManager.cpp
lib/StaticAnalyzer/Core/CoreEngine.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
test/Analysis/coverage.c [new file with mode: 0644]