diff --git a/clang/lib/AST/CommentBriefParser.cpp b/clang/lib/AST/CommentBriefParser.cpp index 2a5f7452b776b..f9fb5a05fd768 100644 --- a/clang/lib/AST/CommentBriefParser.cpp +++ b/clang/lib/AST/CommentBriefParser.cpp @@ -8,15 +8,12 @@ #include "clang/AST/CommentBriefParser.h" #include "clang/AST/CommentCommandTraits.h" +#include "clang/Basic/CharInfo.h" namespace clang { namespace comments { namespace { -inline bool isWhitespace(char C) { - return C == ' ' || C == '\n' || C == '\r' || - C == '\t' || C == '\f' || C == '\v'; -} /// Convert all whitespace into spaces, remove leading and trailing spaces, /// compress multiple spaces into one. @@ -26,7 +23,7 @@ void cleanupBrief(std::string &S) { for (std::string::iterator I = S.begin(), E = S.end(); I != E; ++I) { const char C = *I; - if (isWhitespace(C)) { + if (clang::isWhitespace(C)) { if (!PrevWasSpace) { *O++ = ' '; PrevWasSpace = true; @@ -44,12 +41,7 @@ void cleanupBrief(std::string &S) { } bool isWhitespace(StringRef Text) { - for (StringRef::const_iterator I = Text.begin(), E = Text.end(); - I != E; ++I) { - if (!isWhitespace(*I)) - return false; - } - return true; + return llvm::all_of(Text, clang::isWhitespace); } } // unnamed namespace