r260927 - Simplify users of StringRef::{l,r}trim (clang) (NFC)
Vedant Kumar via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 15 18:14:44 PST 2016
Author: vedantk
Date: Mon Feb 15 20:14:44 2016
New Revision: 260927
URL: http://llvm.org/viewvc/llvm-project?rev=260927&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=260927&r1=260926&r2=260927&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Mon Feb 15 20:14:44 2016
@@ -1226,7 +1226,7 @@ void Preprocessor::HandleUserDiagnosticD
// 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;
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp?rev=260927&r1=260926&r2=260927&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp Mon Feb 15 20:14:44 2016
@@ -1000,7 +1000,7 @@ void EmptyLocalizationContextChecker::Me
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()) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp?rev=260927&r1=260926&r2=260927&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp Mon Feb 15 20:14:44 2016
@@ -75,7 +75,7 @@ void MacOSXAPIChecker::CheckDispatchOnce
// _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;
}
More information about the cfe-commits
mailing list