aboutsummaryrefslogtreecommitdiff
path: root/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-09-10 22:37:19 +0000
committerAnna Zaks <ganna@apple.com>2012-09-10 22:37:19 +0000
commit7229d0011766c174beffe6a846d78f448f845b39 (patch)
treec6c004f9d5ac847f1fda118d9b38301aef304d16 /include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
parent654f1d508cbc9553f4931b340dfa19b453f72ebd (diff)
[analyzer] Add ipa-always-inline-size option (with 3 as the default).
The option allows to always inline very small functions, whose size (in number of basic blocks) is set using -analyzer-config ipa-always-inline-size option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/StaticAnalyzer/Core/AnalyzerOptions.h')
-rw-r--r--include/clang/StaticAnalyzer/Core/AnalyzerOptions.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
index eb3f8e4271..72e614d3e7 100644
--- a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
+++ b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
@@ -18,9 +18,9 @@
#include <string>
#include <vector>
#include "clang/Basic/LLVM.h"
-#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/StringMap.h"
namespace clang {
class ASTConsumer;
@@ -177,6 +177,10 @@ private:
/// \sa mayInlineTemplateFunctions
llvm::Optional<bool> InlineTemplateFunctions;
+
+ // Cache of the "ipa-always-inline-size" setting.
+ // \sa getAlwaysInlineSize
+ llvm::Optional<unsigned> AlwaysInlineSize;
/// Interprets an option's string value as a boolean.
///
@@ -184,6 +188,9 @@ private:
/// If an option value is not provided, returns the given \p DefaultVal.
bool getBooleanOption(StringRef Name, bool DefaultVal) const;
+ /// Interprets an option's string value as an integer value.
+ int getOptionAsInteger(llvm::StringRef Name, int DefaultVal) const;
+
public:
/// Returns the option controlling which C++ member functions will be
/// considered for inlining.
@@ -213,6 +220,12 @@ public:
/// accepts the values "true" and "false".
bool mayInlineTemplateFunctions() const;
+ // Returns the size of the functions (in basic blocks), which should be
+ // considered to be small enough to always inline.
+ //
+ // This is controlled by "ipa-always-inline-size" analyzer-config option.
+ unsigned getAlwaysInlineSize() const;
+
public:
AnalyzerOptions() : CXXMemberInliningMode() {
AnalysisStoreOpt = RegionStoreModel;