From 409506ea07a52d43192a64be819dee29d030eaac Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Tue, 16 Feb 2016 02:14:44 +0000 Subject: [PATCH] Simplify users of StringRef::{l,r}trim (clang) (NFC) r260925 introduced a version of the *trim methods which is preferable when trimming a single kind of character. Update all users in clang. llvm-svn: 260927 --- clang/lib/Lex/PPDirectives.cpp | 2 +- clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp | 2 +- clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index cbb079c..645d090 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1226,7 +1226,7 @@ void Preprocessor::HandleUserDiagnosticDirective(Token &Tok, // Find the first non-whitespace character, so that we can make the // diagnostic more succinct. - StringRef Msg = StringRef(Message).ltrim(" "); + StringRef Msg = StringRef(Message).ltrim(' '); if (isWarning) Diag(Tok, diag::pp_hash_warning) << Msg; diff --git a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp index 504b8b3..a25f3e0 100644 --- a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -1000,7 +1000,7 @@ void EmptyLocalizationContextChecker::MethodCrawler::VisitObjCMessageExpr( return; StringRef Comment = - StringRef(Result.getLiteralData(), Result.getLength()).trim("\""); + StringRef(Result.getLiteralData(), Result.getLength()).trim('"'); if ((Comment.trim().size() == 0 && Comment.size() > 0) || // Is Whitespace Comment.empty()) { diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp index 4cbe97b..c038a26 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp @@ -75,7 +75,7 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE, // _dispatch_once is then a function which then calls the real dispatch_once. // Users do not care; they just want the warning at the top-level call. if (CE->getLocStart().isMacroID()) { - StringRef TrimmedFName = FName.ltrim("_"); + StringRef TrimmedFName = FName.ltrim('_'); if (TrimmedFName != FName) FName = TrimmedFName; } -- 2.7.4