summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-19 03:06:06 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-19 03:06:06 +0000
commit13156b689e67e2857769f96adad141203d844e16 (patch)
treedcb4058a1a9dd9a0466a5d6ee8eacefc8981358d /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
parent8e6cf9e5791083103ea711200b8315520c502adb (diff)
downloadbcm5719-llvm-13156b689e67e2857769f96adad141203d844e16.tar.gz
bcm5719-llvm-13156b689e67e2857769f96adad141203d844e16.zip
Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.
llvm-svn: 222306
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index 7944c7eb000..4ec3d2750e5 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -23,7 +23,8 @@ using namespace llvm;
AnalyzerOptions::UserModeKind AnalyzerOptions::getUserMode() {
if (UserMode == UMK_NotSet) {
- StringRef ModeStr(Config.GetOrCreateValue("mode", "deep").getValue());
+ StringRef ModeStr =
+ Config.insert(std::make_pair("mode", "deep")).first->second;
UserMode = llvm::StringSwitch<UserModeKind>(ModeStr)
.Case("shallow", UMK_Shallow)
.Case("deep", UMK_Deep)
@@ -48,7 +49,8 @@ IPAKind AnalyzerOptions::getIPAMode() {
assert(DefaultIPA);
// Lookup the ipa configuration option, use the default from User Mode.
- StringRef ModeStr(Config.GetOrCreateValue("ipa", DefaultIPA).getValue());
+ StringRef ModeStr =
+ Config.insert(std::make_pair("ipa", DefaultIPA)).first->second;
IPAKind IPAConfig = llvm::StringSwitch<IPAKind>(ModeStr)
.Case("none", IPAK_None)
.Case("basic-inlining", IPAK_BasicInlining)
@@ -72,9 +74,9 @@ AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) {
if (!CXXMemberInliningMode) {
static const char *ModeKey = "c++-inlining";
-
- StringRef ModeStr(Config.GetOrCreateValue(ModeKey,
- "destructors").getValue());
+
+ StringRef ModeStr =
+ Config.insert(std::make_pair(ModeKey, "destructors")).first->second;
CXXInlineableMemberKind &MutableMode =
const_cast<CXXInlineableMemberKind &>(CXXMemberInliningMode);
@@ -102,7 +104,8 @@ bool AnalyzerOptions::getBooleanOption(StringRef Name, bool DefaultVal) {
// FIXME: We should emit a warning here if the value is something other than
// "true", "false", or the empty string (meaning the default value),
// but the AnalyzerOptions doesn't have access to a diagnostic engine.
- StringRef V(Config.GetOrCreateValue(Name, toString(DefaultVal)).getValue());
+ StringRef V =
+ Config.insert(std::make_pair(Name, toString(DefaultVal))).first->second;
return llvm::StringSwitch<bool>(V)
.Case("true", true)
.Case("false", false)
@@ -201,7 +204,7 @@ int AnalyzerOptions::getOptionAsInteger(StringRef Name, int DefaultVal) {
llvm::raw_svector_ostream OS(StrBuf);
OS << DefaultVal;
- StringRef V(Config.GetOrCreateValue(Name, OS.str()).getValue());
+ StringRef V = Config.insert(std::make_pair(Name, OS.str())).first->second;
int Res = DefaultVal;
bool b = V.getAsInteger(10, Res);
assert(!b && "analyzer-config option should be numeric");
OpenPOWER on IntegriCloud