aboutsummaryrefslogtreecommitdiff
path: root/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-01-30 19:12:39 +0000
committerAnna Zaks <ganna@apple.com>2013-01-30 19:12:39 +0000
commitac3a3e7a402cd349dd2b7d70cd92c5fe702ae831 (patch)
treeb761ab90ee475c48993bb89457a7544648774fdb /include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
parent6bbe1442a5f3f5f761582a9005e9edf1d49c4da2 (diff)
[analyzer] Make shallow mode more shallow.
Redefine the shallow mode to inline all functions for which we have a definite definition (ipa=inlining). However, only inline functions that are up to 4 basic blocks large and cut the max exploded nodes generated per top level function in half. This makes shallow faster and allows us to keep inlining small functions. For example, we would keep inlining wrapper functions and constructors/destructors. With the new shallow, it takes 104s to analyze sqlite3, whereas the deep mode is 658s and previous shallow is 209s. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/AnalyzerOptions.h')
-rw-r--r--include/clang/StaticAnalyzer/Core/AnalyzerOptions.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
index 9b9749df98..e1fe082049 100644
--- a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
+++ b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
@@ -132,9 +132,6 @@ public:
std::string AnalyzeSpecificFunction;
- /// \brief The maximum number of exploded nodes the analyzer will generate.
- unsigned MaxNodes;
-
/// \brief The maximum number of times the analyzer visits a block.
unsigned maxBlockVisitOnPath;
@@ -223,6 +220,9 @@ private:
/// \sa getMaxTimesInlineLarge
llvm::Optional<unsigned> MaxTimesInlineLarge;
+ /// \sa getMaxNodesPerTopLevelFunction
+ llvm::Optional<unsigned> MaxNodesPerTopLevelFunction;
+
/// Interprets an option's string value as a boolean.
///
/// Accepts the strings "true" and "false".
@@ -332,6 +332,13 @@ public:
/// This is controlled by the 'max-times-inline-large' config option.
unsigned getMaxTimesInlineLarge();
+ /// Returns the maximum number of nodes the analyzer can generate while
+ /// exploring a top level function (for each exploded graph).
+ /// 150000 is default; 0 means no limit.
+ ///
+ /// This is controlled by the 'max-nodes' config option.
+ unsigned getMaxNodesPerTopLevelFunction();
+
public:
AnalyzerOptions() :
AnalysisStoreOpt(RegionStoreModel),