summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-02-13 13:42:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-02-13 13:42:54 +0000
commit0772c42385c0d005db0ba75ecbcc54d353763282 (patch)
treed1dc6509a577aee07be533cbae15939b0aa32f2c /clang/lib/StaticAnalyzer/Core
parent2193e23cd72731c0d46a4ca8f09efe88b1c5f7b2 (diff)
downloadbcm5719-llvm-0772c42385c0d005db0ba75ecbcc54d353763282.tar.gz
bcm5719-llvm-0772c42385c0d005db0ba75ecbcc54d353763282.zip
Reduce the number of implicit StringRef->std::string conversions by threading StringRef through more APIs.
No functionality change intended. llvm-svn: 260815
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r--clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp6
-rw-r--r--clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
index b3edb8569bd..3a18956e413 100644
--- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -412,13 +412,13 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
// Output a maximum size.
if (!isa<PathDiagnosticMacroPiece>(P)) {
// Get the string and determining its maximum substring.
- const std::string& Msg = P.getString();
+ const auto &Msg = P.getString();
unsigned max_token = 0;
unsigned cnt = 0;
unsigned len = Msg.size();
- for (std::string::const_iterator I=Msg.begin(), E=Msg.end(); I!=E; ++I)
- switch (*I) {
+ for (char C : Msg)
+ switch (C) {
default:
++cnt;
continue;
diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index 55e1222e0ac..8ad931acdf7 100644
--- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -124,7 +124,7 @@ static void ReportControlFlow(raw_ostream &o,
--indent;
// Output any helper text.
- const std::string& s = P.getString();
+ const auto &s = P.getString();
if (!s.empty()) {
Indent(o, indent) << "<key>alternate</key>";
EmitString(o, s) << '\n';
OpenPOWER on IntegriCloud