summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-09-01 17:28:48 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-09-01 17:28:48 +0000
commit2bd4cee51646babc4c9f749b6c49bb0a2fdd8f98 (patch)
treefec82486e0766d0bd60654ae097f73b71ead3c5c /clang
parent57879faf914977e2025f8f9ff2c9f89eefdb312b (diff)
downloadbcm5719-llvm-2bd4cee51646babc4c9f749b6c49bb0a2fdd8f98.tar.gz
bcm5719-llvm-2bd4cee51646babc4c9f749b6c49bb0a2fdd8f98.zip
StringRefize.
llvm-svn: 112718
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Frontend/VerifyDiagnosticsClient.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Frontend/VerifyDiagnosticsClient.cpp b/clang/lib/Frontend/VerifyDiagnosticsClient.cpp
index c7c84c1a5d0..31eb28f912c 100644
--- a/clang/lib/Frontend/VerifyDiagnosticsClient.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticsClient.cpp
@@ -171,13 +171,12 @@ public:
: Begin(Begin), End(End), C(Begin), P(Begin), PEnd(NULL) { }
// Return true if string literal is next.
- bool Next(const std::string &S) {
- std::string::size_type LEN = S.length();
+ bool Next(llvm::StringRef S) {
P = C;
- PEnd = C + LEN;
+ PEnd = C + S.size();
if (PEnd > End)
return false;
- return !memcmp(P, S.c_str(), LEN);
+ return !memcmp(P, S.data(), S.size());
}
// Return true if number is next.
@@ -198,9 +197,9 @@ public:
// Return true if string literal is found.
// When true, P marks begin-position of S in content.
- bool Search(const std::string &S) {
+ bool Search(llvm::StringRef S) {
P = std::search(C, End, S.begin(), S.end());
- PEnd = P + S.length();
+ PEnd = P + S.size();
return P != End;
}
OpenPOWER on IntegriCloud