diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-09-01 17:28:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-09-01 17:28:48 +0000 |
commit | 0080f0ca30cd35e59347d632a261951f01a8129e (patch) | |
tree | b12413ee5c76c0defd4ce0df4dea9c49ed06184c /lib/Frontend/VerifyDiagnosticsClient.cpp | |
parent | 2ef6944d529c94824f5bf96f65665f5bee30f5a2 (diff) |
StringRefize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/VerifyDiagnosticsClient.cpp')
-rw-r--r-- | lib/Frontend/VerifyDiagnosticsClient.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Frontend/VerifyDiagnosticsClient.cpp b/lib/Frontend/VerifyDiagnosticsClient.cpp index c7c84c1a5d..31eb28f912 100644 --- a/lib/Frontend/VerifyDiagnosticsClient.cpp +++ b/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; } |