diff options
author | Anna Zaks <ganna@apple.com> | 2013-01-24 23:15:30 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-01-24 23:15:30 +0000 |
commit | bfa9ab8183e2fdc74f8633d758cb0c6201314320 (patch) | |
tree | 24055b04dc47114dda7b5d51a870049489724192 /lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | |
parent | 73f0563009a6715a5d3d41f664f5bfab5096d51f (diff) |
[analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".
The idea is to eventually place all analyzer options under
"analyzer-config". In addition, this lays the ground for introduction of
a high-level analyzer mode option, which will influence the
default setting for IPAMode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index a336f04c8f..107b739c17 100644 --- a/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -20,9 +20,31 @@ using namespace clang; using namespace llvm; +IPAKind AnalyzerOptions::getIPAMode() { + if (IPAMode == IPAK_NotSet) { + + // Lookup the ipa configuration option, use the default from User Mode. + StringRef ModeStr(Config.GetOrCreateValue("ipa", + "dynamic-bifurcate").getValue()); + IPAKind IPAConfig = llvm::StringSwitch<IPAKind>(ModeStr) + .Case("none", IPAK_None) + .Case("basic-inlining", IPAK_BasicInlining) + .Case("inlining", IPAK_Inlining) + .Case("dynamic", IPAK_DynamicDispatch) + .Case("dynamic-bifurcate", IPAK_DynamicDispatchBifurcate) + .Default(IPAK_NotSet); + assert(IPAConfig != IPAK_NotSet && "IPA Mode is not set or invalid."); + + // Set the member variable. + IPAMode = IPAConfig; + } + + return IPAMode; +} + bool AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) { - if (getIPAMode() < Inlining) + if (getIPAMode() < IPAK_Inlining) return false; if (!CXXMemberInliningMode) { |